我需要将一种方法 - play() - 应用于 flowplayer 对象,但它不起作用,我不明白为什么,我该怎么办?在setupContemporaryEvents()函数中有错误的代码,建议,提前谢谢。
这是html:
<div id="area1" class="player aree" data-engine="flash">
<video id="vid1" preload="none">
<source src="myvideo1.flv" type="video/flv">
</video>
</div>
<div id="area2" class="player aree" data-engine="flash">
<video id="vid2" preload="none">
<source src="myvideo2.flv" type="video/flv">
</video>
</div>
这是javascript:
$(function() {
var video1, video2;
var bVideo1 = false;
var bVideo2 = false;
video1 = $("#area1").flowplayer({swf: "flowplayer-5.3.1/flowplayer.swf"});
video2 = $("#area2").flowplayer({swf: "flowplayer-5.3.1/flowplayer.swf"});
$("#area1").bind("ready", function(e, api) {
bVideo1 = true;
setupContemporaryEvents();
});
$("#area2").bind("ready", function(e, api) {
bVideo2 = true;
setupContemporaryEvents();
});
var setupContemporaryEvents = function(){
if(bVideo1 && bVideo2){
$("#area1").bind("resume", function(e, api) {
// not working
$("#vid2").play();
// not working
$("#area2").play();
// not working
video2.play();
});
}
};
});