16.8.监听提示点

问题
我想监听flv中的提示点
解决办法
使用onCuePoint( )回调函数
讨论
FLV格式可嵌入提示点,提示点有各种用处,如:
字幕或提示说明
同步动画
记录视频回放状态

当使用诸如Flash Video Exporter,On2 Flix (http:// www.on2.com),或Sorenson Squeeze (http://
www.sorensonmedia.com)等编码器时会插入一些提示点在flv文件中。当播放这些视频时,经过提示点时Flash播放器会收到提示信息,作为元数据,提示点不是使用标准的事件模型,而是使用了叫做onCuePoint( )的回调函数。和onMetaData( ) 一样onCuePoint( )方法定义为Object,然后赋值给NetStream对象的client属性。

onCuePoint( )方法接受一个参数,类型为object,属性有:
name
提示点的名称
time
提示点所在位置的时间
type
无论是"event"或"navigation," 都由编码时所选择的类型决定
parameters
key/value 对组成的关联数组

看下面的例子演示:
+展开
-ActionScript
var client:Object = new Object( );
client.onCuePoint = onCuePoint;
videoStream.client = client;
Then define the method appropriately:
private function onCuePoint(cuePoint:Object):void {
trace(cuePoint.name + " " + cuePoint.time);
}

加支付宝好友偷能量挖...


评论(0)网络
阅读(92)喜欢(0)flash/flex/fcs/AIR