Flex Gumbo中如何创建无边框播放器的例子

By Minidxer | September 5, 2009

接下来的例子演示了Flex Gumbo中如何利用VideoElement控件,创建无边框播放器。

让我们先来看一下Demo可以点击这里察看源代码):


下面是完整代码(或点击这里察看):
下面是main.mxml:

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <s:Application name="Spark_VideoElement_test"
  3.         xmlns:fx="http://ns.adobe.com/mxml/2009"
  4.         xmlns:s="library://ns.adobe.com/flex/spark"
  5.         xmlns:mx="library://ns.adobe.com/flex/halo">
  6.  
  7.     <mx:ApplicationControlBar width="100%" cornerRadius="0">
  8.         <s:Button id="playBtn"
  9.                 label="play"
  10.                 click="videoElement.play();" />
  11.         <s:Button id="pauseBtn"
  12.                 label="pause"
  13.                 click="videoElement.pause();" />
  14.         <s:Button id="stopBtn"
  15.                 label="stop"
  16.                 click="videoElement.stop();" />
  17.         <s:CheckBox id="mutedCheckBox"
  18.                 label="muted"
  19.                 selected="true"
  20.                 click="videoElement.muted = mutedCheckBox.selected;" />
  21.         <s:Graphic>
  22.             <s:SimpleText id="playheadTimeLabel"
  23.                     text="{videoElement.playheadTime.toFixed(3)}" />
  24.         </s:Graphic>
  25.     </mx:ApplicationControlBar>
  26.  
  27.     <s:Group horizontalCenter="0" verticalCenter="0">
  28.         <s:VideoElement id="videoElement"
  29.                 autoRewind="true"
  30.                 source="http://helpexamples.com/flash/video/cuepoints.flv"
  31.                 muted="true"/>
  32.     </s:Group>
  33.  
  34. </s:Application>
代码:Peter deHaan 翻译/整理/编译:中文Flex例子

Topics: Gumbo, Other | No Comments » | Tags: ,

Search Posts