Well, the thing is, for my application, I need to dynamically change the src and currentTime videos. I tried changing both independently, which worked perfectly. But, when I tried to make them together, there are some problems.
This is my video tag and a button on which you need to change which src and currentTime should be changed.
<video id="video" src="sample.mp3" controls autoplay></video>
<button onclick="foobar()">change</button>
and my foobar () function
function foobar()
{
v=document.getElementById("video");
v.src = "foo.mp3";
v.load();
v.currentTime = 3;
}
When I delete v.src or v.currentTime, it works fine ... I tried using networkState and currentState, no luck. I even waited some time (javascript timers) to make sure the new mp3 file was fully downloaded, and then tried to change currentTime. Even that didnβt work.
Please help me..
PS: I do not want to use third-party libraries.