feat: added prefix class and initialize of BasicUI
This commit is contained in:
@@ -7,12 +7,14 @@
|
||||
|
||||
import { NativeAdapter } from "../adapters";
|
||||
import { AdapterAPI, PlayerConfig } from "../types/index";
|
||||
import { BaseUI } from "../ui";
|
||||
|
||||
export class VP {
|
||||
private video: HTMLVideoElement;
|
||||
private videoSrc?: NodeListOf<HTMLSourceElement>;
|
||||
private config?: PlayerConfig;
|
||||
private adapter: AdapterAPI;
|
||||
private ui?: BaseUI;
|
||||
|
||||
/**
|
||||
* @param video The targeted video element or id
|
||||
@@ -22,10 +24,13 @@ export class VP {
|
||||
this.config = config;
|
||||
|
||||
this.video = this.videoElement(video);
|
||||
|
||||
this.videoSrc = this.video?.querySelectorAll<HTMLSourceElement>("source");
|
||||
|
||||
this.adapter = this.adapterInit(config.type);
|
||||
this.adapter = this.adapterInit(this.config.type);
|
||||
|
||||
if (config.controls) {
|
||||
this.ui = new BaseUI(this, this.video, this.config.prefixClass);
|
||||
}
|
||||
|
||||
this.info();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user