Created
November 19, 2013 03:52
-
-
Save chfoo/7540049 to your computer and use it in GitHub Desktop.
hyves aplayer.swf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| |
//---------------------------------------------------------------------- | |
//Symbol 20486 MovieClip [__Packages.com.meychi.ascrypt.Base64] Frame 0 | |
//---------------------------------------------------------------------- | |
class com.meychi.ascrypt.Base64 | |
{ | |
function Base64 () { | |
} | |
static function encode(src) { | |
var _local3 = 0; | |
var _local4 = new String(""); | |
while (_local3 < src.length) { | |
var _local5 = src.charCodeAt(_local3++); | |
var _local6 = src.charCodeAt(_local3++); | |
var _local7 = src.charCodeAt(_local3++); | |
var _local8 = _local5 >> 2; | |
var _local9 = ((_local5 & 3) << 4) | (_local6 >> 4); | |
var _local10 = ((_local6 & 15) << 2) | (_local7 >> 6); | |
var _local11 = _local7 & 63; | |
if (_global.isNaN(_local6)) { | |
_local11 = 64; | |
_local10 = _local11; | |
} else if (_global.isNaN(_local7)) { | |
_local11 = 64; | |
} | |
_local4 = _local4 + (base64chars.charAt(_local8) + base64chars.charAt(_local9)); | |
_local4 = _local4 + (base64chars.charAt(_local10) + base64chars.charAt(_local11)); | |
} | |
return(_local4); | |
} | |
static function decodeToCharArray(src) { | |
var _local3 = 0; | |
var _local4 = new Array(); | |
while (_local3 < src.length) { | |
var _local8 = base64chars.indexOf(src.charAt(_local3++)); | |
var _local9 = base64chars.indexOf(src.charAt(_local3++)); | |
var _local10 = base64chars.indexOf(src.charAt(_local3++)); | |
var _local11 = base64chars.indexOf(src.charAt(_local3++)); | |
var _local5 = (_local8 << 2) | (_local9 >> 4); | |
var _local6 = ((_local9 & 15) << 4) | (_local10 >> 2); | |
var _local7 = ((_local10 & 3) << 6) | _local11; | |
_local4.push(_local5); | |
if (_local10 != 64) { | |
_local4.push(_local6); | |
} | |
if (_local11 != 64) { | |
_local4.push(_local7); | |
} | |
} | |
return(_local4); | |
} | |
static var base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; | |
} | |
| |
//---------------------------------------------------------------------- | |
//Symbol 20487 MovieClip [__Packages.Playlist] Frame 0 | |
//---------------------------------------------------------------------- | |
class Playlist | |
{ | |
var aSong, currentSongPointer, position; | |
function Playlist () { | |
aSong = []; | |
currentSongPointer = null; | |
position = 0; | |
} | |
function addSong(song) { | |
aSong.push(song); | |
if (currentSongPointer === null) { | |
currentSongPointer = 0; | |
} | |
return(aSong.length - 1); | |
} | |
function getCurrentSong() { | |
return(aSong[currentSongPointer]); | |
} | |
function getCurrentSongPosition() { | |
return(currentSongPointer); | |
} | |
function gotoNextSong() { | |
currentSongPointer++; | |
normalizeCurrentSongPointer(); | |
} | |
function gotoPreviousSong() { | |
currentSongPointer--; | |
normalizeCurrentSongPointer(); | |
} | |
function normalizeCurrentSongPointer() { | |
currentSongPointer = currentSongPointer % aSong.length; | |
if (currentSongPointer < 0) { | |
currentSongPointer = currentSongPointer + aSong.length; | |
} | |
} | |
function gotoSong(pointer) { | |
currentSongPointer = pointer; | |
normalizeCurrentSongPointer(); | |
} | |
function gotoSongById(id) { | |
var _local3 = 0; | |
xxxfor ( ; _local3 < aSong.length ; _local3++) { | |
if (aSong[_local3].getId() == id) { | |
gotoSong(_local3); | |
return(undefined); | |
} | |
} | |
} | |
function length() { | |
return(aSong.length); | |
} | |
function setPlayingPosition(position) { | |
this.position = position; | |
} | |
function getPlayingPosition() { | |
return(position); | |
} | |
//ASSetPropFlags(_local1, null, 1); | |
} | |
| |
//---------------------------------------------------------------------- | |
//Symbol 24 MovieClip Frame 1 | |
//---------------------------------------------------------------------- | |
stop(); | |
| |
//---------------------------------------------------------------------- | |
//Symbol 45 MovieClip Frame 10 | |
//---------------------------------------------------------------------- | |
stop(); | |
| |
//---------------------------------------------------------------------- | |
//Symbol 20482 MovieClip [__Packages.Util] Frame 0 | |
//---------------------------------------------------------------------- | |
class Util | |
{ | |
function Util () { | |
} | |
static function formatAsTime(seconds) { | |
var _local3 = Math.floor(Math.round(seconds) / 60); | |
var _local4 = Math.round(seconds) % 60; | |
return(((("" + _local3) + ":") + ((_local4 < 10) ? "0" : "")) + _local4); | |
} | |
static function StringToCharCodeArray(s) { | |
var _local3 = new Array(); | |
var _local4 = 0; | |
xxxfor ( ; _local4 < s.length ; _local4++) { | |
_local3.push(s.charCodeAt(_local4)); | |
} | |
return(_local3); | |
} | |
static function charCodeArrayToString(a) { | |
var _local3 = new String(); | |
var _local4 = 0; | |
xxxfor ( ; _local4 < a.length ; _local4++) { | |
_local3 = _local3 + String.fromCharCode(a[_local4]); | |
} | |
return(_local3); | |
} | |
static function decrypt(text, password) { | |
var _local4 = text.slice(0, 9); | |
var _local5 = text.slice(9); | |
var _local6 = decrypthelper(_local4, password); | |
return(decrypthelper(_local5, _local6)); | |
} | |
static function decrypthelper(text, password) { | |
var _local4 = new Array(); | |
var _local5 = 0; | |
xxxfor ( ; _local5 < text.length ; _local5++) { | |
_local4.push(((text[_local5] - password[_local5 % password.length]) + 256) % 256); | |
} | |
return(_local4); | |
} | |
static function decryptUE(ue) { | |
return(charCodeArrayToString(decrypt(com.meychi.ascrypt.Base64.decodeToCharArray(ue), StringToCharCodeArray("aulos")))); | |
} | |
static function setTimeout(f, timeout) { | |
var o = new Object(); | |
o.intervalId = _global.setInterval(function () { | |
_global.clearInterval(o.intervalId); | |
f(); | |
}, timeout); | |
return(o.intervalId); | |
} | |
static function clearTimeout(timeoutId) { | |
_global.clearInterval(timeoutId); | |
} | |
//ASSetPropFlags(_local1, null, 1); | |
} | |
| |
//---------------------------------------------------------------------- | |
//Symbol 20483 MovieClip [__Packages.com.gskinner.events.GDispatcher] Frame 0 | |
//---------------------------------------------------------------------- | |
class com.gskinner.events.GDispatcher | |
{ | |
var gDispatcher_listeners; | |
function GDispatcher () { | |
} | |
static function initialize(p_obj) { | |
if ($instance == undefined) { | |
$instance = new com.gskinner.events.GDispatcher(); | |
} | |
p_obj.dispatchEvent = $instance.dispatchEvent; | |
p_obj.dispatchQueue = $instance.dispatchQueue; | |
p_obj.eventListenerExists = $instance.eventListenerExists; | |
p_obj.addEventListener = $instance.addEventListener; | |
p_obj.removeEventListener = $instance.removeEventListener; | |
p_obj.removeAllEventListeners = $instance.removeAllEventListeners; | |
} | |
static function $indexOfListener(p_listeners, p_obj, p_function) { | |
var _local5 = p_listeners.length; | |
var _local6 = -1; | |
while (_local6++ , _local6 < _local5) { | |
var _local7 = p_listeners[_local6]; | |
if ((_local7.o == p_obj) && (_local7.f == p_function)) { | |
return(_local6); | |
} | |
} | |
return(-1); | |
} | |
static function $dispatchEvent(p_dispatchObj, p_listeners, p_eventObj) { | |
for (var _local5 in p_listeners) { | |
var _local6 = p_listeners[_local5].o; | |
var _local7 = typeof(_local6); | |
var _local8 = p_listeners[_local5].f; | |
if ((_local7 == "object") || (_local7 == "movieclip")) { | |
if ((_local6.handleEvent != undefined) && (_local8 == undefined)) { | |
_local6.handleEvent(p_eventObj); | |
} else { | |
if (_local8 == undefined) { | |
_local8 = p_eventObj.type; | |
} | |
_local6[_local8](p_eventObj); | |
} | |
} else { | |
_local6.apply(p_dispatchObj, [p_eventObj]); | |
} | |
} | |
} | |
function dispatchQueue(p_dispatchObj, p_eventObj) { | |
var _local4 = p_dispatchObj.gDispatcher_listeners[p_eventObj.type]; | |
if (_local4 != undefined) { | |
$dispatchEvent(p_dispatchObj, _local4, p_eventObj); | |
} | |
_local4 = p_dispatchObj.gDispatcher_listeners.ALL; | |
if (_local4 != undefined) { | |
$dispatchEvent(p_dispatchObj, _local4, p_eventObj); | |
} | |
} | |
function dispatchEvent(p_eventObj) { | |
if (p_eventObj.type == "ALL") { | |
return(undefined); | |
} | |
if (p_eventObj.target == undefined) { | |
p_eventObj.target = this; | |
} | |
this[p_eventObj.type + "Handler"](p_eventObj); | |
dispatchQueue(this, p_eventObj); | |
} | |
function eventListenerExists(p_event, p_obj, p_function) { | |
return($indexOfListener(gDispatcher_listeners[p_event], p_obj, p_function) != -1); | |
} | |
function addEventListener(p_event, p_obj, p_function) { | |
if (gDispatcher_listeners == undefined) { | |
gDispatcher_listeners = {}; | |
_global.ASSetPropFlags(this, gDispatcher_listeners, 1); | |
} | |
var _local5 = gDispatcher_listeners[p_event]; | |
if (_local5 == undefined) { | |
_local5 = []; | |
gDispatcher_listeners[p_event] = _local5; | |
} | |
if ($indexOfListener(_local5, p_obj, p_function) == -1) { | |
_local5.push({o:p_obj, f:p_function}); | |
} | |
} | |
function removeEventListener(p_event, p_obj, p_function) { | |
var _local5 = gDispatcher_listeners[p_event]; | |
if (_local5 == undefined) { | |
return(undefined); | |
} | |
var _local6 = $indexOfListener(_local5, p_obj, p_function); | |
if (_local6 != -1) { | |
_local5.splice(_local6, 1); | |
} | |
} | |
function removeAllEventListeners(p_event) { | |
if (p_event == undefined) { | |
delete gDispatcher_listeners; | |
} else { | |
delete gDispatcher_listeners[p_event]; | |
} | |
} | |
static var $instance = undefined; | |
} | |
| |
//---------------------------------------------------------------------- | |
//Symbol 20485 MovieClip [__Packages.Player] Frame 0 | |
//---------------------------------------------------------------------- | |
class Player | |
{ | |
var player_mc, myUid, type, size, myStream, amCountingCurrentSong, myPlaylist, playCountTimeout, myProgressbar; | |
function Player (player_mc, sText, myUid, type, size) { | |
flash.external.ExternalInterface.addCallback("addSongs", this, addSongs); | |
flash.external.ExternalInterface.addCallback("playSong", this, playSong); | |
flash.external.ExternalInterface.addCallback("doStopPlay", this, stopPlay); | |
this.player_mc = player_mc; | |
this.myUid = myUid; | |
this.type = type; | |
this.size = size; | |
if (DEVELOPMENT) { | |
initTestPlaylist(); | |
} else { | |
initPlaylist(); | |
} | |
initButtons(sText); | |
var _local7 = new NetConnection(); | |
_local7.connect(null); | |
myStream = new NetStream(_local7); | |
myStream.setBufferTime(5); | |
player_mc.myVideo.attachVideo(myStream); | |
var that = this; | |
myStream.onStatus = function (event) { | |
that.streamStatusChanged(event); | |
}; | |
amCountingCurrentSong = false; | |
_global.setInterval(function () { | |
that.periodicalUpdater(); | |
}, 500); | |
if (this.size == SIZE_SMALL) { | |
this.player_mc.background_large_mc._visible = false; | |
} | |
initVolumeButton(); | |
initProgressbar(); | |
fireInitReadyEvent(); | |
} | |
function initTestPlaylist() { | |
myPlaylist = new Playlist(); | |
var _local2 = [{id:11, artist:"TestArtist", name:"Testname", url:"http://brick3-trunk.dev/312400001-312450000/312410201-312410300/312410261_9_SDOZ.3B8c1937.flv", length:190, mayBeCopied:false}, {id:12, artist:"TestArtist2", name:"Testname2", url:"http://intrepid.startpda.net:89/music.php?songId=48&songSecret=ab77&s=01b33e0cc899e05a7ecd88263c5df069", length:(4 * 60) + 27, mayBeCopied:true}, {id:32, artist:"TestArtist3", name:"Testname3", url:"http://intrepid.startpda.net:89/music.php?songId=62&songSecret=9a0a&s=86ad00e4360bd016f71b2eb46e26a75e", length:(3 * 60) + 49, mayBeCopied:true}]; | |
addSongs(_local2); | |
} | |
function initPlaylist() { | |
myPlaylist = new Playlist(); | |
} | |
function addSongs(asSong) { | |
log("songs added"); | |
var _local3; | |
var _local4 = 0; | |
xxxfor ( ; _local4 < asSong.length ; _local4++) { | |
_local3 = addSong(asSong[_local4]); | |
} | |
return(_local3); | |
} | |
function addSong(sSong) { | |
if (sSong.url) { | |
var _local3 = sSong.url; | |
} else { | |
var _local3 = Util.decryptUE(sSong.ue); | |
} | |
return(myPlaylist.addSong(new Song(sSong.id, sSong.artist, sSong.name, _local3, sSong.length, sSong.mayBeCopied))); | |
} | |
function initButtons(sText) { | |
var _local3 = [1, 2, 3, 4, 5]; | |
var that = this; | |
for (var i in _local3) { | |
player_mc["Btn" + _local3[i]].btnNumber = _local3[i]; | |
player_mc["Btn" + _local3[i]].onRollOver = function () { | |
this.gotoAndPlay(this.btnNumber + "_Over"); | |
}; | |
player_mc["Btn" + _local3[i]].onRollOut = function () { | |
this.gotoAndPlay(this.btnNumber + "_Out"); | |
}; | |
} | |
player_mc.Btn2.onRelease = function () { | |
that.previousSong(); | |
}; | |
player_mc.Btn5.onRelease = function () { | |
that.nextSong(); | |
}; | |
player_mc.Btn4.onRelease = function () { | |
that.startPlay(); | |
}; | |
player_mc.Btn3.onRelease = function () { | |
that.pausePlay(); | |
}; | |
player_mc.Btn1.onRelease = function () { | |
that.stopPlay(); | |
}; | |
player_mc.btnAddText.label.text = sText.addButton; | |
player_mc.attachMovie("blackness", "btnAdd", player_mc.getNextHighestDepth(), {_x:player_mc.btnAddText._x, _y:player_mc.btnAddText._y, _width:player_mc.btnAddText._width, _height:player_mc.btnAddText._height, _alpha:0}); | |
player_mc.btnAdd.onRelease = function () { | |
that.addCurrentsongToProfile(); | |
}; | |
if (type == TYPE_ARTISTPLAYER) { | |
player_mc.btnViewText._visible = false; | |
} else { | |
player_mc.btnViewText.label.text = sText.viewProfileButton; | |
player_mc.attachMovie("blackness", "btnView", player_mc.getNextHighestDepth(), {_x:player_mc.btnViewText._x, _y:player_mc.btnViewText._y, _width:player_mc.btnViewText._width, _height:player_mc.btnViewText._height, _alpha:0}); | |
player_mc.btnView.onRelease = function () { | |
that.gotoArtistProfile(); | |
}; | |
} | |
} | |
function fireEventToJavascript(event) { | |
if (!DEVELOPMENT) { | |
flash.external.ExternalInterface.call(myUid + "_fireevent", event); | |
} else { | |
log("Fireevent on live: " + event.code); | |
} | |
} | |
function addCurrentsongToProfile() { | |
fireEventToJavascript({code:"onCopyToProfileClicked", songId:myPlaylist.getCurrentSong().getId()}); | |
} | |
function gotoArtistProfile() { | |
fireEventToJavascript({code:"onViewArtistClicked", songId:myPlaylist.getCurrentSong().getId()}); | |
} | |
function countCurrentSong() { | |
var _local2 = SharedObject.getLocal("player"); | |
var _local3 = new Date(); | |
var _local4 = (_local3.getFullYear() + (_local3.getMonth() + 1)) + _local3.getDate(); | |
if (_local2.data.sCounter.date != _local4) { | |
_local2.data.sCounter = {date:_local4}; | |
_local2.flush(); | |
} | |
var _local5 = myPlaylist.getCurrentSong().getId(); | |
if (!_local2.data.sCounter[_local5]) { | |
_local2.data.sCounter[_local5] = 1; | |
_local2.flush(); | |
} else if (_local2.data.sCounter[_local5] < MAX_COUNTS_PER_SONG_PER_DAY) { | |
_local2.data.sCounter[_local5]++; | |
_local2.flush(); | |
} else { | |
log(("Not counting song: " + _local5) + ", reached maximum count for today"); | |
return(undefined); | |
} | |
log("Now counting song: " + _local5); | |
fireEventToJavascript({code:"onSongMayBeCounted", songId:_local5}); | |
} | |
function fireInitReadyEvent() { | |
if (myPlaylist.length() == 0) { | |
log("onAfterPlayerInit"); | |
fireEventToJavascript({code:"onAfterPlayerInit"}); | |
var that = this; | |
Util.setTimeout(function () { | |
that.fireInitReadyEvent(); | |
}, 2000); | |
} | |
} | |
function fireStatusChangeEvent(status, oldstatus) { | |
fireEventToJavascript({code:"onPlayerStatusChange", songId:myPlaylist.getCurrentSong().getId(), status:status, oldstatus:oldstatus}); | |
} | |
function streamStatusChanged(event) { | |
log(event.code); | |
switch (event.code) { | |
case "NetStream.Buffer.Full" : | |
setStatus(PLAY); | |
startCurrentSongCountTimer(); | |
break; | |
case "NetStream.Buffer.Empty" : | |
setStatus(BUFFERING); | |
break; | |
case "NetStream.Buffer.Flush" : | |
break; | |
case "NetStream.Play.Start" : | |
currentStatus = BUFFERING; | |
break; | |
case "NetStream.Play.Stop" : | |
stopCurrentSongCountTimer(); | |
var that = this; | |
Util.setTimeout(function () { | |
that.continueToNextSong(); | |
}, 100); | |
break; | |
case "NetStream.Play.StreamNotFound" : | |
setStatus(ERROR); | |
break; | |
case "NetStream.Seek.InvalidTime" : | |
break; | |
case "NetStream.Seek.Notify" : | |
setStatus(PLAY); | |
} | |
} | |
function startCurrentSongCountTimer() { | |
if (amCountingCurrentSong) { | |
log("Am already counting this file"); | |
return(undefined); | |
} | |
amCountingCurrentSong = true; | |
stopCurrentSongCountTimer(); | |
var that = this; | |
var _local2 = Math.min(myPlaylist.getCurrentSong().getLength() * 0.5, SECONDS_BEFORE_SONGCOUNT); | |
playCountTimeout = Util.setTimeout(function () { | |
that.countCurrentSong(); | |
}, _local2 * 1000); | |
} | |
function stopCurrentSongCountTimer() { | |
Util.clearTimeout(playCountTimeout); | |
} | |
function startPlay() { | |
if (currentStatus == PAUSE) { | |
setStatus(PLAY); | |
myStream.pause(); | |
} else { | |
setStatus(BUFFERING); | |
myStream.play(myPlaylist.getCurrentSong().getUrl()); | |
amCountingCurrentSong = false; | |
} | |
} | |
function playSong(id) { | |
log("Asked to play song: " + id); | |
stopPlay(); | |
myPlaylist.gotoSongById(id); | |
startPlay(); | |
} | |
function pausePlay() { | |
myStream.pause(); | |
setStatus(PAUSE); | |
} | |
function stopPlay() { | |
myStream.close(); | |
setStatus(STOP); | |
} | |
function initProgressbar() { | |
myProgressbar = new Progressbar(player_mc, 180, 53, 135, 2); | |
var that = this; | |
myProgressbar.addEventListener("startSeek", {handleEvent:function (event) { | |
if (that.currentStatus == Player.PLAY) { | |
this.pausePlay(); | |
} | |
}}); | |
myProgressbar.addEventListener("stopSeek", {handleEvent:function (event) { | |
that.seek(event.position); | |
}}); | |
myProgressbar.addEventListener("seeking", {handleEvent:function (event) { | |
that.seek(event.position); | |
}}); | |
} | |
function seek(position) { | |
myStream.seek(position); | |
} | |
function periodicalUpdater() { | |
var _local2 = myPlaylist.getCurrentSong(); | |
if (_local2) { | |
var _local3 = _local2.getLength(); | |
var _local4 = myStream.time; | |
if (myStream.bytesTotal > 0) { | |
var _local5 = (myStream.bytesLoaded / myStream.bytesTotal) * _local3; | |
} else { | |
var _local5 = 0; | |
} | |
myProgressbar.update(_local4, _local3, _local5); | |
switch (currentStatus) { | |
case BUFFERING : | |
player_mc.position_txt.htmlText = "Buffering...."; | |
break; | |
case ERROR : | |
player_mc.position_txt.htmlText = "Error!"; | |
break; | |
default : | |
player_mc.position_txt.htmlText = ((Util.formatAsTime(_local4) + " / <b>") + Util.formatAsTime(_local3)) + "</b>"; | |
} | |
player_mc.artist_txt.text = _local2.getArtist(); | |
player_mc.songname_txt.text = _local2.getName(); | |
} | |
player_mc.Btn3._visible = (currentStatus == PLAY) || (currentStatus == BUFFERING); | |
player_mc.Btn4._visible = !((currentStatus == PLAY) || (currentStatus == BUFFERING)); | |
player_mc.btnPauseSmall._visible = currentStatus == PAUSE; | |
player_mc.btnPlaySmall._visible = (currentStatus == PLAY) || (currentStatus == BUFFERING); | |
player_mc.btnStopSmall._visible = currentStatus == STOP; | |
if (myPlaylist.getCurrentSong().mayBeCopied()) { | |
player_mc.btnAdd._alpha = 0; | |
} else { | |
player_mc.btnAdd._alpha = 50; | |
} | |
} | |
function initVolumeButton() { | |
var VOLUMESLIDER_MIN_X = Math.floor(player_mc.volumeSlideBtn._x); | |
var VOLUMESLIDER_WIDTH = 86; | |
var _local2 = 35; | |
var so = SharedObject.getLocal("player"); | |
var _local3 = so.data.volume; | |
var that = this; | |
if (_local3 === undefined) { | |
_local3 = 100; | |
} | |
if (_local3 < _local2) { | |
_local3 = _local2; | |
} | |
player_mc.volumeSlideBtn._x = VOLUMESLIDER_MIN_X + ((VOLUMESLIDER_WIDTH * _local3) / 100); | |
player_mc.volumeSlideBtn._y = Math.floor(player_mc.volumeSlideBtn._y); | |
new Sound().setVolume(_local3); | |
player_mc.volumeSlideBtn.onPress = function () { | |
this.startDrag(true, VOLUMESLIDER_MIN_X, this._y, VOLUMESLIDER_MIN_X + VOLUMESLIDER_WIDTH, this._y); | |
}; | |
player_mc.volumeSlideBtn.onMouseMove = function () { | |
new Sound().setVolume(((that.player_mc.volumeSlideBtn._x - VOLUMESLIDER_MIN_X) / VOLUMESLIDER_WIDTH) * 100); | |
}; | |
player_mc.volumeSlideBtn.onRelease = function () { | |
this.stopDrag(); | |
new Sound().setVolume(((that.player_mc.volumeSlideBtn._x - VOLUMESLIDER_MIN_X) / VOLUMESLIDER_WIDTH) * 100); | |
so = SharedObject.getLocal("player"); | |
so.data.volume = ((that.player_mc.volumeSlideBtn._x - VOLUMESLIDER_MIN_X) / VOLUMESLIDER_WIDTH) * 100; | |
so.flush(); | |
}; | |
player_mc.volumeSlideBtn.onReleaseOutside = player_mc.volumeSlideBtn.onRelease; | |
} | |
function nextSong() { | |
stopPlay(); | |
myPlaylist.gotoNextSong(); | |
startPlay(); | |
} | |
function previousSong() { | |
stopPlay(); | |
myPlaylist.gotoPreviousSong(); | |
startPlay(); | |
} | |
function continueToNextSong() { | |
stopPlay(); | |
myPlaylist.gotoNextSong(); | |
if (myPlaylist.getCurrentSongPosition() > 0) { | |
startPlay(); | |
} | |
} | |
function setStatus(status) { | |
if (currentStatus != status) { | |
var _local3 = currentStatus; | |
currentStatus = status; | |
fireStatusChangeEvent(status, _local3); | |
} | |
} | |
function log(message) { | |
if (LOGGING) { | |
if (DEVELOPMENT) { | |
trace(message); | |
} else { | |
player_mc._debug.text = (message + newline) + player_mc._debug.text; | |
} | |
} | |
} | |
//ASSetPropFlags(_local1, null, 1); | |
static var DEVELOPMENT = false; | |
static var LOGGING = false; | |
static var SECONDS_BEFORE_SONGCOUNT = 20; | |
static var MAX_COUNTS_PER_SONG_PER_DAY = 10; | |
static var NOT_STARTED = 0; | |
static var BUFFERING = 1; | |
static var PLAY = 2; | |
static var PAUSE = 3; | |
static var STOP = 4; | |
static var ERROR = 5; | |
static var TYPE_ARTISTPLAYER = 1; | |
static var TYPE_PROFILEPLAYER = 2; | |
static var SIZE_SMALL = 1; | |
static var SIZE_LARGE = 2; | |
var currentStatus = NOT_STARTED; | |
} | |
| |
//---------------------------------------------------------------------- | |
//Symbol 24 MovieClip Frame 9 | |
//---------------------------------------------------------------------- | |
stop(); | |
| |
//---------------------------------------------------------------------- | |
//Symbol 51 MovieClip Frame 1 | |
//---------------------------------------------------------------------- | |
stop(); | |
| |
//---------------------------------------------------------------------- | |
//Symbol 20481 MovieClip [__Packages.Progressbar] Frame 0 | |
//---------------------------------------------------------------------- | |
class Progressbar | |
{ | |
var bar_mc, slider_mc, totalTime, bufferedTime, dispatchEvent, currentTime; | |
function Progressbar (parent_mc, x, y, width, height) { | |
bar_mc = parent_mc.attachMovie("progressbar_bar", "_bar_mc", parent_mc.getNextHighestDepth(), {_x:x, _y:y}); | |
bar_mc._width = width; | |
bar_mc._height = height; | |
var thisObject = this; | |
bar_mc.onPress = function () { | |
thisObject.gotoMousePosition(); | |
}; | |
slider_mc = parent_mc.attachMovie("progressbar_slider", "_slider_mc", parent_mc.getNextHighestDepth(), {_x:x, _y:y + (height / 2)}); | |
slider_mc.onPress = function () { | |
thisObject.startDragging(); | |
}; | |
update(0, 1, 0); | |
com.gskinner.events.GDispatcher.initialize(this); | |
} | |
function gotoMousePosition() { | |
var _local2 = (((bar_mc._xmouse * bar_mc._xscale) / 100) / bar_mc._width) * totalTime; | |
if (_local2 > bufferedTime) { | |
_local2 = bufferedTime; | |
} | |
dispatchEvent({target:this, type:"seeking", position:_local2}); | |
} | |
function startDragging() { | |
dispatchEvent({target:this, type:"startSeek"}); | |
slider_mc.startDrag(true, bar_mc._x, slider_mc._y, bar_mc._x + bar_mc._width, slider_mc._y); | |
var thisObject = this; | |
slider_mc.onMouseMove = function () { | |
thisObject.amDragging(); | |
}; | |
slider_mc.onRelease = function () { | |
thisObject.stopDragging(); | |
}; | |
slider_mc.onReleaseOutside = function () { | |
thisObject.stopDragging(); | |
}; | |
sliderIsDragging = true; | |
} | |
function amDragging() { | |
var _local2 = ((slider_mc._x - bar_mc._x) / bar_mc._width) * totalTime; | |
if (_local2 > bufferedTime) { | |
_local2 = bufferedTime; | |
slider_mc._x = ((_local2 / totalTime) * bar_mc._width) + bar_mc._x; | |
} | |
dispatchEvent({target:this, type:"seeking", position:_local2}); | |
} | |
function stopDragging() { | |
var _local2 = ((slider_mc._x - bar_mc._x) / bar_mc._width) * totalTime; | |
if (_local2 > bufferedTime) { | |
_local2 = bufferedTime; | |
slider_mc._x = ((_local2 / totalTime) * bar_mc._width) + bar_mc._x; | |
} | |
dispatchEvent({target:this, type:"stopSeek", position:_local2}); | |
slider_mc.stopDrag(); | |
slider_mc.onMouseMove = null; | |
slider_mc.onRelease = null; | |
slider_mc.onReleaseOutside = null; | |
sliderIsDragging = false; | |
} | |
function update(currentTime, totalTime, bufferedTime) { | |
if (!sliderIsDragging) { | |
this.totalTime = totalTime; | |
this.bufferedTime = bufferedTime; | |
var _local5 = Math.round((this.bufferedTime / this.totalTime) * 100); | |
bar_mc.loadprogress_mc._xscale = _local5; | |
this.currentTime = currentTime; | |
slider_mc._x = bar_mc._x + ((bar_mc._width * this.currentTime) / this.totalTime); | |
} | |
} | |
//ASSetPropFlags(_local1, null, 1); | |
var backgroundBorderColor = 6710886; | |
var backgroundColor = 16777215; | |
var loadedColor = 11184810; | |
var sliderIsDragging = false; | |
} | |
| |
//---------------------------------------------------------------------- | |
//Frame 1 | |
//---------------------------------------------------------------------- | |
APlayer.main(this); | |
| |
//---------------------------------------------------------------------- | |
//Symbol 51 MovieClip Frame 10 | |
//---------------------------------------------------------------------- | |
stop(); | |
| |
//---------------------------------------------------------------------- | |
//Symbol 36 MovieClip Frame 1 | |
//---------------------------------------------------------------------- | |
stop(); | |
| |
//---------------------------------------------------------------------- | |
//Symbol 20480 MovieClip [__Packages.Song] Frame 0 | |
//---------------------------------------------------------------------- | |
class Song | |
{ | |
var id, artist, name, url, length, copy; | |
function Song (id, artist, name, url, length, mayBeCopied) { | |
this.id = id; | |
this.artist = artist; | |
this.name = name; | |
this.url = url; | |
this.length = length; | |
copy = mayBeCopied; | |
} | |
function getId() { | |
return(id); | |
} | |
function getArtist() { | |
return(artist); | |
} | |
function getUrl() { | |
return(url); | |
} | |
function getName() { | |
return(name); | |
} | |
function getLength() { | |
return(length); | |
} | |
function mayBeCopied() { | |
return(copy); | |
} | |
//ASSetPropFlags(_local1, null, 1); | |
} | |
| |
//---------------------------------------------------------------------- | |
//Symbol 45 MovieClip Frame 1 | |
//---------------------------------------------------------------------- | |
stop(); | |
| |
//---------------------------------------------------------------------- | |
//Symbol 30 MovieClip Frame 1 | |
//---------------------------------------------------------------------- | |
stop(); | |
| |
//---------------------------------------------------------------------- | |
//Symbol 20484 MovieClip [__Packages.APlayer] Frame 0 | |
//---------------------------------------------------------------------- | |
class APlayer | |
{ | |
static var myplayer; | |
function APlayer () { | |
} | |
static function main() { | |
System.security.allowDomain("*"); | |
if (!Player.DEVELOPMENT) { | |
var _local2 = {addButton:_root.addText, viewProfileButton:_root.viewText}; | |
} else { | |
var _local2 = {addButton:"Voeg toe", viewProfileButton:"Bekijk"}; | |
} | |
myplayer = new Player(_root, _local2, _root.myUid, ((_root.playerType == "artist") ? (Player.TYPE_ARTISTPLAYER) : (Player.TYPE_PROFILEPLAYER)), ((_root.playerSize == "large") ? (Player.SIZE_LARGE) : (Player.SIZE_SMALL))); | |
} | |
//ASSetPropFlags(_local1, null, 1); | |
} | |
| |
//---------------------------------------------------------------------- | |
//Symbol 36 MovieClip Frame 10 | |
//---------------------------------------------------------------------- | |
stop(); | |
| |
//---------------------------------------------------------------------- | |
//Symbol 30 MovieClip Frame 10 | |
//---------------------------------------------------------------------- | |
stop(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment