我正在构建一个视频数据库并使用 Brightcove 作为我的视频提供者。我的数据库返回一个视频 ID 列表,在选择时,该视频应该加载到一个 div 中并开始播放。
到目前为止,我有这个:
http://bigreviewtv.byteserve.com.au/bcgal2.html
<HTML>
<HEAD>
<script src="/jquery/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="http://admin.brightcove.com/js/BrightcoveExperiences_all.js"></script>
<script>
newVideo = function(videoId) {
var newhtml = [
'<object id="myExperience', videoId, '" class="BrightcoveExperience">'
, '<param name="bgcolor" value="#FFFFFF" />'
, '<param name="width" value="480" />'
, '<param name="height" value="270" />'
, '<param name="playerKey" value="AQ~~,AAACP3r8R8k~,kFpRRbL5Evyu4ko-Z7yiuqqeHKzo4hSs" />'
, '<param name="playerID" value="2472217790001" />'
, '<param name="isVid" value="true" />'
, '<param name="isUI" value="true" />'
, '<param name="@videoPlayer" value="' + videoId + '" />'
, '<param name="dynamicStreaming" value="true" />'
, '</object>'
];
//return $(newhtml.join('')).appendTo('#hero');
//$("#hero").html(newhtml.join(''));
//alert(newhtml.join(''));
brightcove.createExperiences();
};
</script>
</HEAD>
<BODY>
<div id="hero" style="border:1px red dotted">
<object id="myExperience2472866007001" class="BrightcoveExperience">
<param name="bgcolor" value="#FFFFFF" />
<param name="width" value="480" />
<param name="height" value="270" />
<param name="playerID" value="2472217790001" />
<param name="playerKey" value="AQ~~,AAACP3r8R8k~,kFpRRbL5Evyu4ko-Z7yiuqqeHKzo4hSs" />
<param name="isVid" value="true" />
<param name="isUI" value="true" />
<param name="dynamicStreaming" value="true" />
<param name="@videoPlayer" value="2472866007001" />
</object>
</div>
<div id="video-gallery">
<div id="video-full"></div>
<ul id="video-thumbs">
<li><a href="javascript:newVideo('2472862365001')">Video 1</a></li>
<li><a href="javascript:newVideo(2472940937001)">Video 2</a></li>
<li><a href="javascript:newVideo(2472916922001)">Video 3</a></li>
</ul>
</div><!-- /#video-gallery -->
</BODY>
</HTML>
<script type="text/javascript">brightcove.createExperiences();</script>
不幸的是,它没有按预期工作。任何帮助,将不胜感激。