画像クリックでビデオを再生し、ビデオが終了したら非表示にしようとしていますが、これまでのところ、次のような構造になっています。
<a href="#">
<div style="display:none"></div>
<div class="overlay_play_big"></div>
<div class="overlay_label">
<span class="title">Bones</span><br />
<span class="desc">Season 8, Episode 19</span>
</div>
<!--
By use of this code snippet, I agree to the Brightcove Publisher T and C
found at https://accounts.brightcove.com/en/terms-and-conditions/.
-->
<script type="text/javascript" src="http://admin.brightcove.com/js/BrightcoveExperiences.js"></script>
<object id="myExperience2768811593001" class="BrightcoveExperience">
<param name="bgcolor" value="#FFFFFF" />
<param name="width" value="470" />
<param name="height" value="292" />
<param name="playerID" value="2764056952001" />
<param name="playerKey" value="AQ~~,AAACg0nERbk~,bDrRQnHHnTJYYUzl4RqDhsPQ_y-ladJF" />
<param name="isVid" value="true" />
<param name="dynamicStreaming" value="true" />
<param name="includeAPI" value="true" />
<param name="templateLoadHandler" value="onTemplateLoaded" />
<param name="templateReadyHandler" value="onTemplateReady" />
<param name="@videoPlayer" value="2768811593001" />
</object>
<script type="text/javascript">
var player, modVP;
function onTemplateLoaded(experienceID) {
player = brightcove.api.getExperience(experienceID);
modVP = player.getModule(brightcove.api.modules.APIModules.VIDEO_PLAYER);
}
function onTemplateReady(evt) {
modVP.addEventListener(brightcove.api.events.MediaEvent.COMPLETE, onComplete);
}
function onComplete(evt) {
alert("Video ended");
}
</script>
<!--
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>
<!-- End of Brightcove Player -->
</a>
overlay_play_big
divのクリックでビデオ再生をトリガーしたい。Brightcove API を使用していますが、この単純なアラートでさえ機能しません。ビデオは終了し、何も起こりません。どうすればこれを行うことができますか、それとも間違っていますか?