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
|
* creation: 21/4/2026
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class VP {
|
export { VP } from "./core/index";
|
||||||
videoElement: HTMLElement | null;
|
export type { PlayerConfig, Plugin } from "./types/index";
|
||||||
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 {}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -35,3 +35,8 @@ export interface PlayerEvents {
|
|||||||
onEnd?: () => void;
|
onEnd?: () => void;
|
||||||
onError?: () => void;
|
onError?: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface Plugin {
|
||||||
|
name: string;
|
||||||
|
init(player: any): void;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user