我正在使用跨瀏覽器解決方案播放.mp4視頻文件。我必須支持IE8及之後的版本。我正在使用這裏提到的解決方案Dev-Metal。我已經成功配置了一切,它正在工作。更新flashVars流媒體更改通過swfObject視頻
但是,我的要求涉及更改動態播放的視頻使用javascript/jQuery。 我已經成功完成了HTML5視頻標籤;但我在Flash播放器遇到問題。我是閃存集成的新手。
這裏是我的html代碼:
<video id="introPageVideoPlayer" controls="controls" poster="../script/videoplayer/img/demo.jpg" width="978" height="348">
<!-- .mp4 file for native playback in IE9+, Firefox, Chrome, Safari and most mobile browsers -->
<source src="../script/videoplayer/vid/demo.mp4" type="video/mp4" />
<!-- flash fallback for IE6, IE7, IE8 and Opera -->
<object type="application/x-shockwave-flash"
data="../script/videoplayer/swf/flowplayer-3.2.18.swf" width="978" height="348">
<param name="movie" value="../script/videoplayer/swf/flowplayer-3.2.18.swf" />
<param name="allowFullScreen" value="true" />
<param name="wmode" value="transparent" />
<!-- note the encoded path to the image and video files, relative to the .swf! -->
<param name="flashVars" value="config={'playlist':[ '..%2Fscript%2Fvideoplayer%2Fimg%2Fdemo.jpg',
{'url':'..%2Fscript%2Fvideoplayer%2Fvid%2Fdemo.mp4','autoPlay':false}
]}" />
<!-- fallback image if flash fails -->
<a href="http://get.adobe.com/flashplayer/">
<img src="../script/videoplayer/img/noFlashPlayer.png" width="978" height="348" title="No Flash found" />
</a>
</object>
我也搜索了SO不同的解決方案。我現在試圖使用swfObject。我曾嘗試玩,但我只是不明白如何更新flashVars屬性,因爲它正在採取一個對象。
這裏是我的javascript:
var flashvars = {};
flashvars.??? = "SampleVideo.mp4";
var params = {};
params.allowfullscreen = "true";
var attributes = {};
swfobject.embedSWF("flowplayer-3.2.18.swf", "flashContainer", "800", "600", "9.0.0", false, flashvars, params, attributes);
請幫我在這方面。