OSMF - add an actionscript cuepoint to a video?
Posted
by redconservatory
on Stack Overflow
See other posts from Stack Overflow
or by redconservatory
Published on 2010-06-05T15:58:11Z
Indexed on
2010/06/05
16:02 UTC
Read the original article
Hit count: 311
I'm trying to add a cuepoint to a video using OSMF. I built an OSMF video player, and I'd like to use this instead of the FLVPlayback component, which seems like the only way to add an actionscript cuepoint?
Anyhow, I created a cuepoint by writing this:
var cuePoint:CuePoint = new CuePoint(CuePointType.ACTIONSCRIPT, 1, "good point", null);
videoElement.addEventListener(MediaElementEvent.METADATA_ADD, onMetadataAdd);
trace(cuePoint.time);
The cuepoint time traced out to "1" (successful).
I then took this code from the documentation, thinking it would help trace the cuepoint when I published my movie (to test the video)
private function onMetadataAdd(event:MediaElementEvent):void
{
if (event.namespaceURL == CuePoint.DYNAMIC_CUEPOINTS_NAMESPACE)
{
var timelineMetadata:TimelineMetadata = videoElement.getMetadata(CuePoint.DYNAMIC_CUEPOINTS_NAMESPACE) as TimelineMetadata;
timelineMetadata.addEventListener(TimelineMetadataEvent.MARKER_TIME_REACHED, onCuePoint);
}
}
private function onCuePoint(event:TimelineMetadataEvent):void
{
var cuePoint:CuePoint = event.marker as CuePoint;
trace("Cue Point at " + cuePoint.time);
}
However, I don't get a trace message when the video hits 1 second. Can anyone help me?
© Stack Overflow or respective owner