ActionScript 3 AS3视频播放器,放置在时间轴上,带有旋转预加载器

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ActionScript 3 AS3视频播放器,放置在时间轴上,带有旋转预加载器相关的知识,希望对你有一定的参考价值。

// send this file the flashvars: "videofile" + optional "barcolor" + optional "autoplay=false" + optional "mute=true"

import fl.video.* // to be able to refer to the properties of the FLVPlayback component


var objFlashVars:Object = getFlashVars();

myVideo.autoPlay = true; // the FLVPlayback component instance on the stage is named myVideo
myVideo.source = "http://www.mediacollege.com/video-gallery/testclips/20051210-w50s_56K.flv"; // a default video. This will be over-ridden by your value from the FlashVars
myVideo.skin = getContextPath() + "SkinOverAllNoFullNoCaption.swf"; // feel free to change the skin. This will need to be placed in the same directory as the genplayer.swf

// Change settings based on FlashVars:
if (objFlashVars.videofile != undefined) { myVideo.source = objFlashVars.videofile; }
if (objFlashVars.barcolor != undefined)  { myVideo.skinBackgroundColor = objFlashVars.barcolor; }
if (objFlashVars.autoplay != undefined)  { if (objFlashVars.autoplay == "false")  { myVideo.autoPlay = false; } }
if (objFlashVars.mute != undefined)  { if (objFlashVars.mute == "true")  { myVideo.volume = 0; } }

// Get rid of the loader:
myVideo.addEventListener(VideoEvent.READY, myFun);
function myFun(e:VideoEvent):void {
	spinner_mc.stop();
	spinner_mc.visible = false;
	spinner_mc.enabled = false;
}

// That's it. The video should autoPlay unless you've told it not to with FlashVars.


////////////////////////////////////////////////////////////////////////////////////////////////
// Related Functions Below, from http://snipplr.com/view/10204/as3-my-favorite-helper-functions/
////////////////////////////////////////////////////////////////////////////////////////////////

function getFlashVars():Object
{
     return Object( LoaderInfo( this.loaderInfo ).parameters );
}

function getContextPath():String
{
	var uri:String = getLoaderURL();
	return uri.substring(0, uri.lastIndexOf("/")) + "/";
}

function getLoaderURL():String
{
	return this.loaderInfo.loaderURL;
}

以上是关于ActionScript 3 AS3视频播放器,放置在时间轴上,带有旋转预加载器的主要内容,如果未能解决你的问题,请参考以下文章

ActionScript 3 AS3加载和播放外部FLV文件

ActionScript 3 AS3检测flash播放器类型 - broswer插件,独立,IDE等

ActionScript 3 AS3视频骨架

ActionScript 3 AS3加载和播放外部MP3文件

ActionScript 3 AS3 FLVPlayback组件视频元数据

ActionScript 3:使影片剪辑播放到最后