feat: made more modular

This commit is contained in:
2026-04-22 14:57:49 +03:30
parent b4dc0476a0
commit cc02d08f9f
2 changed files with 29 additions and 0 deletions

28
src/core/VideoPlayer.ts Normal file
View File

@@ -0,0 +1,28 @@
/**
* main player
*
* author: db123 at db
* creation: 21/4/2026
*/
import { PlayerConfig, HLSOptions, DASHOptions } from "../types/index";
export class VP {
videoElement: HTMLElement | null;
videoSources?: NodeListOf<HTMLSourceElement>;
config?: PlayerConfig;
/**
* @param {string} video The targeted video element
* @param {PlayerConfig} config The config array
*/
constructor(video: string, config: PlayerConfig) {
this.config = config;
this.videoElement = document.querySelector(video);
this.videoSources = this.videoElement?.querySelectorAll("source");
}
private adapters(): void {}
private ui(): void {}
private plugins(): void {}
}

1
src/core/index.ts Normal file
View File

@@ -0,0 +1 @@
export { VP } from "./VideoPlayer";