fix: made type in config required
throws error if not present
This commit is contained in:
@@ -26,6 +26,9 @@ export class VP {
|
||||
this.video = this.videoElement(video);
|
||||
this.videoSrc = this.video?.querySelectorAll<HTMLSourceElement>("source");
|
||||
|
||||
if (!this.config.type) {
|
||||
throw new Error("Type not specified in config.");
|
||||
}
|
||||
this.adapter = this.adapterInit(this.config.type);
|
||||
|
||||
if (config.controls) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user