ITeye博客

flex学习笔记3

fourfire · 2007-07-30 10:44 · flex · Markdown

视频播放器源码,包括音量、全屏模式、网络flv播放、定位播放

mxml 代码

 

  1. xml version="1.0" encoding="utf-8"?>
  2. <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"  width="835" height="782" >
  3. <mx:Script>
  4. mx:Script>
  5. <mx:XML id="xmlData" source="FlvData.xml" format="xml" />
  6. <mx:VideoDisplay id="flvideo" playheadUpdate="playingMove(event)"  x="10" y="10" autoPlay="false" bufferTime="0.5" maintainAspectRatio="false" width="294" height="219"/>
  7. <mx:ControlBar id="ctrlBar" x="10" y="237" width="545" height="52">
  8. <mx:TextInput id="urlText" width="150" keyUp="onChangeUrl(event)" fontFamily="Arial" fontSize="12" color="#2C2B3A" enabled="true" height="26" toolTip="请输入flv文件的网络地址"/>
  9. <mx:Button  label="Play" click="playMovie(event)"/>
  10. <mx:Button  label="Stop" click="stopMovie(event)"/>
  11. <mx:Button  label="pause" click="pauseMovie(event)"/>
  12. mx:ControlBar>
  13. <mx:ControlBar id="ctrlBar0" x="10" y="297" width="545" height="52">
  14. <mx:Label
  15. text="音量"
  16. color="#ffffff"/>
  17. <mx:HSlider id="hs_sound" width="80"
  18. minimum="0" maximum="1"
  19. thumbRelease="sound_thumbRelease(event)"
  20. change="sound_thumbChanges(event)"
  21. value="{flvideo.volume}" />
  22. <mx:CheckBox id="displayChk" label="全屏模式" change="displayStateChange()"/>
  23. mx:ControlBar>
  24. <mx:ControlBar id="ctrlBar1" x="10" y="357" width="545" height="52">
  25. <mx:Label x="480" y="341" id="playtime"
  26. text="{formatTimes(flvideo.playheadTime)} : {formatTimes(flvideo.totalTime)}"
  27. color="#ffffff"/>
  28. <mx:HSlider  minimum="0"  id="my_hs"  change="hs_onchange(event)" width="179"/>
  29. mx:ControlBar>
  30. mx:Application>

<mx:application height="782" width="835" layout="absolute" xmlns:mx="http://www.adobe.com/2006/mxml"><mx:xml format="xml" source="FlvData.xml" id="xmlData"><mx:videodisplay height="219" width="294" maintainaspectratio="false" buffertime="0.5" autoplay="false" y="10" x="10" playheadupdate="playingMove(event)" id="flvideo"><mx:controlbar height="52" width="545" y="237" x="10" id="ctrlBar"><mx:textinput tooltip="请输入flv文件的网络地址" height="26" enabled="true" color="#2C2B3A" fontsize="12" fontfamily="Arial" keyup="onChangeUrl(event)" width="150" id="urlText"><mx:button click="playMovie(event)" label="Play"><mx:button click="stopMovie(event)" label="Stop"><mx:controlbar height="52" width="545" y="297" x="10" id="ctrlBar0"><mx:label color="#ffffff" text="音量"><mx:hslider value="{flvideo.volume}" change="sound_thumbChanges(event)" thumbrelease="sound_thumbRelease(event)" maximum="1" minimum="0" width="80" id="hs_sound"><mx:controlbar height="52" width="545" y="357" x="10" id="ctrlBar1"></mx:controlbar></mx:hslider></mx:label></mx:controlbar></mx:button></mx:button></mx:textinput></mx:controlbar></mx:videodisplay></mx:xml></mx:application>

评论(1)

  1. #1 楼 · ssuhvs · 2008-01-27 02:44

    :?:

评论功能维护中,当前仅展示历史评论。