In the first if check I don't get an error, nut in the else if I get
'VideoSource' only refers to a type, but is being used as a value here.
let element:VideoSource|VideoTrack;
element = {
src: '',
videoType: 'video/mp4'
}
if (element instanceof VideoTrack) {
}
else if (element instanceof VideoSource) {
}
export interface VideoSource {
src:string;
videoType:'video/mp4'|'video/webm'|'video/ogg';
}
export interface VideoTrack {
src:string;
kind: 'subtitles'|'captions'|'chapters'|'descriptions'|'metadata'
label?:string;
srclang?:string;
IsDefault?:'default';
}