Skip to content

Instantly share code, notes, and snippets.

@BCdmlap
Created August 23, 2012 00:11
Show Gist options
  • Save BCdmlap/3430777 to your computer and use it in GitHub Desktop.
Save BCdmlap/3430777 to your computer and use it in GitHub Desktop.
<!doctype html>
<html>
<head>
<title>BC-31070</title>
</head>
<body>
<script type="text/javascript" src="http://DLaPalomento-Mac.vidmark.local:8080/cdn/js/BrightcoveExperiences.js"></script>
<object id="myExperience" class="BrightcoveExperience">
<param name="bgcolor" value="#FFFFFF" />
<param name="width" value="486" />
<param name="height" value="412" />
<param name="playerID" value="30300015453001" />
<param name="playerKey" value="AQ~~,AAAAAAAAIUs~,CSUeqpiCtLpL7qHV0LQrUjHvT-uMiT0W" />
<param name="isVid" value="true" />
<param name="dynamicStreaming" value="true" />
<param name="forceHTML" value="true" />
<param name="@videoPlayer" value="30704000811001" />
</object>
<script src="jquery-1.7.1.min.js"></script>
<script src="bc.js"></script>
<script>
bc.ready(function() {
var
cuePoints = bc.player.getModule('cuePoints'),
CuePointEvent = brightcove.api.events.CuePointEvent.CUE,
PlayEvent = brightcove.api.events.MediaEvent.PLAY,
hasPlayed = false,
cuesFired = 0;
cuePoints.addEventListener(CuePointEvent, function(e) {
console.log(e.cuePoint.name);
if (cuesFired++ < 2) {
return;
}
cuesFired = -999;
console.log('adding cues');
// cuePoints.clearCodeCuePoints(30704000811001);
cuePoints.addCuePoints(30704000811001, [
{ time: 4, name: 'new4' },
{ time: 5, name: 'new5' },
{ time: 6, name: 'new6' }
]);
});
/*
bc.video.addEventListener(PlayEvent, function() {
console.log('play');
if (hasPlayed) {
return;
}
hasPlayed = true;
cuePoints.clearCodeCuePoints(30704000811001);
cuePoints.addCuePoints(30704000811001, [
{ time: 1, name: 'new1' },
{ time: 2, name: 'new2' },
{ time: 3, name: 'new3' }
]);
});
*/
cuePoints.addCuePoints(30704000811001, [
{ time: 1, name: '1' },
{ time: 2, name: '2' },
{ time: 3, name: '3' }]);
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment