📄 vcastrvideoplayer.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 + -