diff --git a/src/core/VideoPlayer.ts b/src/core/VideoPlayer.ts index 007e393..5f4fb61 100644 --- a/src/core/VideoPlayer.ts +++ b/src/core/VideoPlayer.ts @@ -26,6 +26,9 @@ export class VP { this.video = this.videoElement(video); this.videoSrc = this.video?.querySelectorAll("source"); + if (!this.config.type) { + throw new Error("Type not specified in config."); + } this.adapter = this.adapterInit(this.config.type); if (config.controls) { diff --git a/src/types/index.ts b/src/types/index.ts index 1a55086..33bfeec 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -17,7 +17,7 @@ export interface AdapterAPI { } export interface PlayerConfig { - type?: "native" | "hls" | "dash"; + type: "native" | "hls" | "dash"; theme?: "dark" | "light"; accent?: string; controls?: boolean | ControlConfig;