Note that there are some explanatory texts on larger screens.

plurals
  1. POTrigger Brightcove video play on image click and hide it when video is done
    primarykey
    data
    text
    <p>I'm trying to play a video on image click and hide it when video is done, and so far I have a structure like this: </p> <pre><code>&lt;a href="#"&gt; &lt;div style="display:none"&gt;&lt;/div&gt; &lt;div class="overlay_play_big"&gt;&lt;/div&gt; &lt;div class="overlay_label"&gt; &lt;span class="title"&gt;Bones&lt;/span&gt;&lt;br /&gt; &lt;span class="desc"&gt;Season 8, Episode 19&lt;/span&gt; &lt;/div&gt; &lt;!-- 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/. --&gt; &lt;script type="text/javascript" src="http://admin.brightcove.com/js/BrightcoveExperiences.js"&gt;&lt;/script&gt; &lt;object id="myExperience2768811593001" class="BrightcoveExperience"&gt; &lt;param name="bgcolor" value="#FFFFFF" /&gt; &lt;param name="width" value="470" /&gt; &lt;param name="height" value="292" /&gt; &lt;param name="playerID" value="2764056952001" /&gt; &lt;param name="playerKey" value="AQ~~,AAACg0nERbk~,bDrRQnHHnTJYYUzl4RqDhsPQ_y-ladJF" /&gt; &lt;param name="isVid" value="true" /&gt; &lt;param name="dynamicStreaming" value="true" /&gt; &lt;param name="includeAPI" value="true" /&gt; &lt;param name="templateLoadHandler" value="onTemplateLoaded" /&gt; &lt;param name="templateReadyHandler" value="onTemplateReady" /&gt; &lt;param name="@videoPlayer" value="2768811593001" /&gt; &lt;/object&gt; &lt;script type="text/javascript"&gt; 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"); } &lt;/script&gt; &lt;!-- 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. --&gt; &lt;script type="text/javascript"&gt;brightcove.createExperiences();&lt;/script&gt; &lt;!-- End of Brightcove Player --&gt; &lt;/a&gt; </code></pre> <p>I want to trigger video playback on click of the <code>overlay_play_big</code> div. I'm using the Brightcove API but even this simple alert won't work. The video ends and nothing happens. How can I do this, or am I making a mistake ?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload