UNPKG

ngx-audio-control

Version:

Audio Player control for angular projects with speed control by native player in browser (HTML5)

93 lines (90 loc) 3.26 kB
import { ElementRef, OnInit } from '@angular/core'; import { PlayList } from '../models/play-list'; import * as i0 from "@angular/core"; export declare class NgxAudioControlComponent implements OnInit { /** * Show play list button */ showList: boolean; /** * Show download button */ download: boolean; /** * Display filename in header */ showFileName: boolean; /** * Show speed control */ showSpeed: boolean; /** * Show volume control */ showVolume: boolean; /** * Display vertically or horizontally between control buttons and range seeker */ linear: boolean; /** This enumerated attribute is intended to provide a hint to the browser about what the author thinks will lead to the best user experience. It may have one of the following values: * #### `none`: Indicates that the audio should not be preloaded. #### `metadata`: Indicates that only audio metadata (e.g. length) is fetched. #### `auto`: Indicates that the whole audio file can be downloaded, even if the user is not expected to use it. ## Usage notes: The autoplay attribute has precedence over preload. If autoplay is specified, the browser would obviously need to start downloading the audio for playback. The browser is not forced by the specification to follow the value of this attribute; it is a mere hint. ## Default value is `metadata` */ preload: 'none' | 'metadata' | 'auto'; /** * set header when duration is inifinity and require call fetch request for get duration */ fetchHeaders: HeadersInit | undefined; /** * An array list of file addresses in the form of strings */ set fileList(val: string[]); downloading: boolean; fineName: string; speedDisplay: string; audioFiles: PlayList[]; currentTime: string; totalTime: string; options: { emptyListMessage: string; }; togglePlayList: boolean; currentAudioIndex: number; currentFileAddress: string; audio: ElementRef<HTMLAudioElement>; seekSlider: { min: number; max: number; value: number; }; buffering: boolean; errorLoad: boolean; constructor(); ngOnInit(): void; private initialize; playPause(): void; play(offset?: number): void; stop(): void; muteUnmute(): void; seekAudio(ev: Event): void; increaseSpeed(): void; decreaseSpeed(): void; changeVolume(ev: Event): void; previous(): void; next(): void; playNext(): void; onClickPlayList(index: number): void; downloadCurrentFile(): void; private getDuration; static ɵfac: i0.ɵɵFactoryDeclaration<NgxAudioControlComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<NgxAudioControlComponent, "ngx-audio-control", never, { "showList": "showList"; "download": "download"; "showFileName": "showFileName"; "showSpeed": "showSpeed"; "showVolume": "showVolume"; "linear": "linear"; "preload": "preload"; "fetchHeaders": "fetchHeaders"; "fileList": "fileList"; }, {}, never, never, false>; }