⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vcastrvideoplayer.as1

📁 使用as3.0重新写了播放器 播放器大小缩小,在21k左右 新参数和vcastr2.x不同 可以通过xml对播放器设置 界面更新 增加音量控制 留出了插件的接口
💻 AS1
字号:
package com.ruochi.video {
	import fl.video.VideoPlayer;
	import fl.video.VideoState;
	import fl.video.VideoEvent;
	import com.ruochi.video.NCManager;
	//import fl.video.NCManager;
	public class VcastrVideoPlayer extends VideoPlayer {
		private var _isAutoPlay:Boolean = true
		private var _tryTime:int = 0;
		private var _tryMax:int = 1;
		private var _videoTime:Number;
		public function VcastrVideoPlayer(width:int = 320, height:int = 240) {
			super(width, height);
			iNCManagerClass = NCManager;
			smoothing = true;
			addEventListener(VideoEvent.READY, onVideoPlayerReady, false, 0, true);
		}
		private function onVideoPlayerReady(e:VideoEvent):void {
			if (isNaN(totalTime)) {
				_videoTime = Math.round(bytesTotal/videoWidth/videoHeight*1.8)
			}else {
				_videoTime = totalTime;
			}
			if (_isAutoPlay) {
				play(); 
			}else {
				pause();
			}
		}
		public function playPause():void {	
			if (state == VideoState.STOPPED || state == VideoState.PAUSED || state == VideoState.SEEKING) {
				play();trace(state)	
			}else {
				pause();
			}
		}
		public function ff():void {
			seek(playheadTime + totalTime / 10);
		}
		public function rew():void {
			seek(playheadTime - totalTime / 10);
		}
		public function seekPersent(persent:Number):void {
			seek(totalTime * persent);
		}
		public function set isAutoPlay(boo:Boolean):void {
			_isAutoPlay = boo;
		}
		public function gotoBegin():void {
			pause();
			seek(0);
		}
		public function get videoTime():Number {
			return _videoTime
		}
	}	
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -