• 
  • //----------------------------------------------------------------------
  • //Symbol 147 MovieClip [fullDisplay] Frame 1
  • //----------------------------------------------------------------------
  • #initclip 29
  • object.registerclass("fullDisplay", logic.Movie);
  • #endinitclip
  •  
  • 
  • //----------------------------------------------------------------------
  • //Symbol 178 MovieClip [__Packages.logic.Movie] Frame 0
  • //----------------------------------------------------------------------
  • class logic.Movie extends movieclip
  • {
  • var videoDisplay, bufferEmptyCount, videoDownloadRetries, snd, createemptymovieclip, sound_data_so, sound_data, audio, base_url, display_ratio, end_screen, _parent, loadVideoInterval, jsApiInterval, onShowMute, onShowVolume, is_playing, onPlayMovie, onPauseMovie, video_id, track_id, movie_url, movieTime, load_awsome, tracker, tracker_cls, started, restart, stall_count, api_loaded, max_seek_ratio, overlay, format, loader, ns, static_share_clip, static_share, attachmovie, getnexthighestdepth, onEndMovie, init_seek, onStartMovie, onSeek, is_peeking, onProgress, lastTime, stallCount, bg, clear, beginfill, moveto, lineto, endfill;
  • function Movie () {
  • super();
  • videoDisplay.smoothing = true;
  • bufferEmptyCount = 0;
  • videoDownloadRetries = 0;
  • snd = createemptymovieclip("snd", 0);
  • sound_data_so = sharedobject.getlocal("soundData", "/");
  • sound_data = sound_data_so.data;
  • audio = new sound(snd);
  • if (sound_data.volume == undefined) {
  • sound_data.volume = 100;
  • }
  • if (sound_data.mute == undefined) {
  • sound_data.mute = false;
  • }
  • if ((_root.BASE_YT_URL == undefined) || (!logic.Util.inYTDomain(_root.BASE_YT_URL))) {
  • base_url = "http://www.youtube.com/";
  • } else {
  • base_url = _root.BASE_YT_URL;
  • }
  • display_ratio = videoDisplay._width / videoDisplay._height;
  • registerLoader(new logic.MovieLoader());
  • end_screen._visible = false;
  • _root.strings = {Share:"share", WatchAgain:"replay", From:"From:", Views:"Views:", Comments:"Comments:", VideoRating:"Video Rating", Ratings:"RATING_COUNT_1 ratings", ZeroRatings:"0 ratings", VideoNoLongerAvailable:"This video is no longer available.", EmbeddingNotAllowed:"The owner of this video does not allow video embedding please watch this video on YouTube.com", VideoUnavailable:"This video is unavailable.", RateThisVideo:"Rate this video", ThanksForRating:"Thanks for rating!", Poor:"Poor", NothingSpecial:"Nothing Special", WorthWatching:"Worth Watching", PrettyCool:"Pretty Cool", Awesome:"Awesome!", LoginToRate:"Login to rate video", Loading:"Loading..."};
  • if (((_root.hl != "en") && (_root.hl != "")) && (_root.hl != undefined)) {
  • var _local7 = new xml();
  • _local7.ignorewhite = true;
  • var moviePointer = this;
  • _local7.onload = function (s) {
  • if (s) {
  • var _local3 = this.firstchild.firstchild.childnodes;
  • for (var _local4 in _local3) {
  • if (_local3[_local4].nodename == "msg") {
  • _root.strings[_local3[_local4].attributes.name] = _local3[_local4].firstchild.nodevalue;
  • }
  • }
  • for (var _local5 in _root.strings) {
  • }
  • if (moviePointer.is_ad) {
  • moviePointer._parent.pva_info.stars.setStarText();
  • moviePointer.overlay.show_message(_root.strings.Loading);
  • }
  • }
  • };
  • var _local8 = ((base_url + "xlb/") + _root.hl) + ".xlb";
  • if (is_ad) {
  • _local8 = ((base_url + "xlb/yva/") + _root.hl) + ".xlb";
  • }
  • _local7.load(_local8);
  • } else if (is_ad) {
  • _parent.controller.share.instance10.text = _root.strings.Share;
  • }
  • loadVideoInterval = setinterval(this, "checkVideoQualitySettings", 250);
  • }
  • function enableJsApi() {
  • if (!jsApiInterval) {
  • system.security.allowdomain("*");
  • jsApiInterval = setinterval(this, "updateJsApi", 100);
  • }
  • }
  • function atLeastVersion(major, minor, build) {
  • var _local1 = system.capabilities.version.split(" ")[1].split(",");
  • var _local3 = parseint(_local1[0]);
  • var _local2 = parseint(_local1[1]);
  • var _local4 = parseint(_local1[2]);
  • if ((isnan(_local3) || (isnan(_local2))) || (isnan(_local4))) {
  • return(false);
  • }
  • if (_local3 > major) {
  • return(true);
  • }
  • if (_local3 < major) {
  • return(false);
  • }
  • if (_local2 > minor) {
  • return(true);
  • }
  • if (_local2 < minor) {
  • return(false);
  • }
  • if (_local4 > build) {
  • return(true);
  • }
  • if (_local4 < build) {
  • return(false);
  • }
  • return(true);
  • }
  • function initController() {
  • if (sound_data.mute) {
  • audio.setvolume(0);
  • onShowMute();
  • } else {
  • onShowVolume(sound_data.volume);
  • audio.setvolume(sound_data.volume);
  • }
  • if (is_playing) {
  • onPlayMovie();
  • } else {
  • onPauseMovie();
  • }
  • }
  • function setMovie(_video_id, image_url, movie_url, l, _track_id, eurl, append_vars, fmt_map, vq) {
  • video_id = _video_id;
  • track_id = _track_id;
  • var _local14 = image_url;
  • if ((_local14 == undefined) && (is_embed)) {
  • _local14 = ("http://img.youtube.com/vi/" + video_id) + "/default.jpg";
  • }
  • if (eurl == undefined) {
  • eurl = "";
  • }
  • if (append_vars == undefined) {
  • append_vars = "";
  • }
  • if (movie_url == undefined) {
  • movie_url = (((base_url + "watch?v=") + video_id) + "&eurl=") + escape(eurl);
  • }
  • this.movie_url = movie_url;
  • movieTime = l;
  • if (is_embed) {
  • append_vars = append_vars + ("&eurl=" + escape(eurl));
  • if (is_ad) {
  • append_vars = append_vars + "&adp=1";
  • }
  • load_awsome = false;
  • } else {
  • load_awsome = true;
  • }
  • if (tracker) {
  • tracker.endTrack();
  • delete tracker;
  • }
  • if (tracker_cls) {
  • tracker = new this.tracker_cls(this);
  • }
  • pauseMovie();
  • hideEnded();
  • is_playing = false;
  • started = false;
  • restart = true;
  • stall_count = 0;
  • api_loaded = false;
  • max_seek_ratio = 0;
  • if (_local14) {
  • if (is_embed && (!is_ad)) {
  • overlay.makePressable();
  • } else {
  • overlay.makePlayMoviePressable();
  • }
  • overlay.loadclip(_local14);
  • }
  • format = undefined;
  • if (fmt_map != undefined) {
  • var _local13 = logic.VideoStats.predictedBandwidthInBitsPerSecond();
  • if (!_local13) {
  • _local13 = 0;
  • }
  • var _local11;
  • var _local10 = fmt_map.split(",");
  • var _local4 = 0;
  • while (_local4 < _local10.length) {
  • if (_local10[_local4] == "default") {
  • break;
  • }
  • var _local3 = _local10[_local4].split("/");
  • var _local5 = _local3[0];
  • var _local6 = parseint(_local3[1]);
  • var _local8 = parseint(_local3[2]);
  • var _local7 = parseint(_local3[3]);
  • var _local9 = parseint(_local3[4]);
  • if (_local5 == undefined) {
  • } else if (((isnan(_local8) || (isnan(_local7))) || (isnan(_local9))) || (isnan(_local6))) {
  • } else if (!atLeastVersion(_local8, _local7, _local9)) {
  • } else {
  • _local11 = VIDEO_QUALITY_SETTING_LOW;
  • if (_local6 == 0) {
  • format = _local5;
  • break;
  • }
  • if (((vq == VIDEO_QUALITY_SETTING_AUTO) && (_local6 <= _local13)) || (vq == VIDEO_QUALITY_SETTING_HIGH)) {
  • _local11 = VIDEO_QUALITY_SETTING_HIGH;
  • format = _local5;
  • break;
  • }
  • }
  • _local4++;
  • }
  • _root.vq = _local11;
  • }
  • loader.load(base_url, video_id, track_id, append_vars, format);
  • _attachLoader(loader);
  • if (!loader.started) {
  • overlay.show();
  • } else {
  • setSeek(0);
  • overlay.hide();
  • }
  • }
  • function registerLoader(_loader, leave_old) {
  • if (loader) {
  • if (!leave_old) {
  • loader.die();
  • }
  • delete ns;
  • delete loader;
  • }
  • _attachLoader(_loader);
  • }
  • function _attachLoader(_loader) {
  • loader = _loader;
  • loader.setMovie(this);
  • ns = loader.ns;
  • videoDisplay.attachvideo(ns);
  • snd.attachaudio(ns);
  • }
  • function popLoader() {
  • var _local2 = loader;
  • delete ns;
  • delete loader;
  • registerLoader(new logic.MovieLoader());
  • return(_local2);
  • }
  • function share() {
  • var _local2 = _parent;
  • if (static_share_clip) {
  • static_share_clip.removemovieclip();
  • delete static_share_clip;
  • } else if (static_share) {
  • _local2.play_button._visible = false;
  • attachmovie("StaticShare", "static_share_clip", getnexthighestdepth(), {share_url:movie_url});
  • } else if (!is_embed) {
  • logic.Util.showShare(base_url, video_id);
  • } else {
  • logic.Util.popUpShare(base_url, video_id);
  • }
  • _local2.logShareEvent();
  • pauseMovie();
  • }
  • function endMovie() {
  • if (tracker) {
  • tracker.doTrack(gettime(), getSeekRatio());
  • tracker.doEndMovieTrack();
  • }
  • restart = true;
  • loader.clearOffset();
  • pauseMovie();
  • if (load_awsome) {
  • end_screen.load_for_awsome();
  • load_awsome = false;
  • }
  • if (!onEndMovie()) {
  • showEnded();
  • }
  • }
  • function showEnded() {
  • end_screen.show();
  • }
  • function hideEnded() {
  • end_screen.hide();
  • }
  • function pauseMovie() {
  • ns.pause(true);
  • is_playing = false;
  • onPauseMovie();
  • }
  • function stopMovie() {
  • restart = true;
  • loader.clearOffset();
  • pauseMovie();
  • }
  • function stopAll() {
  • is_playing = false;
  • pauseMovie();
  • videoDisplay.clear();
  • loader.die();
  • }
  • function setInitSeek(seek_time) {
  • init_seek = seek_time;
  • }
  • function initSeek() {
  • if (init_seek) {
  • setSeek(init_seek);
  • }
  • }
  • function playMovie() {
  • if (static_share_clip) {
  • static_share_clip.removemovieclip();
  • delete static_share_clip;
  • }
  • if (loader.started == false) {
  • loader.start();
  • overlay.show_loading();
  • onStartMovie();
  • } else {
  • if (restart == true) {
  • setSeek(0);
  • }
  • ns.pause(false);
  • }
  • hideEnded();
  • onPlayMovie();
  • is_playing = true;
  • restart = false;
  • }
  • function isPlaying() {
  • return(is_playing);
  • }
  • function getMovieInfo() {
  • var _local2 = new logic.restXML(base_url);
  • _local2.dispatch(this, parseMovieInfo, undefined, "youtube.videos.get_video_info", {video_id:video_id});
  • }
  • function parseMovieInfo(data) {
  • if (data.video) {
  • var _local3 = logic.restXML.get_dict(data.video);
  • var _local4 = number(_local3.length_seconds);
  • if (_local4) {
  • movieTime = _local4;
  • }
  • if ((_local3.embed_status == "rejected") || (_local3.embed_status == "unavail")) {
  • overlay.show_message(_root.strings.VideoNoLongerAvailable);
  • stopAll();
  • } else if (_local3.embed_status == "not_allowed") {
  • overlay.show_message(_root.strings.EmbeddingNotAllowed);
  • stopAll();
  • } else if (_local3.embed_status == "restricted") {
  • overlay.show_message(_root.strings.VideoUnavailable);
  • stopAll();
  • }
  • api_loaded = true;
  • }
  • }
  • function Mute() {
  • sound_data.mute = true;
  • audio.setvolume(0);
  • onShowMute();
  • sound_data_so.flush();
  • }
  • function setInfringeMute() {
  • is_infringe_mute = true;
  • }
  • function unMute() {
  • if (!is_infringe_mute) {
  • sound_data.mute = false;
  • audio.setvolume(sound_data.volume);
  • onShowVolume(sound_data.volume);
  • sound_data_so.flush();
  • }
  • }
  • function use_master_sound(master_movie) {
  • sound_data = new object();
  • sound_data_so = undefined;
  • var _local2 = master_movie.sound_data;
  • sound_data = {mute:_local2.mute, volume:_local2.volume};
  • if (sound_data.mute) {
  • Mute();
  • } else {
  • unMute();
  • }
  • }
  • function toggleMute() {
  • if (sound_data.mute) {
  • unMute();
  • } else {
  • Mute();
  • }
  • }
  • function setvolume(v) {
  • if (!is_infringe_mute) {
  • sound_data.volume = v;
  • sound_data.mute = false;
  • audio.setvolume(sound_data.volume);
  • onShowVolume(sound_data.volume);
  • sound_data_so.flush();
  • }
  • }
  • function setSeekRatio(ratio) {
  • setSeek(ratio * movieTime);
  • }
  • function getTotalTime() {
  • return(movieTime);
  • }
  • function getCurrentTime() {
  • return(gettime());
  • }
  • function findCue(t) {
  • if (loader.cues) {
  • var _local3 = loader.cues;
  • var _local2 = 0;
  • while (_local2 < _local3.times.length) {
  • var _local4 = _local2 + 1;
  • if ((_local3.times[_local2] <= t) && ((_local3.times[_local4] >= t) || (_local4 == _local3.times.length))) {
  • return({time:_local3.times[_local2], position:_local3.positions[_local2]});
  • }
  • _local2++;
  • }
  • }
  • }
  • function setSeek(s) {
  • delete init_seek;
  • if (s != undefined) {
  • var _local3 = findCue(s);
  • if (_local3) {
  • var _local4 = 100;
  • if ((_local3.position > ((loader.start_pos + ns.bytesloaded) + _local4)) || (_local3.position < (loader.start_pos - _local4))) {
  • if (!loader.loadOffset(_local3.time, _local3.position)) {
  • ns.seek(s);
  • }
  • } else {
  • ns.seek(s);
  • }
  • } else if (loader.canseekontime) {
  • var _local5 = getLoadRatio() * loader.totalduration;
  • if ((s < loader.start_time) || (s > _local5)) {
  • loader.loadOffset(s);
  • } else {
  • ns.seek(s - loader.timestamp_offset);
  • }
  • } else {
  • ns.seek(s);
  • }
  • onSeek(getStartRatio(), getSeekRatio());
  • if (tracker) {
  • tracker.doSetTrack(gettime(), getSeekRatio());
  • }
  • is_peeking = false;
  • ns.pause(!is_playing);
  • }
  • }
  • function peekSeekRatio(r) {
  • restart = false;
  • is_peeking = true;
  • hideEnded();
  • ns.seek(r * movieTime);
  • onSeek(getStartRatio(), getSeekRatio());
  • }
  • function getLoadRatio() {
  • if (!loader.started) {
  • return(0);
  • }
  • var _local3 = ns.bytesloaded + loader.start_pos;
  • var _local2 = ns.bytestotal + loader.start_pos;
  • if (_local2 == 0) {
  • return(0);
  • }
  • if ((_local3 == _local2) && (_local3 > 1000)) {
  • return(1);
  • }
  • return(_local3 / _local2);
  • }
  • function getSeekRatio() {
  • if (restart == true) {
  • return(0);
  • }
  • if (loader.delay_progress || (!loader.started)) {
  • return(loader.start_time / movieTime);
  • }
  • if (gettime() > movieTime) {
  • return(1);
  • }
  • return(gettime() / movieTime);
  • }
  • function getStartRatio() {
  • if (loader.start_time == undefined) {
  • return(0);
  • }
  • if (loader.start_time > movieTime) {
  • return(1);
  • }
  • return(loader.start_time / movieTime);
  • }
  • function gettime() {
  • return(loader.timestamp_offset + ns.time);
  • }
  • function onenterframe() {
  • var _local4 = getStartRatio();
  • var _local3 = getSeekRatio();
  • var _local2 = gettime();
  • onSeek(_local4, _local3);
  • onProgress(_local4, getLoadRatio());
  • max_seek_ratio = math.max(max_seek_ratio, _local3);
  • if ((_local3 > 0.8) && (load_awsome)) {
  • end_screen.load_for_awsome();
  • load_awsome = false;
  • }
  • if (tracker) {
  • tracker.doTrack(_local2, _local3);
  • }
  • if (init_run) {
  • initController();
  • init_run = false;
  • } else if (((((ns.bytestotal > 0) && (ns.bytesloaded == ns.bytestotal)) && (_local2 >= (movieTime - 1))) && (is_playing)) && (!is_peeking)) {
  • if (lastTime != _local2) {
  • lastTime = _local2;
  • stallCount = 0;
  • } else if (stallCount < 30) {
  • stallCount++;
  • } else {
  • endMovie();
  • stallCount = 0;
  • }
  • }
  • }
  • function resizeForReals(area_width, area_height, no_scale) {
  • var _local2 = loader.video_width;
  • var _local3 = loader.video_height;
  • if ((!_local2) || (!_local3)) {
  • _local2 = videoDisplay.width;
  • _local3 = videoDisplay.height;
  • if ((!_local2) || (!_local3)) {
  • _local2 = 320;
  • _local3 = 240;
  • }
  • }
  • var _local6 = _local2 / _local3;
  • var _local5 = infinity;
  • var _local4 = infinity;
  • if (no_scale) {
  • _local5 = _local2;
  • _local4 = _local3;
  • }
  • if ((_local5 > area_width) || (_local4 > area_height)) {
  • if (area_width > (_local6 * area_height)) {
  • _local4 = area_height;
  • _local5 = _local6 * area_height;
  • } else {
  • _local5 = area_width;
  • _local4 = area_width / _local6;
  • }
  • }
  • videoDisplay._x = _local5 / -2;
  • videoDisplay._y = _local4 / -2;
  • videoDisplay._width = _local5;
  • videoDisplay._height = _local4;
  • videoDisplay.smoothing = (_local5 > _local2) || (_local4 > _local3);
  • }
  • function resizeNormal() {
  • resizeForReals(bg._width, bg._height, false);
  • }
  • function resizeOriginal() {
  • resizeForReals(bg._width, bg._height, true);
  • }
  • function resize(w, h) {
  • if (!is_embed) {
  • clear();
  • beginfill(0);
  • var _local5 = (-1 * w) / 2;
  • var _local4 = (-1 * h) / 2;
  • moveto(_local5, _local4);
  • lineto(_local5 + w, _local4);
  • lineto(_local5 + w, _local4 + h);
  • lineto(_local5, _local4 + h);
  • lineto(_local5, _local4);
  • endfill();
  • }
  • bg._width = w;
  • bg._height = h;
  • resizeForReals(bg._width, bg._height, false);
  • var _local6 = w / h;
  • if (_local6 > display_ratio) {
  • w = h * display_ratio;
  • } else {
  • h = w / display_ratio;
  • }
  • overlay.resize(w, h);
  • end_screen.resize(w, h);
  • }
  • function updateJsApi() {
  • _root.duration = movieTime;
  • _root.currentTime = gettime();
  • _root.totalBytes = ns.bytestotal;
  • _root.totalBytesLoaded = ns.bytesloaded;
  • _root.isPlaying = is_playing;
  • if (_root.seekTo != null) {
  • setSeek(parseint(_root.seekTo));
  • _root.seekTo = null;
  • }
  • if (_root.pauseMovie != null) {
  • is_playing = ((_root.pauseMovie == "true") ? false : true);
  • if (!is_playing) {
  • pauseMovie();
  • } else {
  • playMovie();
  • }
  • _root.pauseMovie = null;
  • }
  • }
  • function checkVideoQualitySettings() {
  • if (_root.loadVideo != null) {
  • var _local3 = _root.loadVideo.split(":");
  • setMovie(_local3[0], undefined, undefined, _root.l, _root.t, undefined, undefined, _local3[1]);
  • playMovie();
  • _root.loadVideo = null;
  • }
  • if (_root.setVideoQuality != null) {
  • if (_root.setVideoQuality != _root.vq) {
  • _root.vq = _root.setVideoQuality;
  • setMovie(_root.video_id, undefined, undefined, _root.l, _root.t, undefined, undefined, _root.fmt_map, _root.vq);
  • playMovie();
  • }
  • _root.setVideoQuality = null;
  • }
  • }
  • var VIDEO_QUALITY_SETTING_AUTO = 0;
  • var VIDEO_QUALITY_SETTING_LOW = 1;
  • var VIDEO_QUALITY_SETTING_HIGH = 2;
  • var init_run = true;
  • var is_embed = false;
  • var is_ad = false;
  • var is_infringe_mute = false;
  • }
  • 
  • //----------------------------------------------------------------------
  • //Symbol 171 MovieClip [__Packages.logic.NextVideoPanel] Frame 0
  • //----------------------------------------------------------------------
  • class logic.NextVideoPanel extends movieclip
  • {
  • var _visible, clip1, clip2, load_next, active_clip, bg, clip_bounds, server, _parent, data, clip_index, swap_clip, clip3, animate_interval_id, title_field, run_time, view_count, author, from_txt, views_txt, stars, loaded, paused, _alpha, geturl, clip_interval_id;
  • function NextVideoPanel () {
  • super();
  • _visible = false;
  • clip1._visible = false;
  • clip2._visible = false;
  • load_next = undefined;
  • active_clip = clip1;
  • bg._alpha = 30;
  • clip_bounds = clip1.getbounds(clip1._parent);
  • server = _parent;
  • }
  • function load(next_data) {
  • load_next = next_data;
  • }
  • function load_data(d) {
  • data = d;
  • if (data == undefined) {
  • _visible = false;
  • return(undefined);
  • }
  • clip_index = 1;
  • active_clip = (swap_clip = clip2);
  • logic.Util.loadImgClip(clip2, data.thumbnail_url2, this, clip_bounds);
  • clip1._visible = false;
  • clip2._visible = false;
  • clip3._visible = false;
  • clip1.loaded = false;
  • clip2.loaded = false;
  • clip3.loaded = false;
  • clearinterval(animate_interval_id);
  • animate_interval_id = undefined;
  • title_field.text = "";
  • run_time.text = "";
  • view_count.text = "";
  • author.text = "";
  • from_txt.autosize = "left";
  • from_txt.text = _root.strings.From;
  • author._x = (from_txt._x + from_txt._width) + 2;
  • views_txt.autosize = "left";
  • view_count._x = (views_txt._x + views_txt._width) + 2;
  • views_txt.text = _root.strings.Views;
  • com.google.youtube.debug.Debug.info("moving txt: " + view_count._x, "EndScreen");
  • stars.setStars(0);
  • bg._alpha = 30;
  • loaded = false;
  • }
  • function makeActiveClip(c) {
  • swap_clip = c;
  • swap_clip._visible = true;
  • if (active_clip != swap_clip) {
  • swap_clip._alpha = 0;
  • } else {
  • swap_clip._alpha = 100;
  • }
  • }
  • function onClipLoaded(clip, error) {
  • _visible = true;
  • if (!error) {
  • makeActiveClip(clip);
  • clip.loaded = true;
  • }
  • if (!loaded) {
  • loaded = true;
  • animate_interval_id = setinterval(this, "animate", 25);
  • server.clip_loaded();
  • }
  • }
  • function loadNextClip() {
  • clip_index = (clip_index + 1) % 3;
  • var _local2 = this["clip" + (clip_index + 1)];
  • if (_local2.loaded) {
  • makeActiveClip(_local2);
  • } else {
  • logic.Util.loadImgClip(_local2, data["thumbnail_url" + (clip_index + 1)], this, clip_bounds);
  • }
  • }
  • function onenterframe() {
  • if (load_next && (!paused)) {
  • if ((_alpha > 0) && (data)) {
  • _alpha = _alpha - 10;
  • } else {
  • _alpha = 100;
  • _visible = false;
  • load_data(load_next);
  • load_next = undefined;
  • }
  • }
  • if (active_clip != swap_clip) {
  • if (active_clip._alpha > 0) {
  • active_clip._alpha = active_clip._alpha - 3;
  • swap_clip._alpha = 100 - active_clip._alpha;
  • } else {
  • active_clip._visible = false;
  • active_clip = swap_clip;
  • active_clip._alpha = 100;
  • }
  • }
  • }
  • function animate() {
  • if (title_field.text.length < data.title.length) {
  • title_field.text = title_field.text + data.title.charat(title_field.text.length);
  • }
  • if (run_time.text.length < data.run_time.length) {
  • run_time.text = run_time.text + data.run_time.charat(run_time.text.length);
  • }
  • if (view_count.text.length < data.view_count.length) {
  • view_count.text = view_count.text + data.view_count.charat(view_count.text.length);
  • }
  • if (author.text.length < data.author.length) {
  • author.text = author.text + data.author.charat(author.text.length);
  • }
  • if (stars.value < number(data.rating)) {
  • stars.setStars(stars.value + 0.1);
  • }
  • }
  • function onrelease() {
  • if (data.t && (_root.fs || (stage.displayState == "fullScreen"))) {
  • _parent.movie.setMovie(data.id, undefined, undefined, data.length, data.t, undefined, "&fsnext=1");
  • _parent.movie.playMovie();
  • } else {
  • (geturl(data.url + "&NR=1", "_self"));// not popped
  • }
  • }
  • function setTextNormal(c) {
  • title_field.textcolor = 6724044 /* 0x6699CC */;
  • run_time.textcolor = 10066329 /* 0x999999 */;
  • view_count.textcolor = 6724044 /* 0x6699CC */;
  • author.textcolor = 6724044 /* 0x6699CC */;
  • author.textcolor = 6724044 /* 0x6699CC */;
  • }
  • function setTextHighlight() {
  • title_field.textcolor = 10079487 /* 0x99CCFF */;
  • run_time.textcolor = 13421772 /* 0xCCCCCC */;
  • view_count.textcolor = 10079487 /* 0x99CCFF */;
  • author.textcolor = 10079487 /* 0x99CCFF */;
  • author.textcolor = 10079487 /* 0x99CCFF */;
  • }
  • function onrollover() {
  • _alpha = 100;
  • bg._alpha = 50;
  • paused = true;
  • server.pause();
  • setTextHighlight();
  • if (swap_clip == active_clip) {
  • loadNextClip();
  • }
  • clip_interval_id = setinterval(this, "loadNextClip", 3000);
  • }
  • function onrollout() {
  • bg._alpha = 30;
  • paused = false;
  • server.unpause();
  • setTextNormal();
  • clearinterval(clip_interval_id);
  • }
  • var MAX_LIFE = 200;
  • }
  • 
  • //----------------------------------------------------------------------
  • //Symbol 179 MovieClip [__Packages.logic.MovieLoader] Frame 0
  • //----------------------------------------------------------------------
  • class logic.MovieLoader
  • {
  • var delay_progress, started, nc, ns, cues, interval_id, movie, wait_time, file, append_vars, movieTime, start_pos, start_time, _load_start_time, canseekontime, totalduration, totalbytes, timestamp_offset, sourceurl;
  • function MovieLoader () {
  • delay_progress = false;
  • started = false;
  • }
  • function initNetStream() {
  • if (!nc) {
  • nc = new netconnection();
  • nc.connect(null);
  • ns = new netstream(nc);
  • }
  • cues = undefined;
  • resetScrubToOffset();
  • ns.setbuffertime(2);
  • var o = this;
  • ns.onMetaData = function (obj) {
  • var _local2 = obj.duration;
  • if (obj.totalduration != undefined) {
  • _local2 = obj.totalduration;
  • }
  • if (_local2 != undefined) {
  • o.movieTime = _local2;
  • if (obj.keyframes) {
  • o.cues = {times:obj.keyframes.times, positions:obj.keyframes.filepositions};
  • o.resetScrubToOffset();
  • if (o.movie.loader == o) {
  • o.movie.initSeek();
  • }
  • }
  • } else {
  • o.movieTime == undefined;
  • o.cues = undefined;
  • }
  • if (obj.canseekontime) {
  • o.canseekontime = true;
  • if (!o.totalduration) {
  • o.totalduration = _local2;
  • }
  • if (!o.totalbytes) {
  • o.totalbytes = obj.bytelength;
  • }
  • if (!o.sourceurl) {
  • o.sourceurl = obj.sourceurl;
  • }
  • }
  • if (((obj.width && (obj.height)) && (obj.width > 0)) && (obj.height > 0)) {
  • o.video_width = obj.width;
  • o.video_height = obj.height;
  • } else {
  • o.video_width = undefined;
  • o.video_height = undefined;
  • }
  • o.movie.resizeNormal();
  • };
  • ns.onstatus = function (object) {
  • if (object.code == "NetStream.Play.Stop") {
  • if (o.movie.is_playing) {
  • o.movie.endMovie();
  • }
  • } else if (object.code == "NetStream.Play.Start") {
  • o.started = true;
  • if (o.movie.loader == o) {
  • o.movie.overlay.hide();
  • o.movie.onDisplayMovie();
  • }
  • } else if (object.code == "NetStream.Buffer.Full") {
  • o.delay_progress = false;
  • if (o.movie.loader == o) {
  • o.movie.onDisplayMovie();
  • if (o.movieTime && (o.movie.movieTime == undefined)) {
  • o.movie.movieTime = o.movieTime;
  • } else if ((o.movie.movieTime == undefined) && (!o.api_loaded)) {
  • o.movie.getMovieInfo();
  • }
  • }
  • } else if (object.code == "NetStream.Play.StreamNotFound") {
  • if ((!o.timeout) || (o.timeout < (gettimer() - o._start_load_time))) {
  • if (o.movie.is_embed && (!o.movie.api_loaded)) {
  • o.movie.getMovieInfo();
  • }
  • o.loadLater();
  • } else {
  • o.movie.onloaderror();
  • }
  • } else if (object.code == "NetStream.Buffer.Empty") {
  • o.movie.bufferEmptyCount = o.movie.bufferEmptyCount + 1;
  • }
  • };
  • }
  • function loadLater(waited) {
  • if (interval_id) {
  • clearinterval(interval_id);
  • interval_id = undefined;
  • }
  • if (waited) {
  • movie.videoDownloadRetries = movie.videoDownloadRetries + 1;
  • _loadMovie();
  • ns.pause(!((movie.loader == this) && (movie.is_playing)));
  • } else {
  • interval_id = setinterval(this, "loadLater", wait_time * 1000, true);
  • wait_time = wait_time * 5;
  • }
  • }
  • function load(base_url, video_id, track_id, _append_vars, format) {
  • var _local2 = (((base_url + "get_video?video_id=") + video_id) + "&t=") + track_id;
  • var _local3 = "";
  • if (format) {
  • _local2 = (_local2 + "&fmt=") + format;
  • }
  • if (interval_id) {
  • clearinterval(interval_id);
  • interval_id = undefined;
  • }
  • if (_local2 != file) {
  • append_vars = _append_vars;
  • file = _local2;
  • movieTime = undefined;
  • wait_time = 5;
  • started = false;
  • start_pos = 0;
  • start_time = 0;
  • initNetStream();
  • }
  • }
  • function setMovie(m) {
  • movie = m;
  • }
  • function die() {
  • started = false;
  • ns.close();
  • if (interval_id) {
  • clearinterval(interval_id);
  • }
  • }
  • function preLoad() {
  • if (!started) {
  • start_pos = 0;
  • start_time = 0;
  • ns.play(file + append_vars);
  • ns.pause(true);
  • _load_start_time = gettimer();
  • }
  • }
  • function start() {
  • if (!started) {
  • clearOffset();
  • var _local3 = int(_root.dtst);
  • if (_local3 > 0) {
  • interval_id = setinterval(this, "loadLater", _local3, true);
  • } else {
  • ns.play(file + append_vars);
  • }
  • _load_start_time = gettimer();
  • }
  • }
  • function clearOffset() {
  • if (start_pos) {
  • resetScrubToOffset();
  • started = false;
  • delay_progress = true;
  • }
  • }
  • function loadOffset(_start_time, _pos) {
  • if (canseekontime) {
  • start_time = _start_time;
  • start_pos = totalbytes * (start_time / totalduration);
  • timestamp_offset = start_time;
  • started = false;
  • delay_progress = true;
  • _loadMovie();
  • return(true);
  • }
  • if (start_pos != _pos) {
  • start_pos = _pos;
  • start_time = _start_time;
  • started = false;
  • delay_progress = true;
  • _loadMovie();
  • return(true);
  • }
  • return(false);
  • }
  • function _loadMovie() {
  • if (sourceurl) {
  • ns.play(((sourceurl + "&begin=") + math.floor(start_time * 1000)) + "&len=604800000");
  • } else {
  • ns.play((file + append_vars) + (start_pos ? ("&"));
  • }
  • }
  • function isBuffered() {
  • return(ns.bufferlength > ns.buffertime);
  • }
  • function resetScrubToOffset() {
  • timestamp_offset = 0;
  • totalduration = 0;
  • totalbytes = 0;
  • sourceurl = undefined;
  • canseekontime = undefined;
  • if (start_pos) {
  • start_pos = 0;
  • start_time = 0;
  • }
  • }
  • }
  • 
  • //----------------------------------------------------------------------
  • //Symbol 113 MovieClip [progressCircle] Frame 1
  • //----------------------------------------------------------------------
  • #initclip 26
  • object.registerclass("progressCircle", logic.progressCircle);
  • #endinitclip
  •  
  • 
  • //----------------------------------------------------------------------
  • //Symbol 109 MovieClip [NextVideoPanel] Frame 1
  • //----------------------------------------------------------------------
  • #initclip 25
  • object.registerclass("NextVideoPanel", logic.NextVideoPanel);
  • #endinitclip
  •  
  • 
  • //----------------------------------------------------------------------
  • //Symbol 164 MovieClip [__Packages.logic.EventReporter] Frame 0
  • //----------------------------------------------------------------------
  • class logic.EventReporter extends logic.UrlConstructor
  • {
  • var makeUrl;
  • function EventReporter (baseUrl) {
  • super(baseUrl);
  • }
  • function send(args) {
  • var _local2 = makeUrl(args);
  • sendUrl(_local2);
  • }
  • function sendUrl(url) {
  • var _local2 = new moviecliploader();
  • var _local3 = _root.createemptymovieclip("junkClip", 999999);
  • _local2.loadclip(url, _local3);
  • }
  • }
  • 
  • //----------------------------------------------------------------------
  • //Symbol 166 MovieClip [__Packages.logic.restXML] Frame 0
  • //----------------------------------------------------------------------
  • class logic.restXML
  • {
  • var request_url;
  • function restXML (_req_url) {
  • request_url = _req_url;
  • }
  • function close() {
  • }
  • function get_call_string(method) {
  • return(call_location + escape(method));
  • }
  • function dispatch(dispatcher, cb, cb_error, method, params) {
  • var _local5 = new xml();
  • var _local7 = new xml();
  • _local7.ignorewhite = false;
  • _local5.ignorewhite = true;
  • if (_root.auth_code != undefined) {
  • _local7.addrequestheader("Authorization", _root.auth_code);
  • }
  • var _local3 = get_call_string(method);
  • for (var _local6 in params) {
  • if (_local3.indexof("?") == -1) {
  • _local3 = _local3 + "?";
  • } else {
  • _local3 = _local3 + "&";
  • }
  • _local3 = _local3 + (_local6 + "=");
  • _local3 = _local3 + escape(params[_local6]);
  • }
  • var _local8 = request_url + _local3;
  • _local5.pr = this;
  • _local5.dispatcher = dispatcher;
  • _local5.cb = cb;
  • _local5.cb_error = cb_error;
  • _local5.onload = function (success) {
  • this.pr.parse_dispatch_xml(this, success);
  • };
  • _local7.sendandload(_local8, _local5);
  • }
  • function parse_dispatch_xml(loader, success) {
  • if (success) {
  • var _local3 = process(loader);
  • if (_local3.error) {
  • loader.cb_error.call(loader.dispatcher, _local3.data);
  • } else {
  • loader.cb.call(loader.dispatcher, _local3.data);
  • }
  • } else {
  • loader.cb_error.call(loader.dispatcher, undefined, true);
  • }
  • }
  • function process(xml_rsp) {
  • var _local1 = {};
  • var _local2 = get_sub_node("ut_response", xml_rsp);
  • if (_local2.attributes.status == "ok") {
  • _local1.data = get_dict(_local2);
  • } else if (_local2.attributes.status == "fail") {
  • var _local3 = get_dict(_local2);
  • _local1.data = get_dict(_local3.error);
  • _local1.error = true;
  • } else {
  • _local1.error = true;
  • }
  • return(_local1);
  • }
  • static function get_dict(node) {
  • if (!node) {
  • return(undefined);
  • }
  • var _local4 = new object();
  • var _local2 = 0;
  • while (_local2 < node.childnodes.length) {
  • var _local1 = node.childnodes[_local2];
  • if (_local1.nodetype == 1) {
  • var _local3 = _local1.childnodes[0];
  • if (_local3.nodetype == 3) {
  • _local4[_local1.nodename] = strip_white_space(_local3.nodevalue);
  • } else {
  • _local4[_local1.nodename] = _local1;
  • }
  • }
  • _local2++;
  • }
  • return(_local4);
  • }
  • static function get_sub_array(name, node) {
  • if (!node) {
  • return(undefined);
  • }
  • var _local4 = [];
  • var _local1 = 0;
  • while (_local1 < node.childnodes.length) {
  • var _local2 = node.childnodes[_local1];
  • if (_local2.nodename == name) {
  • _local4.push(_local2);
  • }
  • _local1++;
  • }
  • return(_local4);
  • }
  • static function get_sub_node(name, node) {
  • var _local2 = node.childnodes;
  • for (var _local4 in _local2) {
  • var _local1 = _local2[_local4];
  • if ((_local1.nodetype == 1) and (_local1.nodename == name)) {
  • return(_local1);
  • }
  • }
  • }
  • static function get_sub_text(name, node) {
  • var _local1 = get_sub_node(name, node);
  • var _local2 = _local1.childnodes;
  • for (var _local3 in _local2) {
  • _local1 = _local2[_local3];
  • if (_local1.nodetype == 3) {
  • return(strip_white_space(_local1.nodevalue));
  • }
  • }
  • }
  • static function add_text_node(name, value, node) {
  • var _local2 = new xml();
  • var _local1 = _local2.createelement(name);
  • _local1.appendchild(_local2.createtextnode(value));
  • node.appendchild(_local1);
  • }
  • static function is_whitespace(c) {
  • return(((c == " ") || (c == newline)) || (c == "\t"));
  • }
  • static function strip_white_space(buffer) {
  • var _local4 = 0;
  • var _local3 = buffer.length - 1;
  • var _local1 = 0;
  • while (_local1 < buffer.length) {
  • if ((_local4 == _local1) && (is_whitespace(buffer.charat(_local4)))) {
  • _local4++;
  • }
  • if ((_local3 == (buffer.length - (_local1 + 1))) && (is_whitespace(buffer.charat(_local3)))) {
  • _local3--;
  • }
  • if ((_local4 == (_local1 + 1)) || (_local3 == (buffer.length - (_local1 + 2)))) {
  • } else {
  • break;
  • }
  • _local1++;
  • }
  • return(buffer.slice(_local4, _local3 + 1));
  • }
  • var call_location = "api2_rest?method=";
  • }
  • 
  • //----------------------------------------------------------------------
  • //Symbol 137 MovieClip [endScreen] Frame 1
  • //----------------------------------------------------------------------
  • #initclip 27
  • object.registerclass("endScreen", logic.EndScreen);
  • #endinitclip
  •  
  • 
  • //----------------------------------------------------------------------
  • //Symbol 168 MovieClip [__Packages.logic.MovieController] Frame 0
  • //----------------------------------------------------------------------
  • class logic.MovieController extends movieclip
  • {
  • var pause_button, play_button, stop_button, warp_button, slider, full_progress_bar, getbounds, left_justified_elements, ldiv, right_justified_elements, timer, mrdiv, sound_control, rdiv, regular, small, min, max, movie, right_bg, left_bg, main_bg, seek_time, seek_total_time, fullBar, seekBar, seekBar_l, seekBar_r, progressBar, progressBar_l, progressBar_r;
  • function MovieController () {
  • super();
  • pause_button._visible = false;
  • var o = this;
  • play_button.onrelease = function () {
  • o.movie.playMovie();
  • };
  • pause_button.onrelease = function () {
  • o.movie.pauseMovie();
  • };
  • stop_button.onrelease = function () {
  • o.movie.stopMovie();
  • };
  • warp_button.onrelease = function () {
  • o._parent.toggleWarp();
  • };
  • warp_button._visible = false;
  • var _local6 = function () {
  • o.slider_down = true;
  • o.slider.highLight();
  • this.onenterframe = function () {
  • var _local1 = o._xmouse;
  • if (_local1 < o.full_progress_bar._x) {
  • _local1 = o.full_progress_bar._x;
  • } else if (_local1 > (o.full_progress_bar._x + o.full_progress_bar._width)) {
  • _local1 = o.full_progress_bar._x + o.full_progress_bar._width;
  • }
  • o.slider._x = _local1;
  • o.movie.peekSeekRatio(o.getScale());
  • };
  • };
  • var _local7 = function () {
  • o.slider.normal();
  • o.movie.setSeekRatio(o.getScale());
  • o.slider_down = false;
  • delete this.onenterframe;
  • };
  • full_progress_bar.onpress = (slider.onpress = _local6);
  • full_progress_bar.onrelease = (full_progress_bar.onreleaseoutside = (slider.onrelease = (slider.onreleaseoutside = _local7)));
  • var _local3 = getbounds(this);
  • left_justified_elements = [play_button, warp_button, pause_button, stop_button, ldiv, full_progress_bar];
  • for (var _local5 in left_justified_elements) {
  • left_justified_elements[_local5]._xstart = _local3.xMin - left_justified_elements[_local5]._x;
  • }
  • right_justified_elements = [timer, mrdiv, sound_control, rdiv, regular, small, min, max];
  • for (var _local5 in right_justified_elements) {
  • right_justified_elements[_local5]._xstart = _local3.xMax - right_justified_elements[_local5]._x;
  • }
  • full_progress_bar._xend = _local3.xMax - (full_progress_bar._width + full_progress_bar._x);
  • }
  • function registerMovie(m) {
  • movie = m;
  • sound_control.registerMovie(m);
  • var o = this;
  • m.onPauseMovie = function () {
  • o.showPlay();
  • };
  • var old_play_handler = m.onPlayMovie;
  • m.onPlayMovie = function () {
  • o.showPause();
  • old_play_handler.call(this);
  • };
  • m.onSeek = function (ir, r) {
  • o.showSeek(ir, r);
  • };
  • m.onProgress = function (ir, r) {
  • o.showProgress(ir, r);
  • };
  • }
  • function getScale() {
  • var _local2 = (slider._x - full_progress_bar._x) / full_progress_bar._width;
  • if (_local2 < 0) {
  • return(0);
  • }
  • return(_local2);
  • }
  • function resize_width(w) {
  • var _local6 = stage.displayState;
  • if (_local6 == "fullScreen") {
  • showFSButtons(true);
  • } else if (_local6 == "normal") {
  • if (min._perm_visible) {
  • logic.Util.call_js("checkCurrentVideo", movie.video_id);
  • }
  • showFSButtons(false);
  • }
  • main_bg._width = w - ((left_bg._width + right_bg._width) - 2);
  • left_bg._x = -1 * (w / 2);
  • right_bg._x = w / 2;
  • for (var _local2 in left_justified_elements) {
  • left_justified_elements[_local2]._x = (-1 * (w / 2)) - left_justified_elements[_local2]._xstart;
  • }
  • var _local5 = full_progress_bar._x + MIN_PROGRESS_BAR_SIZE;
  • var _local3;
  • var _local2 = 0;
  • while (_local2 < right_justified_elements.length) {
  • right_justified_elements[_local2]._x = (w / 2) - right_justified_elements[_local2]._xstart;
  • if (right_justified_elements[_local2]._x < rdiv._x) {
  • if ((right_justified_elements[_local2]._x - 10) < _local5) {
  • right_justified_elements[_local2]._visible = false;
  • } else {
  • makeVisible(right_justified_elements[_local2]);
  • if (isnan(_local3)) {
  • _local3 = right_justified_elements[_local2]._x;
  • }
  • }
  • } else {
  • makeVisible(right_justified_elements[_local2]);
  • if (isnan(_local3)) {
  • _local3 = right_justified_elements[_local2]._x;
  • }
  • }
  • _local2++;
  • }
  • full_progress_bar._width = (_local3 - full_progress_bar._x) - 10;
  • }
  • function showPlay() {
  • play_button._visible = true;
  • pause_button._visible = false;
  • }
  • function showPause() {
  • play_button._visible = false;
  • pause_button._visible = true;
  • }
  • function format_minute_time(t) {
  • if (t == undefined) {
  • return("0:00");
  • }
  • var _local1 = string(math.floor(t % 60));
  • if (_local1.length == 1) {
  • _local1 = "0" + _local1;
  • }
  • var _local2 = string(math.floor(t / 60));
  • if (_local2.length == 1) {
  • _local2 = "0" + _local2;
  • }
  • return((_local2 + ":") + _local1);
  • }
  • function showSeek(ir, r) {
  • if (isnan(r)) {
  • r = 0;
  • }
  • if (r < ir) {
  • r = ir;
  • }
  • seek_time.text = format_minute_time(movie.getCurrentTime());
  • seek_total_time.text = format_minute_time(movie.getTotalTime());
  • seekBar._x = (ir * fullBar._width) + fullBar._x;
  • seekBar._width = math.max(r - ir, 0) * fullBar._width;
  • seekBar_l._x = seekBar._x;
  • seekBar_r._x = seekBar._width + seekBar._x;
  • if (!slider_down) {
  • slider._x = (r * full_progress_bar._width) + full_progress_bar._x;
  • }
  • }
  • function showProgress(ir, r) {
  • if (r < ir) {
  • r = ir;
  • }
  • progressBar._x = (ir * fullBar._width) + fullBar._x;
  • if ((!isnan(r)) && (r <= 1)) {
  • progressBar._width = (r - ir) * fullBar._width;
  • } else {
  • progressBar._width = 0;
  • }
  • progressBar_l._x = progressBar._x;
  • progressBar_r._x = progressBar._width + progressBar._x;
  • }
  • function showFSButtons(_show) {
  • var o = this;
  • if (_show) {
  • permShow(min);
  • permHide(max);
  • permHide(regular);
  • permHide(small);
  • } else {
  • permHide(min);
  • permShow(max);
  • permHide(regular);
  • permShow(small);
  • regular.onpress = function () {
  • o.movie.resizeNormal();
  • o.permHide(o.regular);
  • o.permShow(o.small);
  • };
  • small.onrelease = function () {
  • o.movie.resizeOriginal();
  • o.permShow(o.regular);
  • o.permHide(o.small);
  • };
  • }
  • }
  • function permShow(clip) {
  • clip._visible = true;
  • clip._perm_visible = true;
  • }
  • function permHide(clip) {
  • clip._visible = false;
  • clip._perm_visible = false;
  • }
  • function makeVisible(clip) {
  • if (clip._perm_visible != undefined) {
  • clip._visible = clip._perm_visible;
  • } else {
  • clip._visible = true;
  • }
  • }
  • var slider_down = false;
  • static var MIN_PROGRESS_BAR_SIZE = 100;
  • }
  • 
  • //----------------------------------------------------------------------
  • //Symbol 99 MovieClip Frame 1
  • //----------------------------------------------------------------------
  • setStars = function (v) {
  • this.value = v;
  • bg._xscale = (v * 100) / 5;
  • };
  •  
  • 
  • //----------------------------------------------------------------------
  • //Frame 1
  • //----------------------------------------------------------------------
  • movie = player.movie;
  • movie.base_url = "/";
  • player._alpha = 0;
  • player.init();
  • movie.tracker_cls = logic.PlayerTracker;
  • movie.setMovie(video_id, iurl, undefined, l, t, undefined, ap, fmt_map, vq);
  • movie.setInitSeek(init_s);
  • if (_root.infringe) {
  • movie.setInfringeMute();
  • movie.Mute();
  • }
  • if (!iurl) {
  • movie.playMovie();
  • }
  • var show_fs = _root.fs;
  • player.controller.showFSButtons(show_fs);
  • max = player.controller.max;
  • min = player.controller.min;
  • if (show_fs || (_root.rs)) {
  • onenterframe = function () {
  • onresize();
  • delete this.onenterframe;
  • };
  • }
  • min.onrelease = function () {
  • if (stage.displayState != undefined) {
  • if (stage.displayState == "fullScreen") {
  • stage.displayState = "normal";
  • } else {
  • stage.displayState = "fullScreen";
  • }
  • } else {
  • geturl ("javascript:closeFull()");
  • }
  • };
  • max.onrelease = function () {
  • if (stage.displayState != undefined) {
  • if (stage.displayState == "fullScreen") {
  • stage.displayState = "normal";
  • } else {
  • stage.displayState = "fullScreen";
  • }
  • } else {
  • geturl ("javascript:openFull()");
  • movie.stopAll();
  • }
  • };
  • if (_root.sn) {
  • movie.supress_next = true;
  • }
  •  
  • 
  • //----------------------------------------------------------------------
  • //Symbol 160 MovieClip [MoviePlayer] Frame 1
  • //----------------------------------------------------------------------
  • #initclip 30
  • object.registerclass("MoviePlayer", logic.PlayerController);
  • #endinitclip
  •  
  •  
  • 
  • //----------------------------------------------------------------------
  • //Symbol 4 MovieClip [spinner] Frame 22
  • //----------------------------------------------------------------------
  • stop();
  •  
  • 
  • //----------------------------------------------------------------------
  • //Symbol 163 MovieClip [__Packages.logic.UrlConstructor] Frame 0
  • //----------------------------------------------------------------------
  • class logic.UrlConstructor
  • {
  • var baseUrl_, hasParameter_;
  • function UrlConstructor (baseUrl) {
  • baseUrl_ = baseUrl;
  • hasParameter_ = true;
  • if (baseUrl_.indexof("?") < 0) {
  • hasParameter_ = false;
  • baseUrl_ = baseUrl_ + "?";
  • }
  • }
  • function addGlobalParameters(args) {
  • baseUrl_ = makeUrl(args);
  • hasParameter_ = true;
  • }
  • function get url() {
  • return(baseUrl_);
  • }
  • function makeUrl(args) {
  • var _local2 = baseUrl_;
  • var _local3 = hasParameter_;
  • for (var _local5 in args) {
  • if (_local3) {
  • _local2 = _local2 + "&";
  • }
  • _local2 = _local2 + ((_local5 + "=") + args[_local5]);
  • _local3 = true;
  • }
  • return(_local2);
  • }
  • }
  • 
  • //----------------------------------------------------------------------
  • //Symbol 167 MovieClip [__Packages.logic.urlRestXML] Frame 0
  • //----------------------------------------------------------------------
  • class logic.urlRestXML extends logic.restXML
  • {
  • function urlRestXML (r) {
  • super(r);
  • }
  • function get_call_string(method) {
  • return(method);
  • }
  • }
  • 
  • //----------------------------------------------------------------------
  • //Symbol 175 MovieClip [__Packages.com.google.chianti.event.EventDelegate] Frame 0
  • //----------------------------------------------------------------------
  • class com.google.chianti.event.EventDelegate extends object
  • {
  • function EventDelegate () {
  • super();
  • }
  • static function create(scope, handler, data) {
  • var _local2 = function () {
  • arguments.push(data);
  • return(handler.apply(scope, arguments));
  • };
  • _local2.scope = scope;
  • return(_local2);
  • }
  • }
  • 
  • //----------------------------------------------------------------------
  • //Symbol 174 MovieClip [__Packages.com.google.youtube.debug.LogWindowScrollbar] Frame 0
  • //----------------------------------------------------------------------
  • class com.google.youtube.debug.LogWindowScrollbar extends movieclip
  • {
  • var tf, _parent, scrollTop, track, scrollBottom, handle, scrollTravel, trackhit, mscroll;
  • function LogWindowScrollbar () {
  • super();
  • tf = _parent.output_txt;
  • }
  • function onload() {
  • build();
  • }
  • function build() {
  • scrollTop = track._y;
  • scrollBottom = (track._y + track._height) - handle._height;
  • scrollTravel = scrollBottom - scrollTop;
  • var _self = this;
  • handle.onpress = function () {
  • this.startdrag(false, this._x, _self.scrollTop, this._x, _self.scrollBottom);
  • _self.mscroll = _self.tf.maxscroll;
  • this.onenterframe = com.google.chianti.event.EventDelegate.create(_self, _self.onScroll);
  • };
  • var _local2 = function () {
  • this.stopdrag();
  • this.onenterframe = null;
  • com.google.youtube.debug.Debug.updateOutput();
  • };
  • handle.onrelease = (handle.onreleaseoutside = _local2);
  • trackhit.onrelease = com.google.chianti.event.EventDelegate.create(this, onTrackClick);
  • trackhit.usehandcursor = false;
  • tf.scroll = tf.maxscroll;
  • }
  • function onTrackClick() {
  • var _local2 = track._y + track._height;
  • handle._y = track._ymouse - (handle._height / 2);
  • if (handle._y > (_local2 - handle._height)) {
  • handle._y = _local2 - handle._height;
  • }
  • mscroll = tf.maxscroll;
  • onScroll();
  • }
  • function onScroll() {
  • var _local2 = math.ceil(((handle._y - scrollTop) / scrollTravel) * 100);
  • tf.scroll = math.ceil(((mscroll - 1) / 100) * _local2) + 1;
  • }
  • function get isScrolledDown() {
  • if (handle._y == ((track._y + track._height) - handle._height)) {
  • return(true);
  • }
  • return(false);
  • }
  • static var LINK_NAME = "LogWindowScrollbar";
  • static var FORCE_LINK = object.registerclass(LINK_NAME, com.google.youtube.debug.LogWindowScrollbar);
  • }
  • 
  • //----------------------------------------------------------------------
  • //Symbol 176 MovieClip [__Packages.logic.progressCircle] Frame 0
  • //----------------------------------------------------------------------
  • class logic.progressCircle extends movieclip
  • {
  • var radius, paused, clear, bg, beginfill, linestyle, moveto, lineto, curveto, endfill, value, notifier, onenterframe;
  • function progressCircle () {
  • super();
  • radius = 11;
  • paused = false;
  • }
  • function genCurvePoints(r, d, delta) {
  • var _local6 = math.sin(d) * r;
  • var _local5 = (-1 * math.cos(d)) * r;
  • var _local2 = math.tan(d);
  • var _local12 = math.sin(d - delta) * r;
  • var _local11 = (-1 * math.cos(d - delta)) * r;
  • var _local3 = math.tan(d - delta);
  • var _local4;
  • var _local10;
  • var _local9 = _local11 - (_local3 * _local12);
  • var _local8 = _local5 - (_local2 * _local6);
  • _local4 = (_local8 - _local9) / (_local3 - _local2);
  • if (math.abs(_local3) < math.abs(_local2)) {
  • _local10 = _local9 + (_local3 * _local4);
  • } else {
  • _local10 = _local8 + (_local2 * _local4);
  • }
  • return([_local4, _local10, _local6, _local5]);
  • }
  • function drawCircle(r, v) {
  • var _local4 = 1 - v;
  • clear();
  • if (bg) {
  • beginfill(16777215, 40);
  • }
  • linestyle(0, 0, 0);
  • moveto(0, 0);
  • lineto(r * math.sin((_local4 * math.pi) * 2), (-r) * math.cos((_local4 * math.pi) * 2));
  • linestyle(2, 13421772, 100);
  • var _local2 = 0;
  • while (_local2 < 8) {
  • if (((_local2 + 1) * 0.125) > _local4) {
  • var _local3;
  • if ((_local2 * 0.125) > _local4) {
  • _local3 = genCurvePoints(r, (math.pi * (_local2 + 1)) / 4, (math.pi/4));
  • } else {
  • _local3 = genCurvePoints(r, (math.pi * (_local2 + 1)) / 4, math.pi * (((_local2 + 1) / 4) - (2 * _local4)));
  • }
  • curveto(_local3[0], _local3[1], _local3[2], _local3[3]);
  • }
  • _local2++;
  • }
  • linestyle(0, 0, 0);
  • lineto(0, 0);
  • if (bg) {
  • endfill();
  • }
  • }
  • function display_value(v) {
  • value = v;
  • drawCircle(radius, v);
  • }
  • function start_count_down(v, count_down_notifier) {
  • notifier = count_down_notifier;
  • display_value(v);
  • onenterframe = count_down;
  • }
  • function is_counting() {
  • return(onenterframe != undefined);
  • }
  • function end_count() {
  • display_value(0);
  • }
  • function count_down() {
  • if (paused) {
  • return(undefined);
  • }
  • if (value != undefined) {
  • if (value <= 0) {
  • notifier.count_down_end();
  • delete value;
  • delete onenterframe;
  • } else {
  • display_value(value - 0.005);
  • }
  • }
  • }
  • function reset() {
  • display_value(0);
  • delete onenterframe;
  • }
  • function pause() {
  • paused = true;
  • }
  • function unpause() {
  • paused = false;
  • }
  • function onrollover() {
  • bg = true;
  • }
  • function onrollout() {
  • bg = false;
  • }
  • function onrelease() {
  • end_count();
  • }
  • }
  • 
  • //----------------------------------------------------------------------
  • //Symbol 169 MovieClip [__Packages.logic.Util] Frame 0
  • //----------------------------------------------------------------------
  • class logic.Util
  • {
  • function Util () {
  • }
  • static function alert(msg) {
  • geturl (("javascript:alert('" + escape(msg)) + "');");
  • }
  • static function createOverlay(clip, suffix) {
  • var _local2 = clip._parent[(clip._name + "_") + suffix];
  • if (!_local2) {
  • _local2 = clip._parent.createemptymovieclip((clip._name + "_") + suffix, clip._parent.getnexthighestdepth());
  • }
  • return(_local2);
  • }
  • static function calc_accl(x1, x2, t, v0) {
  • return(((x2 - x1) - (v0 * t)) / (t * t));
  • }
  • static function calc_dist(x1, t, a, v0) {
  • return((((a * t) * t) + (v0 * t)) + x1);
  • }
  • static function tween_to(clip, x, y, w, h, frames, notifier) {
  • var _local2 = createOverlay(clip, "tweener");
  • _local2.ax = calc_accl(clip._x, x, frames, 0);
  • _local2.ay = calc_accl(clip._y, y, frames, 0);
  • _local2.aw = calc_accl(clip._width, w, frames, 0);
  • _local2.ah = calc_accl(clip._height, h, frames, 0);
  • _local2.ox = clip._x;
  • _local2.oy = clip._y;
  • _local2.dx = x;
  • _local2.dy = y;
  • _local2.ow = clip._width;
  • _local2.oh = clip._height;
  • _local2.dw = w;
  • _local2.dh = h;
  • _local2.clip = clip;
  • _local2.frame_count = 0;
  • _local2.max_frames = frames;
  • _local2.notifier = notifier;
  • _local2.onenterframe = function () {
  • this.frame_count++;
  • if (this.frame_count < this.max_frames) {
  • clip._x = logic.Util.calc_dist(this.ox, this.frame_count, this.ax, 0);
  • clip._y = logic.Util.calc_dist(this.oy, this.frame_count, this.ay, 0);
  • var _local3 = logic.Util.calc_dist(this.ow, this.frame_count, this.aw, 0);
  • var _local2 = logic.Util.calc_dist(this.oh, this.frame_count, this.ah, 0);
  • if (clip.resize) {
  • clip.resize(_local3, _local2);
  • } else {
  • clip._width = _local3;
  • clip._height = _local2;
  • }
  • } else {
  • clip._x = this.dx;
  • clip._y = this.dy;
  • if (clip.resize) {
  • clip.resize(this.dw, this.dh);
  • } else {
  • clip._width = this.dw;
  • clip._height = this.dh;
  • }
  • delete this.onenterframe;
  • if (this.notifier) {
  • this.notifier.onTweenComplete();
  • }
  • }
  • };
  • }
  • static function fade_in(_c, frames) {
  • var clip = _c;
  • var _local2 = createOverlay(clip, "fader");
  • clip._visible = true;
  • var increment = ((100 - clip._alpha) / frames);
  • _local2.onenterframe = function () {
  • clip._alpha = clip._alpha + increment;
  • if (clip._alpha >= 100) {
  • clip._alpha = 100;
  • delete this.onenterframe;
  • }
  • };
  • }
  • static function fade_out(_c, frames) {
  • var clip = _c;
  • var _local2 = createOverlay(clip, "fader");
  • var decrement = (clip._alpha / frames);
  • _local2.onenterframe = function () {
  • clip._alpha = clip._alpha - decrement;
  • if (clip._alpha <= 0) {
  • clip._alpha = 0;
  • clip._visible = false;
  • delete this.onenterframe;
  • }
  • };
  • }
  • static function createClickableOverlay(field) {
  • var _local1 = createOverlay(field, "overlay");
  • _local1._x = field._x;
  • _local1._y = field._y;
  • var _local3 = field._width;
  • var _local4 = field._height;
  • if (field.textwidth && (field.textwidth < field._width)) {
  • _local3 = field.textwidth;
  • }
  • _local1.clear();
  • _local1.beginfill(0, 0);
  • _local1.moveto(0, 0);
  • _local1.lineto(_local3, 0);
  • _local1.lineto(_local3, _local4);
  • _local1.lineto(0, _local4);
  • _local1.lineto(0, 0);
  • _local1.endfill();
  • return(_local1);
  • }
  • static function getDist(x1, y1, x2, y2) {
  • return(math.sqrt(((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1))));
  • }
  • static function call_js(func) {
  • var _local6 = _global.flash.external.ExternalInterface;
  • if (_local6.available) {
  • var _local5 = [func];
  • var _local3 = 1;
  • while (_local3 < arguments.length) {
  • _local5.push(arguments[_local3]);
  • _local3++;
  • }
  • _local6.call.apply(null, _local5);
  • } else {
  • var _local5 = "";
  • var _local3 = 1;
  • while (_local3 < arguments.length) {
  • var _local4 = ("'" + escape(arguments[_local3])) + "'";
  • if (_local5.length) {
  • _local5 = _local5 + ("," + _local4);
  • } else {
  • _local5 = _local5 + _local4;
  • }
  • _local3++;
  • }
  • geturl (((("javascript:" + func) + "(") + _local5) + ");");
  • }
  • }
  • static function popUpWin(url, winName, w, h, toolbar, location, directories, status, menubar, scrollbars, resizable) {
  • geturl ((((((((((((((((((((((((((((((((("javascript:var " + winName) + ";if (!") + winName) + "||") + winName) + ".closed){") + winName) + "=window.open('") + url) + "', '") + winName) + "', '") + "width=") + w) + ", height=") + h) + ", toolbar=") + toolbar) + ", location=") + location) + ", directories=") + directories) + ", status=") + status) + ", menubar=") + menubar) + ", scrollbars=") + scrollbars) + ", resizable=") + resizable) + "')}else{") + winName) + ".focus();};void(0);");
  • }
  • static function format_minute_time(t) {
  • if (t == undefined) {
  • return("0:00");
  • }
  • var _local1 = string(math.floor(t % 60));
  • if (_local1.length == 1) {
  • _local1 = "0" + _local1;
  • }
  • var _local2 = string(math.floor(t / 60));
  • if (_local2.length == 1) {
  • _local2 = "0" + _local2;
  • }
  • return((_local2 + ":") + _local1);
  • }
  • static function showShare(base_url, video_id) {
  • call_js("shareVideoFromFlash");
  • }
  • static function popUpShare(base_url, video_id) {
  • geturl (((base_url + "share?v=") + video_id) + "&embed=1", "_blank");
  • }
  • static function popUpSharePlayList(base_url, pl_id) {
  • geturl (((base_url + "share?p=") + pl_id) + "&embed=1", "_blank");
  • }
  • static function inYTDomain(url, allow_paths) {
  • var _local6 = "http://";
  • if (url.indexof(_local6) == 0) {
  • var _local8 = url.indexof("/", _local6.length);
  • var _local2 = url.slice(_local6.length, _local8);
  • var _local3 = url.slice(_local8 + 1).split("?", 1)[0];
  • if (((_local2.indexof("?") > -1) || (_local2.indexof("%") > -1)) || (_local2.indexof("#") > -1)) {
  • return(false);
  • }
  • var _local4 = false;
  • if (_local2.tolowercase() == "youtube.com") {
  • _local4 = true;
  • }
  • if (_local2.substring(_local2.length - 12, _local2.length).tolowercase() == ".youtube.com") {
  • _local4 = true;
  • } else if (_local2.substring(_local2.length - 17, _local2.length).tolowercase() == ".youtube.com:8000") {
  • _local4 = true;
  • }
  • if (_local2.tolowercase() == "ytimg.com") {
  • _local4 = true;
  • }
  • if (_local2.substring(_local2.length - 10, _local2.length).tolowercase() == ".ytimg.com") {
  • _local4 = true;
  • }
  • if (!_local4) {
  • return(false);
  • }
  • if (!allow_paths) {
  • return(_local3.length == 0);
  • }
  • for (var _local5 in allow_paths) {
  • if ((allow_paths[_local5] == _local3) || ((allow_paths[_local5].charat(allow_paths[_local5].length - 1) == "/") && (_local3.indexof(allow_paths[_local5]) == 0))) {
  • return(true);
  • }
  • }
  • }
  • return(false);
  • }
  • static function loadImgClip(clip, img_url, notifier, _b) {
  • var _local2 = new object();
  • var b = _b;
  • if (!b) {
  • b = clip.getbounds(clip._parent);
  • }
  • var n = notifier;
  • var _local3 = function (target_mc, error) {
  • target_mc._x = b.xMin;
  • target_mc._y = b.yMin;
  • target_mc._width = b.xMax - b.xMin;
  • target_mc._height = b.yMax - b.yMin;
  • if (n) {
  • n.onClipLoaded(target_mc, error);
  • }
  • this.cl.removelistener(this);
  • };
  • _local2.onloadinit = _local3;
  • _local2.onloaderror = _local3;
  • var cl = new moviecliploader();
  • _local2.cl = cl;
  • cl.addlistener(_local2);
  • cl.loadclip(img_url, clip);
  • }
  • static function loadSafeImgClipAndFade(clip, img_url, notifier, _b) {
  • var _local3 = new object();
  • var b = _b;
  • if (!b) {
  • b = clip.getbounds(clip._parent);
  • }
  • var n = notifier;
  • var _local4 = function (target_mc, error) {
  • target_mc._x = b.xMin;
  • target_mc._y = b.yMin;
  • target_mc._width = b.xMax - b.xMin;
  • target_mc._height = b.yMax - b.yMin;
  • target_mc._iurl = this.img_url;
  • if (n) {
  • n.onClipLoaded(target_mc, error);
  • }
  • target_mc._visible = true;
  • target_mc._alpha = 0;
  • target_mc.onenterframe = function () {
  • target_mc._alpha = target_mc._alpha + 20;
  • if (target_mc._alpha >= 100) {
  • delete this.onenterframe;
  • target_mc._alpha = 100;
  • }
  • };
  • this.cl.removelistener(this);
  • };
  • _local3.onloadinit = _local4;
  • _local3.onloaderror = _local4;
  • _local3.img_url = img_url;
  • if (clip._iurl) {
  • if (clip._iurl == img_url) {
  • clip._visible = true;
  • return(undefined);
  • }
  • clip = clip._parent.createemptymovieclip(clip._name, clip.getdepth());
  • }
  • clip._iurl = img_url;
  • var cl = new moviecliploader();
  • _local3.cl = cl;
  • cl.addlistener(_local3);
  • cl.loadclip(img_url, clip);
  • }
  • static function loadFlash(clip, img_url, notifier) {
  • var _local2 = new object();
  • var n = notifier;
  • var _local3 = function (target_mc, error) {
  • if (n) {
  • n.onClipLoaded(target_mc, error);
  • }
  • this.cl.removelistener(this);
  • };
  • _local2.onloadinit = _local3;
  • _local2.onloaderror = _local3;
  • var cl = new moviecliploader();
  • _local2.cl = cl;
  • cl.addlistener(_local2);
  • cl.loadclip(img_url, clip);
  • }
  • }
  • 
  • //----------------------------------------------------------------------
  • //Symbol 101 MovieClip [overlay_screen] Frame 1
  • //----------------------------------------------------------------------
  • #initclip 24
  • object.registerclass("overlay_screen", logic.Overlay);
  • #endinitclip
  •  
  • 
  • //----------------------------------------------------------------------
  • //Symbol 161 MovieClip [__Packages.logic.PlayerTracker] Frame 0
  • //----------------------------------------------------------------------
  • class logic.PlayerTracker
  • {
  • var movie, track_point, track_tk, google_tracker;
  • function PlayerTracker (_m) {
  • movie = _m;
  • track_point = 0;
  • track_tk = _root.tk;
  • google_tracker = new logic.VideoStats("http://video-stats.video.google.com/s", "yt", _root.plid, "detailpage", undefined, _root.sourceid, _root.sdetail, _root.q, _root.sk, _root.e);
  • var o = _m;
  • google_tracker.getMediaTime = function () {
  • return(o.gettime());
  • };
  • google_tracker.getMediaDuration = function () {
  • return(o.getTotalTime());
  • };
  • google_tracker.getBytesDownloaded = function () {
  • var _local1 = o.ns.bytesloaded;
  • if (isnan(_local1)) {
  • return(0);
  • }
  • return(_local1);
  • };
  • google_tracker.getBufferEmptyEvents = function () {
  • return(o.bufferEmptyCount);
  • };
  • google_tracker.getVideoDownloadRetries = function () {
  • return(o.videoDownloadRetries);
  • };
  • google_tracker.getPlayerState = function () {
  • if ((stage.displayState == "fullScreen") || (_root.fs)) {
  • return({fs:1});
  • }
  • return(undefined);
  • };
  • }
  • function doSetTrack(time, percentage) {
  • }
  • function doTrack(time, percentage) {
  • if (movie.getTotalTime() && (!google_tracker.__get__playbackStarted())) {
  • google_tracker.startPlayback(movie.video_id, movie.format, _root.sw);
  • }
  • if ((isnan(percentage) || (!track_tk)) || (!movie.isPlaying())) {
  • return(undefined);
  • }
  • if ((track_point < 1) && (time >= 0)) {
  • sendTrack(time, percentage);
  • track_point = 1;
  • } else if ((track_point < 2) && (time >= 20)) {
  • sendTrack(time, percentage);
  • track_point = 2;
  • } else if ((track_point < 3) && (time >= 30)) {
  • sendTrack(time, percentage);
  • track_point = 3;
  • } else if ((track_point < 4) && (percentage >= 0.9)) {
  • sendTrack(time, percentage);
  • track_point = 4;
  • }
  • }
  • function doEndMovieTrack() {
  • var _local2 = movie.getSeekRatio();
  • var _local3 = movie.gettime();
  • google_tracker.sendReport();
  • }
  • function endTrack() {
  • google_tracker.endPlayback();
  • }
  • function sendTrack(time, percentage) {
  • var _local2 = new logic.urlRestXML(movie.base_url);
  • _local2.dispatch(this, undefined, undefined, "tracker", {w:1, tp:math.floor(time), p:math.round(percentage * 100), i:track_tk});
  • google_tracker.sendWatchPoint();
  • }
  • }
  • 
  • //----------------------------------------------------------------------
  • //Symbol 172 MovieClip [__Packages.com.google.youtube.debug.Debug] Frame 0
  • //----------------------------------------------------------------------
  • class com.google.youtube.debug.Debug
  • {
  • static var _log, _url, window, instance, debugMenu;
  • var isLocal, mc, _useLocalConnection, outgoingLocalConnection;
  • function Debug () {
  • _log = new array();
  • isLocal = (_url.indexof("http://") == -1) || (_url == undefined);
  • }
  • function build(mc) {
  • this.mc = mc;
  • window = com.google.youtube.debug.LogWindow(mc.attachmovie("LogWindow", "LogWindow_mc", mc.getnexthighestdepth()));
  • window._visible = false;
  • window.mc = mc;
  • }
  • function init(mc, useLocalConnection) {
  • initCalled = true;
  • _useLocalConnection = useLocalConnection;
  • if (_useLocalConnection) {
  • outgoingLocalConnection = new localconnection();
  • } else {
  • key.addlistener(this);
  • build(mc);
  • }
  • }
  • static function getInstance() {
  • if (instance == undefined) {
  • instance = new com.google.youtube.debug.Debug();
  • }
  • return(instance);
  • }
  • static function debugTrace(level, msg, classNameAndMethod, fileName, lineNumber) {
  • var _local1;
  • switch (level) {
  • case INFO :
  • _local1 = 2;
  • break;
  • case WARNING :
  • _local1 = 1;
  • break;
  • case SEVERE :
  • _local1 = 0;
  • break;
  • default :
  • _local1 = 3;
  • }
  • if (LOG_LEVEL > _local1) {
  • getInstance().log(level, msg, classNameAndMethod, fileName, lineNumber);
  • }
  • }
  • function onkeydown() {
  • if ((key.isdown(17) && (key.isdown(68))) && (key.isdown(16))) {
  • window.toggleWindow();
  • }
  • }
  • function enableMenuItems() {
  • debugMenu = new contextmenu();
  • debugMenu.customitems.push(new contextmenuitem("Log Level: Off", setLevelOff));
  • debugMenu.customitems.push(new contextmenuitem("Log Level: Info", setLevelInfo));
  • debugMenu.customitems.push(new contextmenuitem("Log Level: Warning", setLevelWarning));
  • debugMenu.customitems.push(new contextmenuitem("Log Level: Severe", setLevelSevere));
  • debugMenu.customitems.push(new contextmenuitem("Clear Log", clearLog));
  • _root.menu = debugMenu;
  • }
  • function disableMenuItems() {
  • debugMenu.customitems[0].visible = false;
  • debugMenu.customitems[1].visible = false;
  • debugMenu.customitems[2].visible = false;
  • debugMenu.customitems[3].visible = false;
  • debugMenu.customitems[4].visible = false;
  • _root.menu = debugMenu;
  • }
  • function clearLog() {
  • _log = [];
  • updateOutput();
  • }
  • function setLevelOff() {
  • LOG_LEVEL = 0;
  • }
  • function setLevelInfo() {
  • LOG_LEVEL = 3;
  • }
  • function setLevelWarning() {
  • LOG_LEVEL = 2;
  • }
  • function setLevelSevere() {
  • LOG_LEVEL = 1;
  • }
  • static function info(msg, classNameAndMethod) {
  • getInstance().log(INFO, msg, classNameAndMethod);
  • }
  • static function warning(msg, classNameAndMethod) {
  • getInstance().log(WARNING, msg, classNameAndMethod);
  • }
  • static function severe(msg, classNameAndMethod) {
  • getInstance().log(SEVERE, msg, classNameAndMethod);
  • }
  • function log(level, msg, classNameAndMethod, fileName, lineNumber) {
  • if (!initCalled) {
  • init(undefined, true);
  • }
  • if (_useLocalConnection) {
  • outgoingLocalConnection.send("_superSecretYouTubeDebugConnection", "receive", level, msg, classNameAndMethod + "::", "/", "");
  • } else {
  • var _local4 = classNameAndMethod.split(":");
  • var _local7 = _local4[0];
  • var _local11 = _local4[2];
  • var _local3 = _local7.split(".");
  • var _local5 = _local3[_local3.length - 1];
  • var _local10 = ((((("[<font color='#FFFFCC'>" + _local5) + "::") + (_local11 || "")) + ":") + (lineNumber || "")) + "</font>]";
  • var _local2;
  • var _local16;
  • switch (level) {
  • case "info" :
  • _local2 = INFO_COLOR;
  • break;
  • case "warn" :
  • _local2 = WARN_COLOR;
  • break;
  • case "severe" :
  • _local2 = SEVERE_COLOR;
  • break;
  • default :
  • _local2 = DEFAULT_COLOR;
  • }
  • var _local9 = ((("[<font color='" + _local2) + "'>") + level) + "</font>]";
  • _log.push((_local9 + _local10) + msg);
  • var _local12 = _log.length;
  • var _local6 = _log.length - LOG_BUFFER;
  • if ((_local6 > 0) && (window.scrollbar.__get__isScrolledDown())) {
  • _log = _log.slice(_log.length - LOG_BUFFER);
  • }
  • if (window._visible && (window.scrollbar.__get__isScrolledDown())) {
  • updateOutput();
  • }
  • }
  • }
  • static function updateOutput() {
  • window.setOutput((_log.join("<br>") + "<br>log len: ") + _log.length);
  • }
  • static function toggleWindow() {
  • window.toggleWindow();
  • }
  • static function expandObject(o) {
  • var _local2 = "Expanding Object: \n";
  • for (var _local3 in o) {
  • _local2 = _local2 + (((_local3 + " = ") + o[_local3]) + newline);
  • }
  • return(_local2);
  • }
  • static function recursivePrint(name, obj, level) {
  • if (level == undefined) {
  • level = 0;
  • }
  • for (var _local3 in obj) {
  • recursivePrint(_local3, obj[_local3], level + 1);
  • }
  • }
  • static var INFO = "info";
  • static var WARNING = "warning";
  • static var SEVERE = "severe";
  • static var className = "com.google.youtube.debug.Debug";
  • static var LOG_LEVEL = 3;
  • static var LOG_BUFFER = 100;
  • var initCalled = false;
  • var INFO_COLOR = "#00aa00";
  • var WARN_COLOR = "#cc6600";
  • var SEVERE_COLOR = "#ff0000";
  • var DEFAULT_COLOR = "#000000";
  • }
  • 
  • //----------------------------------------------------------------------
  • //Symbol 66 MovieClip Frame 1
  • //----------------------------------------------------------------------
  • stop();
  • normal = function () {
  • gotoandstop (1);
  • };
  • highLight = function () {
  • gotoandstop (2);
  • };
  •  
  • 
  • //----------------------------------------------------------------------
  • //Symbol 177 MovieClip [__Packages.logic.EndScreen] Frame 0
  • //----------------------------------------------------------------------
  • class logic.EndScreen extends movieclip
  • {
  • var movie, _parent, end_buttons, share, replay, prev_button, next_panel, count_down, next_visible, _visible, bg, awsome_data, awsome_videos, attachmovie, next_index;
  • function EndScreen () {
  • super();
  • movie = _parent;
  • if (end_buttons.shareButton) {
  • share = end_buttons.shareButton;
  • } else {
  • share = end_buttons.share;
  • }
  • if (end_buttons.replayButton) {
  • replay = end_buttons.replayButton;
  • } else {
  • replay = end_buttons.replay;
  • }
  • var o = this;
  • replay.onrelease = function () {
  • this.gotoandstop(2);
  • if (o.movie.rePlay) {
  • o.movie.rePlay();
  • } else {
  • o.movie.playMovie();
  • }
  • };
  • share.onrelease = function () {
  • o.movie.share();
  • this.gotoandstop(2);
  • };
  • prev_button.onrelease = function () {
  • o.load_previous_panels();
  • };
  • share.stop();
  • replay.stop();
  • share.onrollover = (replay.onrollover = function () {
  • this.gotoandstop(2);
  • });
  • share.onrollout = (share.onreleaseoutside = (replay.onrollout = (replay.onreleaseoutside = function () {
  • this.gotoandstop(1);
  • })));
  • init();
  • }
  • function resetText(strings) {
  • if (strings) {
  • replay.replayText.watchagain_txt.text = strings.WatchAgain;
  • share.shareText.share_txt.text = strings.Share;
  • next_panel.views_txt.text = strings.Views;
  • next_panel.from_txt.text = strings.From;
  • }
  • }
  • function init() {
  • end_buttons._visible = true;
  • next_panel._visible = false;
  • count_down._visible = false;
  • prev_button._visible = false;
  • next_visible = false;
  • }
  • function show() {
  • if (!_visible) {
  • _visible = true;
  • init();
  • display_next();
  • resetText(_root.strings);
  • }
  • }
  • function hide() {
  • _visible = false;
  • count_down.reset();
  • }
  • function resize(w, h) {
  • bg._width = w;
  • bg._height = h;
  • end_buttons._width = w - 20;
  • if (end_buttons._xscale > 100) {
  • end_buttons._xscale = 100;
  • }
  • end_buttons._yscale = end_buttons._xscale;
  • layout_next();
  • }
  • function load_for_awsome() {
  • var _local2 = new logic.urlRestXML(movie.base_url);
  • next_visible = false;
  • _local2.dispatch(this, parse_next, undefined, "set_awesome", {video_id:movie.video_id, w:movie.getSeekRatio(), l:movie.getTotalTime(), t:movie.track_id, m:""});
  • }
  • function show_next() {
  • next_visible = true;
  • _visible = true;
  • end_buttons._visible = false;
  • var _local3 = new logic.urlRestXML(movie.base_url);
  • _local3.dispatch(this, parse_next, undefined, "next_awesome", {video_id:movie.video_id, w:movie.getSeekRatio(), l:movie.getTotalTime(), t:movie.track_id, nc:_root.nc});
  • }
  • function parse_next(data) {
  • awsome_data = data;
  • if (_visible) {
  • display_next();
  • }
  • }
  • function parse_data() {
  • if (awsome_data) {
  • var _local4 = logic.restXML.get_sub_array("video", awsome_data.video_list);
  • awsome_videos = [];
  • var _local3 = 0;
  • while (_local3 < _local4.length) {
  • awsome_videos.push(logic.restXML.get_dict(_local4[_local3]));
  • _local3++;
  • }
  • awsome_data = undefined;
  • _root.status.text = "Data parsed :" + awsome_videos.length;
  • }
  • }
  • function display_next() {
  • if (!movie.supress_next) {
  • if (next_visible) {
  • end_buttons._visible = false;
  • }
  • if (awsome_data) {
  • parse_data();
  • }
  • layout_next();
  • }
  • }
  • function layout_next() {
  • if (!next_panel) {
  • return(undefined);
  • }
  • var _local7 = bg.getbounds(this);
  • var _local10 = _local7.yMin;
  • var _local9 = _local7.yMax - _local7.yMin;
  • var _local8 = 0;
  • if (end_buttons._visible == true) {
  • _local8 = end_buttons._height + (2 * margin);
  • }
  • var _local5 = math.max(0, math.min(int((_local9 - _local8) / (next_panel._height + margin)), 4));
  • var _local6 = _local7.yMin + ((_local9 - ((_local8 + (next_panel._height * _local5)) + (margin * math.max(_local5 - 1, 0)))) / 2);
  • if (end_buttons._visible == true) {
  • end_buttons._y = _local6 + (end_buttons._height / 2);
  • _local6 = _local6 + (end_buttons._height + (2 * margin));
  • }
  • panels = [];
  • var _local3 = 0;
  • while (_local3 < _local5) {
  • var _local2;
  • if (_local3 == 0) {
  • _local2 = next_panel;
  • } else {
  • _local2 = attachmovie("NextVideoPanel", "next_panel" + _local3, _local3);
  • }
  • _local2._x = next_panel._x;
  • _local2._y = _local6 + (_local2._height / 2);
  • _local6 = _local6 + (_local2._height + margin);
  • _local2.load(get_next());
  • panels.push(_local2);
  • _local3++;
  • }
  • var _local4 = _local5;
  • while (_local4 < last_panels) {
  • if (_local4 != 0) {
  • this["next_panel" + _local4].removemovieclip();
  • }
  • _local4++;
  • }
  • last_panels = _local5;
  • resize_next_prev_buttons(_local7);
  • count_down.reset();
  • count_down._visible = false;
  • prev_button._visible = false;
  • }
  • function resize_next_prev_buttons(bounds) {
  • count_down._x = bounds.xMax - ((margin / 2) + (count_down._width / 2));
  • count_down._y = bounds.yMax - ((margin / 2) + (count_down._height / 2));
  • prev_button._x = (bounds.xMin + (margin / 2)) + (prev_button._width / 2);
  • prev_button._y = bounds.yMax - ((margin / 2) + (prev_button._height / 2));
  • }
  • function get_next() {
  • if (isnan(next_index)) {
  • next_index = 0;
  • } else {
  • next_index = (next_index + 1) % awsome_videos.length;
  • }
  • return(awsome_videos[next_index]);
  • }
  • function clip_loaded() {
  • var _local2 = 0;
  • while (_local2 < panels.length) {
  • if (!panels[_local2].loaded) {
  • return(undefined);
  • }
  • _local2++;
  • }
  • count_down._visible = true;
  • prev_button._visible = true;
  • count_down.start_count_down(1, this);
  • }
  • function count_down_end() {
  • var _local2 = 0;
  • while (_local2 < panels.length) {
  • panels[_local2].load(get_next());
  • _local2++;
  • }
  • count_down._visible = false;
  • prev_button._visible = false;
  • }
  • function load_previous_panels() {
  • if (count_down.is_counting()) {
  • next_index = next_index - (2 * panels.length);
  • if (next_index < 0) {
  • next_index = next_index + awsome_videos.length;
  • }
  • }
  • count_down.end_count();
  • }
  • function pause() {
  • count_down.pause();
  • }
  • function unpause() {
  • count_down.unpause();
  • }
  • var panels = [];
  • var last_panels = 0;
  • var margin = 11;
  • }
  • 
  • //----------------------------------------------------------------------
  • //Symbol 145 MovieClip [OverLay] Frame 1
  • //----------------------------------------------------------------------
  • #initclip 28
  • object.registerclass("OverLay", logic.Overlay);
  • #endinitclip
  •  
  • 
  • //----------------------------------------------------------------------
  • //Symbol 170 MovieClip [__Packages.logic.Overlay] Frame 0
  • //----------------------------------------------------------------------
  • class logic.Overlay extends movieclip
  • {
  • var loading, _width, play_button, loading_mc, attachmovie, getnexthighestdepth, _alpha, bg, img, geturl, _parent, onrelease, createemptymovieclip;
  • function Overlay () {
  • super();
  • loading._visible = false;
  • loading._woffset = _width - loading._width;
  • play_button._visible = false;
  • }
  • function show_message(msg) {
  • loading.text = msg;
  • loading_mc.removemovieclip();
  • }
  • function show_loading() {
  • loading_mc = attachmovie("spinner", "loading_mc", getnexthighestdepth());
  • loading_mc._xscale = 200;
  • loading_mc._yscale = 200;
  • loading._visible = true;
  • play_button._visible = false;
  • }
  • function hide() {
  • loading_mc.removemovieclip();
  • loading._visible = false;
  • _alpha = 0;
  • }
  • function show() {
  • loading._visible = false;
  • _alpha = 100;
  • }
  • function resize(w, h) {
  • bg._width = w;
  • bg._height = h;
  • loading._width = w - loading._woffset;
  • if (loading._xscale > 100) {
  • loading._xscale = 100;
  • }
  • loading._yscale = loading._xscale;
  • loading._x = (-1 * loading._width) / 2;
  • fit_img();
  • }
  • function fit_img() {
  • if (img._loaded) {
  • img._width = bg._width;
  • img._height = bg._height;
  • img._x = (-1 * bg._width) / 2;
  • img._y = (-1 * bg._height) / 2;
  • }
  • }
  • function gotoURL() {
  • (geturl(_parent.movie_url, "_blank"));// not popped
  • }
  • function makePressable() {
  • onrelease = gotoURL;
  • }
  • function makePlayMoviePressable() {
  • play_button._visible = true;
  • onrelease = function () {
  • this.play_button._visible = false;
  • this._parent.playMovie();
  • delete this.onrelease;
  • };
  • }
  • function loadclip(still_url) {
  • var _local2 = new object();
  • var o = this;
  • if ((!still_url) || (!logic.Util.inYTDomain(still_url, ["vi/", "i/", "u/", "c/"]))) {
  • return(undefined);
  • }
  • _local2.onloadinit = function (target_mc) {
  • target_mc._loaded = true;
  • o.fit_img();
  • };
  • var _local3 = new moviecliploader();
  • _local3.addlistener(_local2);
  • createemptymovieclip("img", loading.getdepth() - 1);
  • _local3.loadclip(still_url, img);
  • }
  • }
  • 
  • //----------------------------------------------------------------------
  • //Symbol 182 MovieClip [__Packages.logic.SoundController] Frame 0
  • //----------------------------------------------------------------------
  • class logic.SoundController extends movieclip
  • {
  • var sound_bar, knob, sound_button, movie;
  • function SoundController () {
  • super();
  • var o = this;
  • var _local4 = function () {
  • o.knob.highLight();
  • o.onenterframe = function () {
  • var _local2 = this._xmouse - o.sound_bar._x;
  • if (_local2 < 0) {
  • _local2 = 0;
  • } else if (_local2 > o.sound_bar._width) {
  • _local2 = o.sound_bar._width;
  • }
  • o.hideMute();
  • o.knob._x = _local2 + o.sound_bar._x;
  • o.movie.setvolume(o.getSoundPos(o.knob._x));
  • };
  • };
  • sound_bar.onpress = _local4;
  • knob.onpress = _local4;
  • var _local6 = function () {
  • o.knob.normal();
  • var _local2 = o.getSoundPos(o.knob._x);
  • o.movie.setvolume(_local2);
  • delete o.onenterframe;
  • };
  • sound_bar.onrelease = (sound_bar.onreleaseoutside = (knob.onrelease = (knob.onreleaseoutside = _local6)));
  • sound_button.onrelease = function () {
  • o.movie.toggleMute();
  • };
  • }
  • function registerMovie(m) {
  • movie = m;
  • var o = this;
  • m.onShowMute = function () {
  • o.showMute();
  • };
  • m.onShowVolume = function (v) {
  • o.hideMute();
  • o.showVolume(v);
  • };
  • }
  • function getSoundPos(pos) {
  • var _local2 = math.round(((pos - sound_bar._x) * 100) / sound_bar._width);
  • _local2 = math.min(_local2, 100);
  • return(math.max(_local2, 0));
  • }
  • function showMute() {
  • showVolume(0);
  • }
  • function hideMute() {
  • }
  • function showVolume(v) {
  • var _local3 = ((v * sound_bar._width) / 100) + sound_bar._x;
  • knob._x = _local3;
  • showBars(v);
  • }
  • function showBars(v) {
  • var _local3 = math.round((v * num_bars) / 100);
  • var _local2 = 1;
  • while (_local2 <= num_bars) {
  • if (_local2 <= _local3) {
  • this["v" + _local2]._visible = true;
  • } else {
  • this["v" + _local2]._visible = false;
  • }
  • _local2++;
  • }
  • if (_local3 == 0) {
  • sound_button._alpha = 50;
  • } else {
  • sound_button._alpha = 100;
  • }
  • }
  • var num_bars = 4;
  • var volume_spacer = 5;
  • var vs_space = 5;
  • var muted = false;
  • }
  • 
  • //----------------------------------------------------------------------
  • //Symbol 79 MovieClip Frame 1
  • //----------------------------------------------------------------------
  • warp_on = false;
  • stop();
  • setWarp = function (w) {
  • warp_on = w;
  • if (warp_on) {
  • gotoandstop (2);
  • } else {
  • gotoandstop (1);
  • }
  • };
  • onrollover = function () {
  • if (warp_on) {
  • gotoandstop (1);
  • } else {
  • gotoandstop (2);
  • }
  • };
  • onrollout = function () {
  • if (warp_on) {
  • gotoandstop (2);
  • } else {
  • gotoandstop (1);
  • }
  • };
  • onpress = function () {
  • gotoandstop (3);
  • };
  •  
  • 
  • //----------------------------------------------------------------------
  • //Symbol 173 MovieClip [__Packages.com.google.youtube.debug.LogWindow] Frame 0
  • //----------------------------------------------------------------------
  • class com.google.youtube.debug.LogWindow extends movieclip
  • {
  • var hit, closebutton, _visible, swapdepths, mc, output_txt, scrollbar;
  • function LogWindow () {
  • super();
  • }
  • function onload() {
  • build();
  • }
  • function build() {
  • var _self = this;
  • hit.onpress = function () {
  • _self.startdrag();
  • };
  • var _local2 = function () {
  • _self.stopdrag();
  • };
  • hit.onrelease = (hit.onreleaseoutside = _local2);
  • closebutton.onrelease = function () {
  • _self.toggleWindow();
  • };
  • }
  • function toggleWindow() {
  • if (_visible) {
  • _visible = false;
  • com.google.youtube.debug.Debug.getInstance().disableMenuItems();
  • } else {
  • swapdepths(mc.getnexthighestdepth());
  • _visible = true;
  • com.google.youtube.debug.Debug.getInstance().enableMenuItems();
  • com.google.youtube.debug.Debug.updateOutput();
  • }
  • }
  • function setOutput(msg) {
  • output_txt.htmltext = msg;
  • if (scrollbar.__get__isScrolledDown()) {
  • output_txt.scroll = output_txt.maxscroll;
  • }
  • }
  • static var LINK_NAME = "LogWindow";
  • static var FORCE_LINK = object.registerclass(LINK_NAME, com.google.youtube.debug.LogWindow);
  • }
  • 
  • //----------------------------------------------------------------------
  • //Symbol 90 MovieClip [ControlBlock] Frame 1
  • //----------------------------------------------------------------------
  • #initclip 23
  • object.registerclass("ControlBlock", logic.MovieController);
  • #endinitclip
  •  
  • sound_control.movie = movie;
  • fullBar = full_progress_bar.fullBar;
  • seekBar = full_progress_bar.seekBar;
  • progressBar = full_progress_bar.progressBar;
  • seek_time = timer.seek_time;
  • seek_total_time = timer.seek_total_time;
  •  
  • 
  • //----------------------------------------------------------------------
  • //Symbol 16 MovieClip [SoundController] Frame 1
  • //----------------------------------------------------------------------
  • #initclip 31
  • object.registerclass("SoundController", logic.SoundController);
  • #endinitclip
  •  
  • 
  • //----------------------------------------------------------------------
  • //Symbol 181 MovieClip [__Packages.logic.LayoutManager] Frame 0
  • //----------------------------------------------------------------------
  • class logic.LayoutManager
  • {
  • var bounds_clip, rel_clip, layout_objects, _show, current_bounds;
  • function LayoutManager (_bounds_clip, _rel_clip) {
  • bounds_clip = _bounds_clip;
  • rel_clip = _rel_clip;
  • layout_objects = [];
  • _show = true;
  • setBounds();
  • }
  • function setBounds(bounds) {
  • if (bounds) {
  • current_bounds = bounds;
  • } else {
  • current_bounds = bounds_clip.getbounds(rel_clip);
  • }
  • }
  • function isRel(point, dir) {
  • return(point.indexof(dir) > -1);
  • }
  • static function getbounds(object) {
  • var _local1 = object.getbounds(object);
  • if (!_local1) {
  • _local1 = {xMin:0, yMin:0, xMax:object._width, yMax:object._height};
  • }
  • return(_local1);
  • }
  • static function getRelY(object) {
  • if (object._fixed) {
  • return(0);
  • }
  • var _local1 = getbounds(object);
  • if (object._rel & TOP) {
  • return(-_local1.yMin);
  • }
  • if (object._rel & BOTTOM) {
  • return(-_local1.yMax);
  • }
  • if (object._rel & V_CENTER) {
  • return((-(_local1.yMin + _local1.yMax)) / 2);
  • }
  • }
  • static function getRelX(object) {
  • if (object._fixed) {
  • return(0);
  • }
  • var _local1 = getbounds(object);
  • if (object._rel & left) {
  • return(-_local1.xMin);
  • }
  • if (object._rel & right) {
  • return(-_local1.xMax);
  • }
  • if (object._rel & H_CENTER) {
  • return((-(_local1.xMin + _local1.xMax)) / 2);
  • }
  • }
  • function registerObject(object, rel_layout, fixed) {
  • object._rel = rel_layout;
  • object._fixed = fixed;
  • switch (rel_layout & V_MASK) {
  • case TOP :
  • object._yoffset = current_bounds.yMin - (object._y + getRelY(object));
  • break;
  • case BOTTOM :
  • object._yoffset = current_bounds.yMax - (object._y + getRelY(object));
  • break;
  • case V_CENTER :
  • object._yoffset = ((current_bounds.yMax + current_bounds.yMin) / 2) - (object._y + getRelY(object));
  • }
  • switch (rel_layout & H_MASK) {
  • case left :
  • object._xoffset = current_bounds.xMin - (object._x + getRelX(object));
  • break;
  • case right :
  • object._xoffset = current_bounds.xMax - (object._x + getRelX(object));
  • break;
  • case H_CENTER :
  • object._xoffset = ((current_bounds.xMax + current_bounds.xMin) / 2) - (object._x + getRelX(object));
  • }
  • layout_objects.push(object);
  • }
  • function layoutObject(object) {
  • var _local3 = object._rel;
  • switch (_local3 & V_MASK) {
  • case TOP :
  • object._y = current_bounds.yMin - (object._yoffset + getRelY(object));
  • break;
  • case BOTTOM :
  • object._y = current_bounds.yMax - (object._yoffset + getRelY(object));
  • break;
  • case V_CENTER :
  • object._y = ((current_bounds.yMax + current_bounds.yMin) / 2) - (object._yoffset + getRelY(object));
  • }
  • switch (_local3 & H_MASK) {
  • case left :
  • object._x = current_bounds.xMin - (object._xoffset + getRelX(object));
  • break;
  • case right :
  • object._x = current_bounds.xMax - (object._xoffset + getRelX(object));
  • break;
  • case H_CENTER :
  • object._x = ((current_bounds.xMax + current_bounds.xMin) / 2) - (object._xoffset + getRelX(object));
  • }
  • }
  • function layoutObjects(new_bounds) {
  • setBounds(new_bounds);
  • var _local2 = 0;
  • while (_local2 < layout_objects.length) {
  • layoutObject(layout_objects[_local2]);
  • _local2++;
  • }
  • }
  • function hideObjects() {
  • var _local2 = 0;
  • while (_local2 < layout_objects.length) {
  • layout_objects[_local2]._visible = false;
  • _local2++;
  • }
  • _show = false;
  • }
  • function showObjects() {
  • var _local2 = 0;
  • while (_local2 < layout_objects.length) {
  • if (!layout_objects[_local2]._hide) {
  • layout_objects[_local2]._visible = true;
  • }
  • _local2++;
  • }
  • _show = true;
  • }
  • function permHide(object) {
  • object._visible = false;
  • object._hide = true;
  • }
  • function permShow(object) {
  • object._visible = _show;
  • delete object._hide;
  • }
  • static var TOP = 2;
  • static var BOTTOM = 4;
  • static var V_CENTER = 0;
  • static var H_CENTER = 0;
  • static var right = 32;
  • static var left = 64;
  • static var H_MASK = 240;
  • static var V_MASK = 15;
  • }
  • 
  • //----------------------------------------------------------------------
  • //Symbol 165 MovieClip [__Packages.logic.DownloadTimer] Frame 0
  • //----------------------------------------------------------------------
  • class logic.DownloadTimer
  • {
  • var startBytes, endBytes, startTime, endTime, firstSample;
  • function DownloadTimer (curBytes, curTime) {
  • resetEstimator(curBytes, curTime);
  • }
  • function clearHistory() {
  • startBytes = endBytes;
  • startTime = endTime;
  • }
  • function resetEstimator(curBytes, curTime) {
  • startBytes = (endBytes = curBytes);
  • startTime = (endTime = curTime);
  • firstSample = true;
  • }
  • function addData(curBytes, curTime) {
  • if (curBytes < endBytes) {
  • resetEstimator(curBytes, curTime);
  • } else if (curBytes > endBytes) {
  • endBytes = curBytes;
  • endTime = curTime;
  • if (firstSample) {
  • clearHistory();
  • firstSample = false;
  • }
  • }
  • }
  • function getDuration() {
  • return((endTime - startTime) / 1000);
  • }
  • function getsize() {
  • return(endBytes - startBytes);
  • }
  • }
  • 
  • //----------------------------------------------------------------------
  • //Symbol 180 MovieClip [__Packages.logic.PlayerController] Frame 0
  • //----------------------------------------------------------------------
  • class logic.PlayerController extends movieclip
  • {
  • var close_movie, max_movie, movie, controller, layout, _alpha, warp, real_width, real_height, warp_underlay, createemptymovieclip;
  • function PlayerController () {
  • super();
  • show_warp = false;
  • close_movie._visible = false;
  • max_movie._visible = false;
  • var o = this;
  • close_movie.onrelease = function () {
  • o.showWarp();
  • };
  • max_movie.onrelease = function () {
  • o.hideWarp();
  • };
  • movie.onPlayMovie = function () {
  • if (!this._visible) {
  • o.hideWarp();
  • }
  • };
  • movie.onEndMovie = function () {
  • if (_root.playnext == "1") {
  • (this.geturl("javascript:gotoNext()"));// not popped
  • delete _root.playnext;
  • return(true);
  • }
  • if (o.show_warp) {
  • o.hideWarpMovie();
  • o.showWarp();
  • return(true);
  • }
  • };
  • controller.showFSButtons(true);
  • layout = new logic.LayoutManager(movie.overlay, this);
  • layout.registerObject(close_movie, logic.LayoutManager.TOP | logic.LayoutManager.right, true);
  • layout.registerObject(max_movie, logic.LayoutManager.BOTTOM | logic.LayoutManager.right, true);
  • }
  • function onresize() {
  • resize(stage.width, stage.height);
  • }
  • function init(root) {
  • controller.registerMovie(movie);
  • movie.usehandcursor = false;
  • stage.scalemode = "noScale";
  • stage.addlistener(this);
  • resize(stage.width, stage.height);
  • _alpha = 100;
  • }
  • function load_warp() {
  • var _local2 = new object();
  • _local2.player = this;
  • _local2.onloadinit = function (mc) {
  • var _local3 = {player:this.player, v:this.player.movie.video_id};
  • mc.world.init(_local3);
  • mc._x = this.player.movie._x - (mc._width / 2);
  • mc._y = this.player.movie._y - (mc._height / 2);
  • this.player.renderWarp();
  • };
  • system.security.allowdomain(movie.base_url);
  • var _local3 = new moviecliploader();
  • _local3.addlistener(_local2);
  • _local3.loadclip(movie.base_url + "warp.swf", warp);
  • }
  • function toggleWarp() {
  • show_warp = !show_warp;
  • renderWarp();
  • }
  • function hideWarp() {
  • show_warp = false;
  • renderWarp();
  • }
  • function showWarp() {
  • show_warp = true;
  • renderWarp();
  • }
  • function renderWarp() {
  • controller.warp_button.setWarp(show_warp);
  • if (show_warp) {
  • if (!warp.world) {
  • load_warp();
  • return(undefined);
  • }
  • warp.world.showWorld();
  • warp._visible = true;
  • movie._visible = false;
  • hideWarpUnderlay();
  • } else {
  • warp.world.pauseWorld();
  • movie._visible = true;
  • warp._visible = false;
  • close_movie._visible = false;
  • max_movie._visible = false;
  • hideWarpUnderlay();
  • }
  • resize(real_width, real_height);
  • }
  • function setMovie(video_id, image_url, movie_url, length, track_id, eurl, append, fmt_map) {
  • movie.setMovie(video_id, image_url, movie_url, length, track_id, eurl, append, fmt_map);
  • }
  • function showWarpMovie() {
  • close_movie._visible = true;
  • max_movie._visible = true;
  • movie._visible = true;
  • showWarpUnderlay();
  • warp_underlay._x = movie._x;
  • warp_underlay._y = movie._y;
  • warp_underlay._width = movie._width + 2;
  • warp_underlay._height = movie._height + 2;
  • }
  • function showWarpUnderlay() {
  • warp_underlay = createemptymovieclip("warp_underlay", movie.getdepth() - 1);
  • warp_underlay.beginfill(13421772, 100);
  • warp_underlay.moveto(-1, -1);
  • warp_underlay.lineto(1, -1);
  • warp_underlay.lineto(1, 1);
  • warp_underlay.lineto(-1, 1);
  • warp_underlay.lineto(-1, -1);
  • warp_underlay.endfill();
  • warp_underlay.onrelease = function () {
  • };
  • warp_underlay.usehandcursor = false;
  • }
  • function hideWarpUnderlay() {
  • warp_underlay.clear();
  • warp_underlay.removemovieclip();
  • }
  • function hideWarpMovie() {
  • hideWarpUnderlay();
  • close_movie._visible = false;
  • max_movie._visible = false;
  • movie._visible = false;
  • }
  • function resize(w, h) {
  • real_width = w;
  • real_height = h;
  • controller._y = (h / 2) - controller._height;
  • controller.resize_width(w);
  • if (show_warp) {
  • movie.resize(math.min(w - WARP_MOVIE_MARGIN, WARP_VIDEO_WIDTH), math.min(h - (controller._height + WARP_MOVIE_MARGIN), WARP_VIDEO_HEIGHT));
  • warp.world.resize(w, h - controller._height);
  • layout.layoutObjects();
  • warp_underlay._width = movie._width + 2;
  • warp_underlay._height = movie._height + 2;
  • } else {
  • movie.resize(w, h - controller._height);
  • }
  • if ((stage.displayState == "fullScreen") || (_root.fs)) {
  • controller.warp_button._visible = true;
  • } else {
  • if (show_warp) {
  • hideWarp();
  • }
  • controller.warp_button._visible = false;
  • }
  • }
  • var show_warp = true;
  • var WARP_MOVIE_MARGIN = 100;
  • var WARP_VIDEO_WIDTH = 600;
  • var WARP_VIDEO_HEIGHT = 450;
  • }
  • 
  • //----------------------------------------------------------------------
  • //Symbol 162 MovieClip [__Packages.logic.VideoStats] Frame 0
  • //----------------------------------------------------------------------
  • class logic.VideoStats
  • {
  • static var downloadPerfLoaded_, downloadPerf_;
  • var urlBase_, namespace_, plid_, visitorId_, sourceId_, sourceDetail_, query_, eventLabel_, playerStyle_, experimentId_, playbackStarted_, startTimes_, endTimes_, sendSegments_, lastBufferEmptyEvents_, thresholdCount_, multipleInterval_, eventReporter_, sendDownloadData_, getBytesDownloaded, recordedDownloadPerformance_, downloadTimer_, downloadPerformanceTimer_, numSegments_, numSegmentsSent_, startTime_, lastMediaTime_, getMediaTime, lastRealTime_, segmentStart_, sendInterval_, sentInitialPing_, sentTimeoutPing_, mediaInterval_, count_, lastBytes_, getMediaDuration, getVideoDownloadRetries, getBufferEmptyEvents, getPlayerState;
  • function VideoStats (urlBase, namespace, plid, eventLabel, playerStyle, sourceId, sourceDetail, query, visitorId, experimentId) {
  • urlBase_ = urlBase;
  • namespace_ = namespace;
  • plid_ = plid;
  • visitorId_ = visitorId;
  • sourceId_ = sourceId;
  • sourceDetail_ = sourceDetail;
  • query_ = query;
  • eventLabel_ = eventLabel;
  • playerStyle_ = playerStyle;
  • experimentId_ = experimentId;
  • playbackStarted_ = false;
  • startTimes_ = new array();
  • endTimes_ = new array();
  • sendSegments_ = false;
  • lastBufferEmptyEvents_ = 0;
  • downloadPerfLoaded_ = false;
  • thresholdCount_ = 3;
  • multipleInterval_ = 4;
  • }
  • function startPlayback(docid, format, sw) {
  • if (playbackStarted_) {
  • endPlayback();
  • }
  • playbackStarted_ = true;
  • eventReporter_ = new logic.EventReporter(urlBase_);
  • if ((namespace_ != undefined) && (namespace_ != "")) {
  • eventReporter_.addGlobalParameters({ns:namespace_});
  • }
  • if ((plid_ != undefined) && (plid_ != "")) {
  • eventReporter_.addGlobalParameters({plid:plid_});
  • }
  • if ((sourceId_ != undefined) && (sourceId_ != "")) {
  • eventReporter_.addGlobalParameters({sourceid:escape(sourceId_)});
  • }
  • if ((sourceDetail_ != undefined) && (sourceDetail_ != "")) {
  • eventReporter_.addGlobalParameters({sdetail:escape(sourceDetail_)});
  • }
  • if ((query_ != undefined) && (query_ != "")) {
  • eventReporter_.addGlobalParameters({q:escape(query_)});
  • }
  • if ((visitorId_ != undefined) && (visitorId_ != "")) {
  • eventReporter_.addGlobalParameters({vid:visitorId_});
  • }
  • eventReporter_.addGlobalParameters({docid:docid});
  • if (sw != undefined) {
  • eventReporter_.addGlobalParameters({sw:sw});
  • sendSegments_ = true;
  • }
  • if (format != undefined) {
  • eventReporter_.addGlobalParameters({fmt:format});
  • }
  • if ((eventLabel_ != undefined) && (eventLabel_ != "")) {
  • eventReporter_.addGlobalParameters({el:eventLabel_});
  • }
  • if ((playerStyle_ != undefined) && (playerStyle_ != "")) {
  • eventReporter_.addGlobalParameters({ps:playerStyle_});
  • }
  • if ((experimentId_ != undefined) && (experimentId_ != "")) {
  • eventReporter_.addGlobalParameters({e:experimentId_});
  • }
  • loadBandwidthData();
  • var _local3 = 0;
  • var _local2 = 0;
  • for (var _local4 in downloadPerf_) {
  • _local3 = _local3 + downloadPerf_[_local4].bytes;
  • _local2 = _local2 + downloadPerf_[_local4].time;
  • }
  • if ((_local3 > 0) && (_local2 > 0)) {
  • eventReporter_.addGlobalParameters({hbd:_local3});
  • eventReporter_.addGlobalParameters({hbt:_local2});
  • }
  • sendDownloadData_ = false;
  • var _local6 = getBytesDownloaded();
  • var _local5 = gettimer();
  • recordedDownloadPerformance_ = false;
  • downloadTimer_ = new logic.DownloadTimer(_local6, _local5);
  • downloadPerformanceTimer_ = new logic.DownloadTimer(_local6, _local5);
  • numSegments_ = 0;
  • numSegmentsSent_ = 0;
  • startTime_ = _local5;
  • lastMediaTime_ = getMediaTime();
  • lastRealTime_ = startTime_;
  • segmentStart_ = lastMediaTime_;
  • sendInterval_ = null;
  • sentInitialPing_ = false;
  • sentTimeoutPing_ = false;
  • mediaInterval_ = setinterval(this, "mediaUpdate", 100);
  • }
  • function endPlayback() {
  • if (playbackStarted_) {
  • playbackStarted_ = false;
  • if (mediaInterval_ != null) {
  • clearinterval(mediaInterval_);
  • }
  • if (sendInterval_ != null) {
  • clearinterval(sendInterval_);
  • }
  • sendSegments();
  • delete eventReporter_;
  • }
  • }
  • function get playbackStarted() {
  • return(playbackStarted_);
  • }
  • function sendReport(forced) {
  • addSegment();
  • sendSegments(forced);
  • }
  • function onInterval() {
  • if ((count_ <= thresholdCount_) || (((count_ - thresholdCount_) % multipleInterval_) == 0)) {
  • sendReport();
  • }
  • count_++;
  • }
  • function mediaUpdate() {
  • var _local4 = getBytesDownloaded();
  • var _local2 = getMediaTime();
  • var _local3 = gettimer();
  • downloadTimer_.addData(_local4, _local3);
  • downloadPerformanceTimer_.addData(_local4, _local3);
  • lastBytes_ = _local4;
  • if ((!recordedDownloadPerformance_) && (downloadPerformanceTimer_.getsize() >= BW_SAMPLE_SIZE)) {
  • recordedDownloadPerformance_ = true;
  • var _local6 = new object();
  • _local6.bytes = downloadPerformanceTimer_.getsize();
  • _local6.time = downloadPerformanceTimer_.getDuration();
  • if (downloadPerf_.length > BW_MAX_SAMPLES) {
  • downloadPerf_.shift();
  • }
  • downloadPerf_.push(_local6);
  • sendDownloadData_ = true;
  • var _local7 = sharedobject.getlocal("videostats", "/");
  • if (_local7 != null) {
  • _local7.data.perf = downloadPerf_;
  • _local7.flush();
  • }
  • }
  • if ((((sendSegments_ && (!sentInitialPing_)) && (!sentTimeoutPing_)) && (_local4 == 0)) && ((_local3 - startTime_) > PLAYBACK_TIMEOUT)) {
  • sentTimeoutPing_ = true;
  • var _local8 = {st:_local2, et:_local2, pt:1};
  • setStandardArgs(_local8);
  • eventReporter_.send(_local8);
  • }
  • if ((!sentInitialPing_) && (_local2 > 0)) {
  • sentInitialPing_ = true;
  • var _local8 = {st:_local2, et:_local2, fv:escape(system.capabilities.version)};
  • setStandardArgs(_local8);
  • eventReporter_.send(_local8);
  • count_ = 1;
  • sendInterval_ = setinterval(this, "onInterval", 10000);
  • }
  • var _local5 = _local2 - lastMediaTime_;
  • if (_local5 != 0) {
  • var _local9 = _local3 - lastRealTime_;
  • if ((_local5 < 0) || (_local5 > (_local9 + 200))) {
  • addSegment();
  • segmentStart_ = _local2;
  • }
  • lastRealTime_ = _local3;
  • }
  • lastMediaTime_ = _local2;
  • }
  • function setStandardArgs(args) {
  • var _local9 = getMediaDuration();
  • if (_local9 != undefined) {
  • args.len = _local9;
  • }
  • if (getVideoDownloadRetries != undefined) {
  • var _local6 = getVideoDownloadRetries();
  • if (_local6 > 0) {
  • args.retries = _local6;
  • }
  • }
  • if (getBufferEmptyEvents != undefined) {
  • var _local8 = getBufferEmptyEvents();
  • var _local5 = _local8 - lastBufferEmptyEvents_;
  • if (_local5 > 0) {
  • args.nbe = _local5;
  • }
  • lastBufferEmptyEvents_ = _local8;
  • }
  • if (sendDownloadData_) {
  • args.hcbd = downloadPerf_[downloadPerf_.length - 1].bytes;
  • args.hcbt = downloadPerf_[downloadPerf_.length - 1].time;
  • sendDownloadData_ = false;
  • }
  • if (lastBytes_ > 0) {
  • args.bc = lastBytes_;
  • }
  • var _local7 = downloadTimer_.getsize();
  • if (_local7 > 0) {
  • args.bd = _local7;
  • args.bt = downloadTimer_.getDuration();
  • downloadTimer_.clearHistory();
  • }
  • if (getPlayerState != undefined) {
  • var _local3 = getPlayerState();
  • if (_local3) {
  • for (var _local4 in _local3) {
  • args[_local4] = _local3[_local4];
  • }
  • }
  • }
  • var _local10 = gettimer() - startTime_;
  • args.rt = _local10 / 1000;
  • }
  • function addSegment() {
  • if (numSegmentsSent_ > MAX_REQ) {
  • return(undefined);
  • }
  • if ((lastMediaTime_ - segmentStart_) > 3) {
  • startTimes_[numSegments_] = segmentStart_;
  • endTimes_[numSegments_] = lastMediaTime_;
  • numSegments_++;
  • segmentStart_ = lastMediaTime_;
  • }
  • }
  • function sendSegments(forced) {
  • if ((numSegments_ > 0) || (forced)) {
  • var _local4 = string(startTimes_[0]);
  • var _local3 = string(endTimes_[0]);
  • var _local2 = 1;
  • while (_local2 < numSegments_) {
  • _local4 = _local4 + ("," + string(startTimes_[_local2]));
  • _local3 = _local3 + ("," + string(endTimes_[_local2]));
  • _local2++;
  • }
  • if (sendSegments_ || (forced)) {
  • var _local5 = {st:_local4, et:_local3};
  • setStandardArgs(_local5);
  • eventReporter_.send(_local5);
  • }
  • numSegmentsSent_++;
  • numSegments_ = 0;
  • }
  • }
  • function sendWatchPoint() {
  • var _local2 = getMediaTime();
  • var _local3 = {st:_local2, et:_local2, yttk:1};
  • setStandardArgs(_local3);
  • eventReporter_.send(_local3);
  • }
  • static function loadBandwidthData() {
  • if (downloadPerfLoaded_) {
  • return(undefined);
  • }
  • downloadPerf_ = [];
  • var _local4 = sharedobject.getlocal("videostats", "/");
  • if ((_local4 != null) && (_local4.data.perf != undefined)) {
  • var _local2 = _local4.data.perf;
  • for (var _local3 in _local2) {
  • var _local1 = new object();
  • _local1.bytes = _local2[_local3].bytes;
  • _local1.time = _local2[_local3].time;
  • downloadPerf_.push(_local1);
  • }
  • }
  • downloadPerfLoaded_ = true;
  • }
  • static function predictedBandwidthInBitsPerSecond() {
  • loadBandwidthData();
  • var _local2 = 0;
  • var _local1 = 0;
  • for (var _local3 in downloadPerf_) {
  • _local2 = _local2 + downloadPerf_[_local3].bytes;
  • _local1 = _local1 + downloadPerf_[_local3].time;
  • }
  • if (_local1 < 0.1) {
  • return(0);
  • }
  • return(((_local2 * 8) / _local1) * 0.636717);
  • }
  • var MAX_REQ = 400;
  • var BW_SAMPLE_SIZE = 1048576;
  • var BW_MAX_SAMPLES = 3;
  • var PLAYBACK_TIMEOUT = 5000;


    • Home
    • Source of player2.swf
    Create a free website with Weebly