feat: added prefix class and initialize of BasicUI

This commit is contained in:
2026-04-24 23:39:05 +03:30
parent 828b7ede8e
commit 2bcd81c486
2 changed files with 8 additions and 2 deletions

View File

@@ -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();
}