Set cue points for the VideoDisplay control by using the cuePointManager property. : VideoDisplay « Graphics « Flex






Set cue points for the VideoDisplay control by using the cuePointManager property.

Set cue points for the VideoDisplay control by using the cuePointManager property.
        
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Script>
        
        import mx.events.CuePointEvent;
        
        private function initCP():void {
            var myCuePoints:Array = [
                { name: "first", time: 10},
                { name: "second", time: 20} ];        
            myVid.cuePointManager.setCuePoints(myCuePoints);
        }
        private var currentCP:Object=new Object();
        
        private function cpHandler(event:CuePointEvent):void {
            cp.text="go to cuepoint: " + event.cuePointName + " " + String(event.cuePointTime);
            currentCP.name=event.cuePointName;
            currentCP.time=event.cuePointTime;
            myVid.cuePointManager.removeCuePoint(currentCP);
            cp.text="Cue points remaining: " + String(myVid.cuePointManager.getCuePoints().length);
        }
      
    </mx:Script>
    <mx:VBox>
        <mx:VideoDisplay id="myVid" initialize="initCP();"
            cuePointManagerClass="mx.controls.videoClasses.CuePointManager"
            source="http://localhost:8100/MyVideo.flv"
            cuePoint="cpHandler(event);" />
        <mx:TextArea id="cp" width="200" />
    </mx:VBox>
</mx:Application>

   
    
    
    
    
    
    
    
  








Related examples in the same category

1.Look up VideoDisplay's metadata cuePoints and compare to current cue point object
2.Listen for a Flash Video's cue points with VideoDisplayListen for a Flash Video's cue points with VideoDisplay
3.Use Button to control VideoDisplayUse Button to control VideoDisplay
4.Ready, rewind, playheadUpdate, close, complete and progress actions for VideoDisplayReady, rewind, playheadUpdate, close, complete and progress actions for VideoDisplay
5.autoPlay, autoRewind for VideoDisplayautoPlay, autoRewind for VideoDisplay
6.Detect connection error when loading flv with VideoDisplayDetect connection error when loading flv with VideoDisplay
7.Detecting a connection error when loading an FLV with the VideoDisplay controlDetecting a connection error when loading an FLV with the VideoDisplay control
8.Use a VideoDisplay controlUse a VideoDisplay control
9.Use VideoDisplay.attachCamera() method to display a video stream from a camera
10.Use VideoDisplay control to import a media stream from Macromedia Flash Media Server 2 from Adobe
11.A VideoDisplay control
12.When the playhead of the VideoDisplay control reaches a cue point, it dispatches a cuePoint event
13.VideoDisplay CuePoint Manager
14.VideoDisplay Camera
15.VideoDisplay FMSVideoDisplay FMS
16.Load video with Remote Data ProvidersLoad video with Remote Data Providers
17.Play video with VideoPlayPlay video with VideoPlay
18.Play video from a URLPlay video from a URL
19.Create a Video DisplayCreate a Video Display
20.Complete and mediaPlayerStateChange events dispatched by the VideoPlayer controlComplete and mediaPlayerStateChange events dispatched by the VideoPlayer control
21.Show the user of the DynamicStreamingVideoSource objectShow the user of the DynamicStreamingVideoSource object
22.Dispatch a cuePoint eventDispatch a cuePoint event
23.CuePointEvent DemoCuePointEvent Demo
24.Use the pause() and play() to pause or play an FLV fileUse the pause() and play() to pause or play an FLV file