From 2bcd81c4868dbe254e0f9a8ce09896ba5ac34c6d Mon Sep 17 00:00:00 2001 From: db123 Date: Fri, 24 Apr 2026 23:39:05 +0330 Subject: [PATCH] feat: added prefix class and initialize of BasicUI --- src/core/VideoPlayer.ts | 9 +++++++-- src/types/index.ts | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/core/VideoPlayer.ts b/src/core/VideoPlayer.ts index dfa387d..007e393 100644 --- a/src/core/VideoPlayer.ts +++ b/src/core/VideoPlayer.ts @@ -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; 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("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(); } diff --git a/src/types/index.ts b/src/types/index.ts index 57ef09e..1a55086 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -26,6 +26,7 @@ export interface PlayerConfig { loop?: boolean; muted?: boolean; adapters?: AdapterConfig; + prefixClass: string; } export interface ControlConfig {