ビデオIDを使用してビデオを埋め込むためにJavaScript APIを使用しようとしています。 いくつかのトレイルの後、私はそれを行う方法を見つけました。これを使用する正しい方法であるかどうか、または私が紛失しているものがあるかどうかを確認したいのですか?javascript APIを使用して埋め込まれたBrightcoveビデオ
このコードはうまくいきますが、間違った方法で行っているかどうかを知る必要があります。
<script language="JavaScript" type="text/javascript" src="http://admin.brightcove.com/js/BrightcoveExperiences.js"></script>
<object class="BrightcoveExperience">
<param name="bgcolor" value="#FFFFFF" />
<param name="width" value="480" />
<param name="height" value="270" />
<param name="playerID" value="4942277584001" />
<param name="playerKey" value="AQ~~,AAAEfriyQEE~,ZL37ulQzt-toqcwK_Cwr35Bl9P3znlYu" />
<param name="isVid" value="true" />
<param name="isUI" value="true" />
<param name="dynamicStreaming" value="true" />
<param name="@videoPlayer" value="5072209967002" />
</object>
<!-- This script tag will cause the Brightcove Players defined above it to be created as soon
as the line is read by the browser. If you wish to have the player instantiated only after
the rest of the HTML is processed and the page load is complete, remove the line.-->
<script type="text/javascript">brightcove.createExperiences();</script>
<script type="text/JavaScript">
var player,
APIModules,
videoPlayer;
function onTemplateLoad(experienceID){
player = brightcove.api.getExperience(experienceID);
APIModules = brightcove.api.modules.APIModules;
}
function onTemplateReady(evt){
videoPlayer = player.getModule(APIModules.VIDEO_PLAYER);
videoPlayer.play();
}
</script>
<!-- End of Brightcove Player -->