Flex播放器代码实例及在线运行效果

 

    在线运行效果请访问:http://tongqiuyan.blog.163.com/blog/static/19554530220119164211339/

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" horizontalAlign="center" verticalAlign="top" fontSize="12">
	<mx:Script>
		<![CDATA[
			import mx.messaging.MultiTopicConsumer;
			private function getTime():void
			{
				var pDate:Date = new Date(myPlayer.playheadTime * 1000 || 10);
				var tDate:Date = new Date(myPlayer.totalTime*1000);
				progressBar.label = dateFormater.format(pDate) + " / " + dateFormater.format(tDate);
			}


		]]>
	</mx:Script>
	<mx:DateFormatter id="dateFormater" formatString="NN:SS" />
	<mx:Panel width="520" height="400" title="Flex播放器">
		<mx:VideoDisplay id="myPlayer" autoPlay="false" width="100%" height="100%" playheadUpdate="getTime();"
						 source="http://d298.v.iask.com/f/1/d75c35113920fe8d63d32ead7bc2f18a62729452.hlv" />
		<mx:HBox paddingBottom="5" paddingLeft="5" width="100%" verticalAlign="middle">
			<mx:Image source="http://dl.iteye.com/upload/picture/pic/100759/e0234a4c-a7c1-3b6b-aa96-763f55c89b4e.png" click="myPlayer.play();" width="25" height="25"  />
			<mx:Image source="http://dl.iteye.com/upload/picture/pic/100757/53003055-7e70-35b8-b91b-28b06b8ae9d0.png" click="myPlayer.pause();"  width="25" height="25" />
			<mx:Image source="http://dl.iteye.com/upload/picture/pic/100761/e0278852-830d-36ee-9260-a91906cd3902.png" click="myPlayer.stop();" width="25" height="25" />
			<mx:ProgressBar id="progressBar" source="myPlayer" labelPlacement="center" width="300" />
			<mx:Label text="Vol" />
			<mx:HSlider id="volSlider" width="50" minimum="0" value="0.8" maximum="1" snapInterval="0.1" />
		</mx:HBox>
	</mx:Panel>
</mx:Application>

 

 

    涉及到控件主要是VideoDisplay、Image、ProgressBar、HSlider等。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值