视频播放器源码,包括音量、全屏模式、网络flv播放、定位播放
<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>
mxml 代码
- xml version="1.0" encoding="utf-8"?>
- <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="835" height="782" >
- <mx:Script>
- mx:Script>
- <mx:XML id="xmlData" source="FlvData.xml" format="xml" />
- <mx:VideoDisplay id="flvideo" playheadUpdate="playingMove(event)" x="10" y="10" autoPlay="false" bufferTime="0.5" maintainAspectRatio="false" width="294" height="219"/>
- <mx:ControlBar id="ctrlBar" x="10" y="237" width="545" height="52">
- <mx:TextInput id="urlText" width="150" keyUp="onChangeUrl(event)" fontFamily="Arial" fontSize="12" color="#2C2B3A" enabled="true" height="26" toolTip="请输入flv文件的网络地址"/>
- <mx:Button label="Play" click="playMovie(event)"/>
- <mx:Button label="Stop" click="stopMovie(event)"/>
- <mx:Button label="pause" click="pauseMovie(event)"/>
- mx:ControlBar>
- <mx:ControlBar id="ctrlBar0" x="10" y="297" width="545" height="52">
- <mx:Label
- text="音量"
- color="#ffffff"/>
- <mx:HSlider id="hs_sound" width="80"
- minimum="0" maximum="1"
- thumbRelease="sound_thumbRelease(event)"
- change="sound_thumbChanges(event)"
- value="{flvideo.volume}" />
- <mx:CheckBox id="displayChk" label="全屏模式" change="displayStateChange()"/>
- mx:ControlBar>
- <mx:ControlBar id="ctrlBar1" x="10" y="357" width="545" height="52">
- <mx:Label x="480" y="341" id="playtime"
- text="{formatTimes(flvideo.playheadTime)} : {formatTimes(flvideo.totalTime)}"
- color="#ffffff"/>
- <mx:HSlider minimum="0" id="my_hs" change="hs_onchange(event)" width="179"/>
- mx:ControlBar>
- mx:Application>