You can view the test page here.
I a using the solution SO here.
I am also using the Modernizr javascript lib as directed in the noted posting.
The problem is this: the page loads fine and I can change the video clip to play using the drop-down menu in Crome, FireFox and Safari. But for some reason in IE9 although the video changes as selected if the previous video was running the new video loads in a paused state i.e. instead of having the 'play' button, it shows the 'pause' button state.
here is my code: HTML:
<video id="vidScreen" width="624" height="260" preload="auto" controls="controls"></video>
Javascript: (for initial video clip load)
function doMetaphorsInitialise() { window.document.getElementById("metaphorsStyle").disabled = false;
var targetMovie = window.document.getElementById("vidScreen");
targetMovie.volume = 1;
if (Modernizr.video && Modernizr.video.h264)
{
targetMovie.setAttribute("src", "inception/inception.mp4");
}
else if (Modernizr.video && Modernizr.video.ogg)
{
targetMovie.setAttribute("src", "inception/inception.ogg");
}
else if (Modernizr.video && Modernizr.video.webm)
{
targetMovie.setAttribute("src", "inception/inception.webm");
}
document.forms["metaphorsMenu"].reset();
}
Javascript: (For canges in the drop-down menu:
function doMetaphors()
{
var v = new Array();
v["what"] = [
"what/what.mp4",
"what/what.ogg",
"what/what.webm"
];
v["bullet"] = [
"bullet/bullet.mp4",
"bullet/bullet.ogg",
"bullet/bullet.webm"
];
v["seven"] = [
"seven/seven.mp4",
"seven/seven.ogg",
"seven/seven.webm"
];
v["anderson"] = [
"anderson/anderson.mp4",
"anderson/anderson.ogg",
"anderson/anderson.webm"
];
v["smith"] = [
"videos/video3.webmvp8.mp4",
"videos/video3.theora.ogg",
"videos/video3.mp4video.webm"
];
v["everything"] = [
"everything/everything.mp4",
"everything/everything.ogg",
"everything/everything.webm"
];
var menuID = window.document.getElementById("metaphorsStyle");
var getDestination = menuID[menuID.selectedIndex].value;
var targetMovie = window.document.getElementById("vidScreen");
if (Modernizr.video && Modernizr.video.h264)
{
targetMovie.setAttribute("src", v[getDestination][0]);
}
else if (Modernizr.video && Modernizr.video.ogg)
{
targetMovie.setAttribute("src", v[getDestination][1]);
}
else if (Modernizr.video && Modernizr.video.webm)
{
targetMovie.setAttribute("src", v[getDestination][2]);
}
//targetMovie.load();
}
I commented out the targetMovie.load(); is it does not seem to be necessary but even with that it is not working.
I have also considered:
targetMovie.addEventListener('loadeddata', initialiseControls, false);
So in initialiseControls I could toggle the play/pause button but have not found any info on the web.
Hope my query is clear and not too long.
Would really love some help on this.
Thank you very much.
NEWS: I have now made all the options in the drop-down menu functional so you may choose any item and witness the behaviour I am trying to correct in IE9. Thank you again.