2 Replies Latest reply on Jun 23, 2010 8:39 AM by nchunga

    Adding Actionscript cuepoints to h.264 Video

    nchunga

      I've been looking at the Cue Point Sample:

      http://opensource.adobe.com/svn/opensource/osmf/trunk/apps/samples/framework/CuePointSampl e/src/CuePointSample.mxml

       

      But the sample is written for Flex (I'm using Flash) and it's for .f4v video.

       

      I've read in the forums that you can add actionscript cuepoints for h.264...is there a flash example of this?

        • 1. Re: Adding Actionscript cuepoints to h.264 Video
          nchunga Level 1

          Thanks to some help from another forum...here is the (simplified) code in case anyone needs it

           

          // create a container and add it to the Display List

           

          container = new MediaContainer  ;
          addChild(container);

           

          // create a video element and add it to the container
          mediaElement = new VideoElement(new URLResource(url)); // url --> your h.264 video

           

          container.addMediaElement(mediaElement);

           

          // create a player and add the video to it
          player = new MediaPlayer;

           

          // create timelinemetadata, pass the media element to it

          dynamicTimelineMetadata = new TimelineMetadata(mediaElement);

           

          // create a new cuepoint

          var cuePoint:CuePoint = new CuePoint(CuePointType.ACTIONSCRIPT, 1, "good point", null); // time = 1, name = "good point"

           

          // add the cuepoint to the timeline by using "add marker"

          dynamicTimelineMetadata.addMarker(cuePoint);

           

          // listen for when the cue point is reached
          dynamicTimelineMetadata.addEventListener(TimelineMetadataEvent.MARKER_TIME_REACHED, onCuePoint);

           

          function onCuePoint(event:TimelineMetadataEvent):void
                  {
          var cuePoint:CuePoint = event.marker as CuePoint;
          trace("Cue Point at " + cuePoint.time);
                  }