Reputation: 4692
I have a video tag, that I dynamically change its source as I am letting the user to choose from a number of videos from the database. The problem is that, i am getting error while calling the load function
Here is my code:
var video = <HTMLInputElement>document.getElementById('introVideo');
video.src = this.videoUrl;
video.load();`
But doing so i am getting a warning
[ts] Property load does not exists on type HTMLInputElement
Upvotes: 0
Views: 723
Reputation: 81
I did not test this, but try casting your HTML element to a HTMLVideoElement
instead of HTMLInputElement
because the method .load()
does not exist on HTMLInputElement
type.
Cheers.
Upvotes: 3