feat: implemented and passed correct api of player
This commit is contained in:
@@ -12,7 +12,7 @@ export class VP {
|
||||
private video: HTMLVideoElement | null;
|
||||
private videoSrc?: NodeListOf<HTMLSourceElement>;
|
||||
private config?: PlayerConfig;
|
||||
private adapter?: AdapterAPI;
|
||||
private adapter: AdapterAPI;
|
||||
|
||||
/**
|
||||
* @param video The targeted video element or id
|
||||
@@ -33,4 +33,47 @@ export class VP {
|
||||
this.videoSrc = this.video?.querySelectorAll("source");
|
||||
this.adapter = new NativeAdapter(this.video);
|
||||
}
|
||||
|
||||
load(): void {
|
||||
this.adapter.load();
|
||||
}
|
||||
|
||||
play(): void {
|
||||
this.adapter.play();
|
||||
}
|
||||
|
||||
pause(): void {
|
||||
this.adapter.pause();
|
||||
}
|
||||
|
||||
destroy(): void {
|
||||
this.adapter.destroy();
|
||||
}
|
||||
|
||||
get time(): number {
|
||||
return this.adapter.time;
|
||||
}
|
||||
|
||||
set time(time: number) {
|
||||
this.adapter.time = time;
|
||||
}
|
||||
|
||||
get volume(): number {
|
||||
return this.adapter.volume;
|
||||
}
|
||||
|
||||
set volume(volume: number) {
|
||||
this.adapter.volume = volume;
|
||||
}
|
||||
|
||||
get muted(): boolean {
|
||||
return this.adapter.muted;
|
||||
}
|
||||
set muted(muted: boolean) {
|
||||
this.adapter.muted = muted;
|
||||
}
|
||||
|
||||
duration(): number {
|
||||
return this.adapter.duration();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user