Helping ordinary people create extraordinary websites!

Go Back   Web Development Forum > Website Management > Scripts and Software
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-20-2009, 05:36 AM
Member
 
Join Date: Sep 2008
Posts: 71
Default Flash Video Cue Point Control with Flash Video MX Pro

Flash Video MX Pro is capable of adding cue points in the generated Flash video (FLV) files. This is a great feature which allows you to synchronize video clips with other Flash elements. Cue points are invisible markers in a video file which can be used to trigger external events such as synchronizing graphics, subtitles, etc; providing navigation options; loading other video files or SWF movies, etc.

Flash video Cue points don't do anything by themselves. They are merely passive markers. To make use cue points you need to write some Actionscript in the SWF file which contains the Flash Video file. The Actionscript code "listens" to the preset cue points and takes whatever action you specify when it encounters one.

With the CuePoint, professional users can import single video file for encoding or multiple video files for encoding at once.

Launch Flash Video MX Pro; add CuePoint; see the pictures below:





When the video plays to the frame that you want to add cue point, click the Add button and select a cue point type from the pop-up list. There are two types of cue point you get: Add Event, Add Navigation. If you want to delete the selected cue point, just click the button named “Delete cuepoints”.


After you finish your setting, then the cue point effect will be appear in the output file you get in the end.


Generally, Cue Points can be embedded in the FLV file when you encode it. This creates permanent cue points. When the FLV file is played to a preset time point, it will trigger the onCuePoint Event. If you don't want to apply the player offered by the Flash Video MX, you can apply your Action Script to play FLV, coding like the following:

var nc = new NetConnection(); //construct a NetConnection Object
nc.connect(null); //make a connection
var ns = new NetStream(nc); //construct a NetStream Object with nc
videoScr.attachVideo(ns); //videoScr is a video instance placed in the scene
ns.play("xxx.flv"); //to start play the video, xxx.flv is your flv name, it can be an absolute or relative URL
ns.pause(true); //pause video
ns.pause(false); //resume to play video
ns.seek(t); //seek to t seconds
ns. onCuePoint = function(info)
{
trace(info.name); //get cue point name
trace(info.time); //get cue point time in seconds
trace(info.type); //get cue point type, "event" or"naviagtion"
trace(info.parameters["param_name"]); //get cue point's param_name value
}

If you apply the player offered by the Flash Video MX to play the FLV file, you can handle Cue Point Event like the following. Please refer to the document for Player API for more details.

var listener:Object = new Object();//construct an event listener object
listener.onEvent = function(sender, type, name, info)
{
if (name == "onCuePoint") {//handle onCuePoint event
trace(info.name);//get cue point name
trace(info.time); //get cue point time in seconds
trace(info.type);//get cue point type, "event" or"naviagtion"
trace(info.parameters["param_name"]);//get cue point's param_name value
}
}
thePlayer.AddListener(listener);//add event listener so that the listener can get the "onCuePoint" event.

Last edited by nina7683 : 03-26-2009 at 03:09 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

All times are GMT -5. The time now is 03:22 AM.


Website Design by Ducani Media Group
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.