Skip to content

Instantly share code, notes, and snippets.

@Dottenpixel
Created August 22, 2011 00:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Dottenpixel/1161365 to your computer and use it in GitHub Desktop.
Save Dottenpixel/1161365 to your computer and use it in GitHub Desktop.
Flowplayer : Dynamically set cuepoints to fire an event at certain points in Clip's play progress
$f("", {},
{
clip: {
onMetaData: function(c) {
var fd = c.duration;
//create a cue point for 25, 50 and 75% of player progress
var cues = [
{
time: fd * .25 * c.cuepointMultiplier,
name: "25%"
},
{
time: fd * .5 * c.cuepointMultiplier,
name: "50%"
},
{
time: fd * .75 * c.cuepointMultiplier,
name: "75%"
}
];
c.onCuepoint(
// each integer represents milliseconds in the timeline cues,
// this function is triggered when a cuepoint is reached
function(clip, cuepoint) {
console.log("progress : " + cuepoint.name);
}
);
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment