I am trying to modify this code:
http://v4e.thewikies.com/[
^]
the <video> html versions are fine, but for the flash player none of my event listeners work. I need to do the following:
- only play the video after it has buffered
- autoplay once buffered
- start a function (setup) on play of the video
This is what I have:
<video id="vid" width="640" height="360" preload="auto" poster="http://sandbox.thewikies.com/vfe-generator/images/big-buck-bunny_poster.jpg">
<source src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4" type="video/mp4"></source>
<source src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.webm" type="video/webm"></source>
<source src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.ogv" type="video/ogg"></source>
<object width="640" height="360" data="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf" type="application/x-shockwave-flash">
<param name="movie" value="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf">
<param name="allowFullScreen" value="true">
<param name="wmode" value="transparent">
<param name="flashVars" value="config={'playlist':['http%3A%2F%2Fsandbox.thewikies.com%2Fvfe-generator%2Fimages%2Fbig-buck-bunny_poster.jpg',{'url':'http%3A%2F%2Fclips.vorwaerts-gmbh.de%2Fbig_buck_bunny.mp4','autoPlay':false}]}">
<img width="640" height="360" title="No video playback capabilities, please download the video below" alt="Big Buck Bunny" src="http://sandbox.thewikies.com/vfe-generator/images/big-buck-bunny_poster.jpg">
</object>
</video>
java:
function addMyListeners(){
var myVideo = document.getElementsByTagName('video')[0];
myVideo.addEventListener('loadedmetadata', getPercentProg, false);
myVideo.addEventListener('canplaythrough', setUp, false);
}
the above starts onload() of body
function getPercentProg() {
var myVideo = document.getElementsByTagName('video')[0];
}
function createTimer(i) {
setTimeout( function() {
}, 1000+i*1000);
}
function setUp() {
var myVideo = document.getElementsByTagName('video')[0];
document.getElementById("loadStatus").style.display = "none";
myVideo.play();
for(var i=0; i < myVideo.duration; i++)
{
createTimer(i);
}
}
the code above works perfect for the html5, as I have said but I cant get any way of them to work with the flash fall-back.
Many thanks