Flex Gumbo中如何设置VideoPlayer从头开始播放间隔的例子
By Minidxer | September 14, 2009
接下来的例子演示了Flex Gumbo中如何通过设置playheadUpdateInterval属性,设置VideoPlayer从头开始播放间隔。
下面是完整代码(或点击这里察看):
下面是main.mxml:
- <?xml version="1.0" encoding="utf-8"?>
- <s:Application name="Spark_VideoPlayer_VideoElement_flVideoPlayer_playheadUpdateInterval_test"
- xmlns:fx="http://ns.adobe.com/mxml/2009"
- xmlns:s="library://ns.adobe.com/flex/spark"
- xmlns:mx="library://ns.adobe.com/flex/halo">
- <fx:Script>
- <![CDATA[
- import fl.video.VideoPlayer;
- import spark.events.VideoEvent;
- private function videoPlayer_metadataReceived(evt:VideoEvent):void {
- videoPlayer.videoElement.mx_internal::videoPlayer.playheadUpdateInterval = 3000;
- }
- private function videoPlayer_playheadUpdate(evt:VideoEvent):void {
- arrList.addItem({type:evt.type, time:evt.playheadTime.toFixed(2)});
- }
- ]]>
- </fx:Script>
- <fx:Declarations>
- <s:ArrayList id="arrList" />
- </fx:Declarations>
- <s:Panel id="panel"
- horizontalCenter="0"
- verticalCenter="0">
- <s:layout>
- <s:HorizontalLayout />
- </s:layout>
- <s:VideoPlayer id="videoPlayer"
- source="http://helpexamples.com/flash/video/cuepoints.flv"
- muted="true"
- metadataReceived="videoPlayer_metadataReceived(event);"
- playheadUpdate="videoPlayer_playheadUpdate(event);" />
- <mx:DataGrid id="dataGrid"
- dataProvider="{arrList}"
- height="100%"
- verticalScrollPolicy="on">
- <mx:columns>
- <mx:DataGridColumn dataField="type" width="140" />
- <mx:DataGridColumn dataField="time" width="60" />
- </mx:columns>
- </mx:DataGrid>
- </s:Panel>
- </s:Application>
代码:Peter deHaan 翻译/整理/编译:中文Flex例子
Topics:
Gumbo, VideoPlayer |
No Comments » |
Tags: Gumbo, playheadUpdateInterval