Skip to content

Instantly share code, notes, and snippets.

@lennardtastic
Forked from frederikvanhasselt/usblVideoEnded.html
Last active September 14, 2017 13:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lennardtastic/e3081b5ab2e73059e7b48ff68a4108d3 to your computer and use it in GitHub Desktop.
Save lennardtastic/e3081b5ab2e73059e7b48ff68a4108d3 to your computer and use it in GitHub Desktop.
<!-- Example HTML video -->
<video width="400" controls id="vjs_video_3_html5_api">
<source src="video_filename.mp4" type="video/mp4">
Your current browser does not support HTML5 video.
</video>
<!-- Add this piece of script to the frame that you load where the video is located. -->
<!-- Make sure to change the ID of the video element on which you want to target -->
<!-- Additionally make sure to add the manual trigger to the campaign you want to show -->
<script>
var usblVid = document.getElementById("vjs_video_3_html5_api");
usblVid.addEventListener("ended", usblCpgmnVideoEnded);
function usblCpgmnVideoEnded(){
window.usabilla_live('trigger', 'vjsEnded');
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment