Popcorn.js and Conducttr

Below is some sample working code. Paste into to play with it and replace the variable myLocation with your own API URL. You'll need an API trigger with matchphrase including unauth/

You can use this simple ping to count how many viewers watched though to 5 seconds into the video.

<!doctype html>

<script src=""></script>
// ensure the web page (DOM) has loaded
document.addEventListener("DOMContentLoaded", function () {

// Create a popcorn instance by calling Popcorn("#id-of-my-video")
var pop = Popcorn("#ourvideo");
var myLocation = '';

// ping URL at 5 seconds

start: 5,
end: 60,
onStart: function loadUrl()
function( data ) {
`data` will be the parsed json object


// play the video right away;

}, false);
<video height="180" width="300" id="ourvideo" controls>
<source src="">
<source src="">
<source src="">
<div id="footnotediv"></div>

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request