feat: made index main export option only
and added plugin type which i will add to it later on
This commit is contained in:
21
src/index.ts
21
src/index.ts
@@ -5,22 +5,5 @@
|
||||
* creation: 21/4/2026
|
||||
*/
|
||||
|
||||
class VP {
|
||||
videoElement: HTMLElement | null;
|
||||
videoSources?: NodeListOf<HTMLSourceElement>;
|
||||
config?: Array<string | boolean>;
|
||||
|
||||
/**
|
||||
* @param {string} video The targeted video element
|
||||
* @param {Array<string>} config The config array
|
||||
*/
|
||||
constructor(video: string, config: Array<string | boolean> = []) {
|
||||
this.videoElement = document.querySelector(video);
|
||||
this.videoSources = this.videoElement?.querySelectorAll("source");
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
private adapters(): void {}
|
||||
private ui(): void {}
|
||||
private plugins(): void {}
|
||||
}
|
||||
export { VP } from "./core/index";
|
||||
export type { PlayerConfig, Plugin } from "./types/index";
|
||||
|
||||
@@ -35,3 +35,8 @@ export interface PlayerEvents {
|
||||
onEnd?: () => void;
|
||||
onError?: () => void;
|
||||
}
|
||||
|
||||
export interface Plugin {
|
||||
name: string;
|
||||
init(player: any): void;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user