任意拖动的视频播放器

时间:2018-07-28 08:55:23
【文件属性】:

文件名称:任意拖动的视频播放器

文件大小:1.16MB

文件格式:RAR

更新时间:2018-07-28 08:55:23

视频播放器

任意拖动的视频播放器 //====================================================== //===============VIDEO SETUP=====视频设置============ //====================================================== //the playlist address _root.playlist == undefined ? playlist="http://yun.365.sh/s/TY2gc2.swf" : playlist=_root.playlist; // stage variables Stage.showMenu = false; Stage.scaleMode = "noScale"; stop(); // video Stream variables var nc:NetConnection = new NetConnection(); nc.connect(null); var ns:NetStream = new NetStream(nc); // buffer video ns.setBufferTime(5); ns.onStatus = function(obj) { if (obj.code == "NetStream.Buffer.Full") { bufferClip._visible = false; } if(obj.code == "NetStream.Buffer.Empty") { bufferClip._visible = true; } }; var myVolume:Number = 0; var current_song:Number = 1; // control variables var scr = _root.main.controlBar.scrubber; var pr = scr.progres; var ld = scr.loader; var cb = _root.main.controlBar; var swidth = scr.back._width-37; //297-37 var pstart = -285; //-261 var dur:Number; // the percentage of the video loaded var lprog:Number = 0; var sign:String = "first"; main.theVideo.attachVideo(ns); // parsing the playlist xml files data_xml = new XML(); data_xml.ignoreWhite = true; data_xml.onLoad = loadData; data_xml.load(playlist); var aPath = new Array(); function loadData(success) { if (success) { // getting all titles and filenames songTitel = new Array(); audioTracks = new Array(); audioTracks.shuffle(); audioTracks = this.firstChild.childNodes; song_total = audioTracks.length; for (var i = 0; i> is preparing . "; lprog = ns.bytesLoaded/ns.bytesTotal; main.controlBar.scrubber.loaded._width = lprog*290; pr._x = -285+(swidth*prog); ns.onStatus = function(infoObject:Object) { if(infoObject.code == "NetStream.Play.Start") { sign = "started"; } else if(infoObject.code == "NetStream.Play.Stop") { sign = "closed"; if (autoStart == "random") { current_song = random(song_total)+1; } else { current_song == song_total ? current_song=1 : current_song++; } cb.plabel.play(); } }; if(sign == "started") { main.welcome._visible = false; bot.currentPlay.text = checkDigits(current_song)+". "+songTitel[current_song-1]; main.controlBar.scrubber.perload.text = Math.round(lprog*100)+"%"; hadPlayed.text = Math.floor(ns.time/60)+" m "+Math.round(ns.time%60)+" s "+Math.floor(prog*100)+" %"; timetext.text = Math.floor(dur/60)+" m "+Math.round(dur%60)+" s"; } else if(sign == "closed") { main.controlBar.scrubber.perload.text = "Closed"; hadPlayed.text = "Previous one closed"; main.welcome._visible = true; timetext.text = "none loaded"; } else if(sign == "first") { main.controlBar.scrubber.perload.text = "OK"; timetext.text = "默认的视频";//default Vedio OK hadPlayed.text = "玩家可以"; //Player OK } } function listClick(prm) { delete pausepos; current_song = prm; ns.stop(); playtime(); sign = "select"; } // list scroller bot.listContentMc.list_bg.onEnterFrame = function() { if (this.hitTest(_root._xmouse, _root._ymouse) == true && this._parent.playlist._height>this._height) { ymin = this._y+this._height-this._parent.playlist._height; ymax = this._y+3; conv = (this._ymouse-15)*1.3/this._height; conv>1 ? conv=1 : null; conv<0 ? conv=0 : null; this._parent.playlist.easeY(ymax-conv*(ymax-ymin)); } }; bot.listContentMc.playlist.setMask(bot.listContentMc.list_bg); MovieClip.prototype.easeY = function(t) { this.onEnterFrame = function() { this._y = int(t-(t-this._y)/1.5); if (this._y>t-1 && this._y .95) { ns.seek(0); ns.pause(false); }*/ }; function ff() { if (ns.time/dur<.95) { ns.seek(ns.time+1); } else { clearInterval(ffInt); } } pr.scrubba.onPress = function() { //ns.pause(true); _root.onEnterFrame = scrubba; pr.startDrag(false, -285, pr._y, -25, pr._y); }; pr.scrubba.onRelease = pr.scrubba.onReleaseOutside=function () { _root.onEnterFrame = videoUpdate; //ns.pause(false); pr.stopDrag(); removeTip(); }; function scrubba() { var p = (pr._x-pstart)/swidth; if (p<=lprog) { ns.seek(p*dur); } else { ns.seek(lprog); } main.tooltip.datext.text = Math.floor(p*100)+" % 处理";//processing main.tooltip._x = Math.round(main._xmouse); main.tooltip._y = Math.round(main._ymouse); main.tooltip._visible = true; } main.controlBar.scrubber.back.onRelease = controlBar.scrubber.back.onReleaseOutside=function () { var p = (this._xmouse-37)/swidth; if (p<=lprog) { ns.seek(p*dur); } else { ns.seek(lprog); } }; //====================================================== //==============SOUND CONTROL=======声音控制============= //====================================================== _root.createEmptyMovieClip("vidsound", _root.getNextHighestDepth()); vidsound.attachAudio(ns); var sou:Sound = new Sound(vidsound); sou.setVolume(75); var startxs = main.controlBar.vol._x; main.controlBar.vol._x = startxs+(70*.75); main.controlBar.vol.onPress = function() { this.startDrag(false, startxs+3, this._y, startxs+58, this._y); main.tooltip._x = Math.round(main._xmouse); main.tooltip._y = 554; this.onEnterFrame = voller; }; main.controlBar.vol.onRollOver = function() { showTip("Volume"); }; main.controlBar.vol.onRollOut = function() { removeTip(); }; main.controlBar.vol.onRelease = main.controlBar.vol.onReleaseOutside = function () { this.stopDrag(); removeTip(); delete this.onEnterFrame; }; function voller() { var perc = ((main.controlBar.vol._x-544)/(55)); sou.setVolume(Math.ceil(perc*100)); myVolume = sou.getVolume(); main.tooltip.datext.text = sou.getVolume()+"% Volume"; main.tooltip._x = Math.round(main._xmouse); main.tooltip._y = Math.round(main._ymouse); main.tooltip._visible = true; } //====================================================== //==============TOOL TIPS=======工具提示================== //====================================================== var ti:Number; function showTip(datext) { ti = getTimer(); main.tooltip.datext.text = datext; main.tooltip.onEnterFrame = function() { var tempti = getTimer(); if (tempti-ti>500) { this._x = Math.round(main._xmouse); this._y = Math.round(main._ymouse); main.tooltip._visible = true; } }; } function removeTip() { main.tooltip._visible = false; delete main.tooltip.onEnterFrame; } main.tooltip._visible = false; main.mute.onRelease = function() { if (sou.getVolume() == 0) { sou.setVolume(myVolume); cb.vol._x = 544+63*myVolume/100; } else { myVolume = sou.getVolume(); sou.setVolume(0); cb.vol._x = 544; } main.bugle.play(); }; main.mute.onRollOver = function() { showTip("切换静音");//Toggle Mute }; main.mute.onRollOut = function() { removeTip(); }; //dragging main.window.onPress = function() { this._parent.startDrag(); this._parent.swapDepths(5); bot.swapDepths(4); }; bot.listTitleBar.onPress = bot.listContentMc.listContent.onPress =function() { bot.startDrag(); bot.swapDepths(5); main.swapDepths(4); }; main.window.onRelease = main.playerTitleBar.onReleaseOutside = function() { this._parent.stopDrag(); }; bot.listTitleBar.onRelease = bot.listTitleBar.onReleaseOutside = bot.listContentMc.listContent.onRelease = bot.listContentMc.listContent.onReleaseOutside = function() { bot.stopDrag(); }; // hide or show the playList main.plBut.onRelease = function() { (bot._visible == true)?bot._visible = false:bot._visible = true; }; main.plBut.onRollOver = function() { showTip("播放列表");//PlayList }; main.plBut.onRollOut = function() { removeTip(); }; bot.close.onRelease = function() { bot._visible = false; } bot.small.onRelease = function() { bot.smallContent.play(); (bot.listContentMc._visible == true)?bot.listContentMc._visible = false:bot.listContentMc._visible = true; }


【文件预览】:
任意拖动的视频播放器
----player.fla(933KB)
----请看说明.txt(2KB)
----list.png(8KB)
----flv()
--------instruction.txt(36B)
--------1.flv(829KB)
----playList.xml(82KB)
----list_grad.psd(100KB)
----winamp.psd(339KB)
----player.swf(41KB)
----videoPlayer.as(11KB)

网友评论

  • 样式不好看