Frame 1
com.google.video.apps.BloggerPlayback.main(this);
Symbol 20480 MovieClip [__Packages.com.gs.TweenLite] Frame 0
class com.gs.TweenLite
{
static var _e, _classInitted, _curTime, _gc, _listening;
var tweenID, endTargetID, vars, duration, delay, _active, target, tweens, _subTweens, _hst, _initted, initTime, startTime, _hasUpdate;
function TweenLite ($target, $duration, $vars) {
_cnt++;
tweenID = "tw" + _cnt;
endTargetID = getID($target, true);
if (($vars.overwrite != false) && ($target != undefined)) {
delete _all[endTargetID];
_all[endTargetID] = {info:[$target, endTargetID]};
}
_all[endTargetID][tweenID] = this;
vars = $vars;
duration = $duration || 0.001;
delay = $vars.delay || 0;
_active = ($duration == 0) && (delay == 0);
target = $target;
if (typeof(vars.ease) != "function") {
vars.ease = defaultEase;
}
if (vars.easeParams != undefined) {
vars.proxiedEase = vars.ease;
vars.ease = easeProxy;
}
if (typeof(vars.autoAlpha) == "number") {
vars._alpha = vars.autoAlpha;
vars._visible = vars._alpha > 0;
}
tweens = [];
_subTweens = [];
_hst = (_initted = false);
if ((_e._visible != false) || (!_classInitted)) {
_curTime = getTimer();
var _local5 = 999;
while (_root.getInstanceAtDepth(_local5) != undefined) {
_local5++;
}
_e = _root.createEmptyMovieClip("__tweenLite_mc", _local5);
_e._visible = false;
_global.clearInterval(_gc);
_gc = _global.setInterval(killGarbage, 2000);
_e.onEnterFrame = executeAll;
_classInitted = true;
}
initTime = _curTime;
if (_active || ((vars.runBackwards == true) && (vars.renderOnStart != true))) {
initTweenVals();
startTime = _curTime;
if (_active) {
render(startTime + 1);
} else {
render(startTime);
}
if ((vars._visible != undefined) && (vars.runBackwards == true)) {
target._visible = vars._visible;
}
}
if ((!_active) && (!_listening)) {
_listening = true;
}
}
function initTweenVals($hrp, $reservedProps) {
var _local4 = typeof(target) == "movieclip";
if (target instanceof Array) {
var _local7 = vars.endArray || ([]);
var _local6 = 0;
for ( ; _local6 < _local7.length ; _local6++) {
if ((target[_local6] != _local7[_local6]) && (target[_local6] != undefined)) {
tweens[tweens.length] = {o:target, p:_local6.toString(), s:target[_local6], c:_local7[_local6] - target[_local6]};
}
}
} else {
if (((vars.tint != undefined) || (vars.removeTint == true)) && (_local4 || (target instanceof TextField))) {
var _local8 = new Color(target);
var _local9 = vars._alpha;
if (_local9 != undefined) {
delete vars._alpha;
} else {
_local9 = target._alpha;
}
if ((vars.removeTint == true) || ((vars.tint == null) || (vars.tint == ""))) {
addSubTween(tintProxy, _local8.getTransform(), {rb:0, gb:0, bb:0, ab:0, ra:_local9, ga:_local9, ba:_local9, aa:_local9}, {color:_local8});
} else {
addSubTween(tintProxy, _local8.getTransform(), {rb:vars.tint >> 16, gb:(vars.tint >> 8) & 255, bb:vars.tint & 255, ra:0, ga:0, ba:0, aa:_local9}, {color:_local8});
}
}
if ((vars.frame != undefined) && (_local4)) {
addSubTween(frameProxy, {frame:target._currentframe}, {frame:vars.frame}, {mc:target});
}
if ((vars.volume != undefined) && (_local4 || (target instanceof Sound))) {
if (_local4) {
var _local10 = new Sound(target);
} else {
var _local10 = Sound(target);
}
addSubTween(volumeProxy, {volume:_local10.getVolume()}, {volume:vars.volume}, {sound:_local10});
}
for (var _local5 in vars) {
if ((_local5 == "ease") || ((_local5 == "delay") || ((_local5 == "overwrite") || ((_local5 == "onComplete") || ((_local5 == "onCompleteParams") || ((_local5 == "onCompleteScope") || ((_local5 == "runBackwards") || ((_local5 == "onUpdate") || ((_local5 == "onUpdateParams") || ((_local5 == "onUpdateScope") || ((_local5 == "persist") || ((_local5 == "volume") || ((_local5 == "onStart") || ((_local5 == "onStartParams") || ((_local5 == "onStartScope") || ((_local5 == "renderOnStart") || ((_local5 == "proxiedEase") || ((_local5 == "easeParams") || ($hrp && ($reservedProps.indexOf((" " + _local5) + " ") != -1)))))))))))))))))))) {
} else if ((!(_local4 && ((_local5 == "_visible") || ((_local5 == "autoAlpha") || ((_local5 == "tint") || ((_local5 == "removeTint") || (_local5 == "frame"))))))) && (target[_local5] != undefined)) {
if (typeof(vars[_local5]) == "number") {
tweens[tweens.length] = {o:target, p:_local5, s:target[_local5], c:vars[_local5] - target[_local5]};
} else {
tweens[tweens.length] = {o:target, p:_local5, s:target[_local5], c:Number(vars[_local5])};
}
}
}
}
if (vars.runBackwards == true) {
var _local6 = tweens.length - 1;
for ( ; _local6 > -1 ; _local6--) {
var _local11 = tweens[_local6];
_local11.s = _local11.s + _local11.c;
_local11.c = _local11.c * -1;
}
}
if (vars._visible == true) {
target._visible = true;
}
if (vars.onUpdate != null) {
_hasUpdate = true;
}
_initted = true;
}
function addSubTween($proxy, $target, $props, $info) {
var _local6 = {proxy:$proxy, target:$target, info:$info};
_subTweens[_subTweens.length] = _local6;
for (var p in $props) {
if (typeof($props[p]) == "number") {
tweens[tweens.length] = {o:$target, p:p, s:$target[p], c:$props[p] - $target[p], sub:_local6};
} else {
tweens[tweens.length] = {o:$target, p:p, s:$target[p], c:Number($props[p]), sub:_local6};
}
}
_hst = true;
}
static function to($target, $duration, $vars) {
return(new com.gs.TweenLite($target, $duration, $vars));
}
static function from($target, $duration, $vars) {
$vars.runBackwards = true;
return(new com.gs.TweenLite($target, $duration, $vars));
}
static function delayedCall($delay, $onComplete, $onCompleteParams, $onCompleteScope) {
return(new com.gs.TweenLite($onComplete, 0, {delay:$delay, onComplete:$onComplete, onCompleteParams:$onCompleteParams, onCompleteScope:$onCompleteScope, overwrite:false}));
}
function render($t) {
var _local3 = ($t - startTime) / 1000;
if (_local3 >= duration) {
_local3 = duration;
var _local4 = 1;
} else {
var _local4 = vars.ease(_local3, 0, 1, duration);
}
var _local6 = tweens.length - 1;
for ( ; _local6 > -1 ; _local6--) {
var _local5 = tweens[_local6];
_local5.o[_local5.p] = _local5.s + (_local4 * _local5.c);
}
if (_hst) {
_local6 = _subTweens.length - 1;
for ( ; _local6 > -1 ; _local6--) {
_subTweens[_local6].proxy(_subTweens[_local6]);
}
}
if (_hasUpdate) {
vars.onUpdate.apply(vars.onUpdateScope, vars.onUpdateParams);
}
if (_local3 == duration) {
complete(true);
}
}
static function executeAll() {
var _local2 = (_curTime = getTimer());
if (_listening) {
var _local3 = _all;
for (var _local6 in _local3) {
for (var _local5 in _local3[_local6]) {
var _local4 = _local3[_local6][_local5];
if (_local4.active) {
_local4.render(_local2);
}
}
}
}
}
static function removeTween($t) {
_all[$t.endTargetID][$t.tweenID] = {active:false};
delete _all[$t.endTargetID][$t.tweenID];
}
static function killTweensOf($tg, $complete) {
var _local4 = getID($tg, true);
if ($complete) {
var _local5 = _all[_local4];
for (var tw in _local5) {
_local5[tw].complete(false);
}
}
delete _all[_local4];
}
function complete($skipRender) {
if ($skipRender != true) {
if (!_initted) {
initTweenVals();
}
startTime = _curTime - (duration * 1000);
render(_curTime);
return(undefined);
}
if (vars._visible != undefined) {
if ((vars.autoAlpha != undefined) && (target._alpha == 0)) {
target._visible = false;
} else if (vars.runBackwards != true) {
target._visible = vars._visible;
}
}
if (vars.onComplete) {
vars.onComplete.apply(vars.onCompleteScope, vars.onCompleteParams);
}
if (vars.persist != true) {
removeTween(this);
}
}
static function getID($tg, $lookup) {
if ($lookup) {
var _local5 = _all;
if (typeof($tg) == "movieclip") {
if (_local5[String($tg)] != undefined) {
return(String($tg));
}
var _local4 = String($tg);
_all[_local4] = {info:[$tg, _local4]};
return(_local4);
}
for (var p in _local5) {
if (_local5[p].info[0] == $tg) {
return(p);
}
}
}
_cnt++;
var _local4 = "t" + _cnt;
_all[_local4] = {info:[$tg, _local4]};
return(_local4);
}
static function killGarbage() {
if (_listening) {
var _local2 = _all;
var _local6 = 0;
var _local7 = 0;
for (var _local4 in _local2) {
_local7 = 0;
for (var _local5 in _local2[_local4]) {
var _local3 = _local2[_local4][_local5];
if (_local3.tweens == undefined) {
} else {
_local7++;
}
}
if (_local7 == 0) {
delete _local2[_local4];
} else {
_local6++;
}
}
if (_local6 == 0) {
_listening = false;
}
}
}
static function defaultEase($t, $b, $c, $d) {
$t = $t / $d;
return((((-$c) * $t) * ($t - 2)) + $b);
}
function easeProxy($t, $b, $c, $d) {
var _local6 = this;
return(_local6.proxiedEase.apply(null, arguments.concat(_local6.easeParams)));
}
static function tintProxy($o) {
$o.info.color.setTransform($o.target);
}
static function frameProxy($o) {
$o.info.mc.gotoAndStop(Math.round($o.target.frame));
}
static function volumeProxy($o) {
$o.info.sound.setVolume($o.target.volume);
}
function get active() {
if (_active) {
return(true);
}
if (((_curTime - initTime) / 1000) > delay) {
_active = true;
startTime = initTime + (delay * 1000);
if (!_initted) {
initTweenVals();
} else if (vars._visible != undefined) {
target._visible = true;
}
if (duration == 0.001) {
startTime = startTime - 1;
}
if (vars.onStart != undefined) {
vars.onStart.apply(vars.onStartScope, vars.onStartParams);
}
return(true);
}
return(false);
}
static var version = 7.01;
static var killDelayedCallsTo = killTweensOf;
static var _all = new Object();
static var _cnt = -16000;
static var _hrp = false;
}
Symbol 20481 MovieClip [__Packages.com.google.utils.FunctionUtils] Frame 0
class com.google.utils.FunctionUtils
{
function FunctionUtils () {
}
static function concat(f, g) {
if (f) {
return(function () {
f();
g();
});
}
return(g);
}
}
Symbol 20482 MovieClip [__Packages.com.google.ui.common.Fader] Frame 0
class com.google.ui.common.Fader
{
function Fader () {
}
static function fadeIn(clip, duration, callback, interval) {
fadeTo(clip, 100, duration, callback, interval);
}
static function fadeOut(clip, duration, callback, interval) {
fadeTo(clip, 0, duration, callback, interval);
}
static function fadeTo(clip, targetAlpha, duration, callback, interval) {
if (duration == undefined) {
duration = DEFAULT_FADE_DURATION;
}
com.google.ui.common.LinearInterpolator.interpolate(clip, "_alpha", targetAlpha, duration, callback, interval);
}
static var DEFAULT_FADE_DURATION = 1000;
}
Symbol 20483 MovieClip [__Packages.com.google.webutil.url.Utils] Frame 0
class com.google.webutil.url.Utils
{
function Utils () {
}
static function getProtocolHostAndPort(url) {
var _local3 = url.indexOf("://");
if (_local3 == -1) {
_local3 = 0;
} else {
_local3 = _local3 + 3;
}
var _local4 = indexOfOrMax(url, "/", _local3);
var _local5 = indexOfOrMax(url, "?", _local3);
var _local6 = Math.min(_local4, _local5);
return(url.substring(0, _local6));
}
static function getUrlParameter(url, param) {
var _local4 = findUrlParameter(url, param);
if (!_local4.found) {
return(null);
}
return(url.slice(_local4.valueStart, _local4.valueEnd));
}
static function setUrlParameter(url, param, value) {
var _local5 = findUrlParameter(url, param);
if (_local5.found) {
var _local6 = url.slice(0, _local5.valueStart);
var _local7 = url.slice(_local5.valueEnd);
return((_local6 + value) + _local7);
}
if (_local5.hasQuestionMark) {
return((((url + "&") + param) + "=") + value);
}
return((((url + "?") + param) + "=") + value);
}
static function findUrlParameter(url, param) {
var _local4 = new Object();
_local4.found = false;
_local4.hasQuestionMark = false;
var _local5 = url.indexOf("?");
if (_local5 > 0) {
_local4.hasQuestionMark = true;
}
while ((_local5 > 0) && (_local5 < url.length)) {
_local5 = url.indexOf(param, _local5 + 1);
if ((_local5 > 0) && (((url.charAt(_local5 - 1) == "?") || (url.charAt(_local5 - 1) == "&")) && (url.charAt(_local5 + param.length) == "="))) {
var _local6 = indexOfOrMax(url, "&", _local5);
_local4.found = true;
_local4.nameStart = _local5;
_local4.nameEnd = _local5 + param.length;
_local4.valueStart = (_local5 + param.length) + 1;
_local4.valueEnd = _local6;
break;
}
}
return(_local4);
}
static function PositionInfo(clip) {
return(((((((((((("Pos = " + clip._x) + ", ") + clip._y) + " Size = ") + clip._width) + " x ") + clip._height) + "(") + clip.width) + " x ") + clip.height) + ")");
}
static function convertToObjectString(obj) {
var _local3 = "{";
var _local4 = true;
for (var propName in obj) {
if (!_local4) {
_local3 = _local3 + ", ";
}
_local3 = _local3 + (((propName + ":\"") + obj[propName]) + "\"");
_local4 = false;
}
_local3 = _local3 + "}";
return(_local3);
}
static function callJavascript(hostHandler, functionName, argObj) {
if (hostHandler) {
var _local5 = convertToObjectString(argObj);
getURL (((((("javascript:" + hostHandler) + "('") + functionName) + "', ") + _local5) + ");", "_self");
}
}
static function isValidCafeUrl(url) {
return(com.google.utils.SecurityUtils.isSafeUrl(url) && (com.google.utils.StringUtils.beginsWith(url, PAGEAD_URL_PREFIX) || (com.google.utils.StringUtils.beginsWith(url, DOUBLECLICK_URL_PREFIX))));
}
static function indexOfOrMax(text, subtext, startingAt) {
var _local5 = text.indexOf(subtext, startingAt);
if (_local5 < 0) {
return(text.length);
}
return(_local5);
}
static function setServerUrl(server, hostport) {
var _local4 = server.indexOf("://");
if (_local4 == -1) {
server = HTTP_PREFIX + server;
}
_local4 = hostport.indexOf("://");
if (_local4 == -1) {
hostport = HTTP_PREFIX + hostport;
}
serverMap[server] = hostport;
}
static function getServerUrl(server) {
var _local3 = server.indexOf("://");
if (_local3 == -1) {
server = HTTP_PREFIX + server;
}
if (serverMap[server] != undefined) {
return(serverMap[server]);
}
return(server);
}
static function isValidVideoUrl(videoUrl) {
if (!com.google.utils.SecurityUtils.isSafeUrl(videoUrl)) {
return(false);
}
if (com.google.utils.StringUtils.beginsWith(videoUrl, "http://youtube.com/get_video?video_id=")) {
return(true);
}
var _local3 = new com.google.utils.Url(videoUrl);
var _local4 = _local3.getHost();
var _local5 = _local3.getPath();
var _local6 = _local5.split("/");
var _local7 = "VideoStream";
var _local8 = "SecureStreamerUrl";
if (_local6[1] == "a") {
if ((_local4 == VIDEO_GOOGLE_COM) || (com.google.utils.StringUtils.endsWith(_local4, CORP_DOMAIN_SUFFIX))) {
if ((_local6[2] == _local7) || ((_local6[3] == _local7) || ((_local6[2] == _local8) || (_local6[3] == _local8)))) {
return(true);
}
}
return(false);
}
if ((_local6[1] == "videodownload") || (_local6[1] == "videoplayback")) {
if (com.google.utils.StringUtils.endsWith(_local4, "." + VIDEO_GOOGLE_COM) || (com.google.utils.StringUtils.endsWith(_local4, CORP_DOMAIN_SUFFIX) || (com.google.utils.StringUtils.endsWith(_local4, ".vp.video.l.google.com")))) {
return(true);
}
}
return(isVideoStreamerUrl(videoUrl));
}
static function isValidAudioUrl(audioUrl) {
return(com.google.utils.SecurityUtils.isSafeUrl(audioUrl) && (isValidAbsoluteGoogleUrl(audioUrl) || (isVideoStreamerUrl(audioUrl))));
}
static function isVideoStreamerUrl(url) {
var _local3 = url.indexOf(".", HTTP_PREFIX.length);
var _local4 = url.substr(_local3);
var _local5 = url.substr(HTTP_PREFIX.length).indexOf("/");
var _local6 = _local4.indexOf(".googlevideo.com/videoplayback");
return((_local6 >= 0) && (_local6 < _local5));
}
static function isValidThumbnailUrl(thumbnailUrl) {
if (!com.google.utils.SecurityUtils.isSafeUrl(thumbnailUrl)) {
return(false);
}
var _local3 = new com.google.utils.Url(thumbnailUrl);
var _local4 = _local3.getProtocol();
var _local5 = _local3.getHost();
var _local6 = _local3.getPath();
var _local7 = _local6.split("/");
var _local8 = "VideoThumb";
if (_local7[1] == "a") {
if ((_local5 == VIDEO_GOOGLE_COM) || (com.google.utils.StringUtils.endsWith(_local5, CORP_DOMAIN_SUFFIX))) {
if ((_local7[2] == _local8) || (_local7[3] == _local8)) {
return(true);
}
}
return(false);
}
if (com.google.utils.StringUtils.beginsWith(_local7[1], "ThumbnailServer")) {
if ((_local5 == VIDEO_GOOGLE_COM) || (com.google.utils.StringUtils.endsWith(_local5, ".gvt0.com") || (com.google.utils.StringUtils.endsWith(_local5, ".gvt0.cn") || (com.google.utils.StringUtils.endsWith(_local5, CORP_DOMAIN_SUFFIX))))) {
return(true);
}
}
if ((_local5 == "img.youtube.com") && (_local7[1] == "vi")) {
return(true);
}
var _local9 = "imgad";
var _local10 = "pagead";
var _local11 = "pageadimg";
if ((_local7[2] == _local9) && ((_local7[1] == _local10) || (_local7[1] == _local11))) {
if ((_local4 == "https") && (_local5 == "adwords.google.com")) {
return(true);
}
if ((_local5 == "pagead2.googlesyndication.com") || (_local5 == "tpc.googlesyndication.com")) {
return(true);
}
}
return(false);
}
static function getProtocolAndHost(url) {
var _local3 = getProtocolHostAndPort(url);
var _local4 = _local3.indexOf("://");
var _local5 = _local3.lastIndexOf(":");
if ((_local5 < 0) || (_local4 == _local5)) {
return(_local3);
}
return(_local3.substring(0, _local5));
}
static function isValidAbsoluteGoogleUrl(url) {
if (com.google.utils.SecurityUtils.isSafeUrl(url)) {
var _local3 = "google.com";
var _local4 = getProtocolAndHost(url);
var _local5 = _local4.substring(_local4.length - _local3.length);
return(_local5 == _local3);
}
return(false);
}
static var HTTP_PREFIX = "http://";
static var VIDEO_GOOGLE_COM = "video.google.com";
static var CORP_DOMAIN_SUFFIX = ".corp.google.com";
static var PAGEAD_URL_PREFIX = HTTP_PREFIX + "pagead2.googlesyndication.com/";
static var DOUBLECLICK_URL_PREFIX = HTTP_PREFIX + "googleads.g.doubleclick.net";
static var serverMap = new Object();
}
Symbol 20484 MovieClip [__Packages.com.google.ui.common.popupmenu.IPopupMenuItem] Frame 0
class com.google.ui.common.popupmenu.IPopupMenuItem
{
function IPopupMenuItem () {
}
}
Symbol 20485 MovieClip [__Packages.com.google.ui.common.popupmenu.PopupMenuSeparatorItem] Frame 0
class com.google.ui.common.popupmenu.PopupMenuSeparatorItem implements com.google.ui.common.popupmenu.IPopupMenuItem
{
var containerClip_, lineClip_, itemWidth_, itemHeight_;
function PopupMenuSeparatorItem () {
}
function addToContainer(containerClip) {
containerClip_ = containerClip;
var _local3 = containerClip.getNextHighestDepth();
containerClip.createEmptyMovieClip("separator", _local3, {_width:MINIMUM_WIDTH, _height:MINIMUM_HEIGHT});
lineClip_ = containerClip.getInstanceAtDepth(_local3);
itemWidth_ = MINIMUM_WIDTH;
itemHeight_ = MINIMUM_HEIGHT;
redraw();
}
function setText(newText) {
}
function isSelectable() {
return(false);
}
function getWidth() {
return(MINIMUM_WIDTH);
}
function getHeight() {
return(MINIMUM_HEIGHT);
}
function toString() {
return("[----------]");
}
function setVisible(visible) {
}
function rollOver() {
return(false);
}
function rollOut() {
}
function moveTo(x, y) {
lineClip_._x = x;
lineClip_._y = y;
}
function setSize(width, height) {
itemWidth_ = width;
itemHeight_ = height;
redraw();
}
function redraw() {
lineClip_.clear();
lineClip_.lineStyle(1, 4210752, 100);
lineClip_.moveTo(0, itemHeight_ / 2);
lineClip_.lineTo(itemWidth_, itemHeight_ / 2);
}
static var MINIMUM_WIDTH = 10;
static var MINIMUM_HEIGHT = 10;
}
Symbol 20486 MovieClip [__Packages.com.google.video.ui.SimpleButton] Frame 0
class com.google.video.ui.SimpleButton extends MovieClip
{
var state, clear, dispatchEvent;
function SimpleButton () {
super();
mx.events.EventDispatcher.initialize(this);
state = UP;
redraw();
}
function drawButtonContents() {
}
function drawButtonContainer() {
}
function redraw() {
clear();
drawButtonContainer();
drawButtonContents();
}
function onRollOver() {
state = OVER;
redraw();
}
function onRollOut() {
state = UP;
redraw();
}
function onDragOver() {
state = OVER;
redraw();
}
function onDragOut() {
state = UP;
redraw();
}
function onPress() {
state = DOWN;
redraw();
}
function onRelease() {
state = OVER;
redraw();
dispatchEvent({type:"clicked", target:this});
}
function onReleaseOutside() {
state = UP;
redraw();
}
static var classPath = com.google.video.ui.SimpleButton;
static var linkageName = "__Packages.com.google.video.ui.SimpleButton";
static var forceLinkage = Object.registerClass(linkageName, Function(classPath));
static var UP = 0;
static var OVER = 1;
static var DOWN = 2;
}
Symbol 20487 MovieClip [__Packages.com.google.video.ui.ListItem] Frame 0
class com.google.video.ui.ListItem extends com.google.video.ui.SimpleButton
{
var width_, height_, thumbnailContainer_, createEmptyMovieClip, getNextHighestDepth, thumbnailClipRegion_, thumbnail_, hitAreaClip_, hitArea, nowPlaying_, attachMovie, miniPlay_, visibleFader_, redraw, active_, __get__active, lineStyle, beginFill, endFill, state, beginGradientFill;
function ListItem () {
super();
width_ = 300;
height_ = 56;
thumbnailContainer_ = createEmptyMovieClip("thumbnailContainer_", getNextHighestDepth());
thumbnailContainer_._x = THUMB_X;
thumbnailContainer_._y = THUMB_Y;
thumbnailClipRegion_ = thumbnailContainer_.createEmptyMovieClip("thumbnailClipRegion_", thumbnailContainer_.getNextHighestDepth());
thumbnailClipRegion_.beginFill(0, 100);
com.google.ui.common.Drawing.drawRectangle(thumbnailClipRegion_, 0, 0, THUMB_W, THUMB_H, 0);
thumbnailClipRegion_.endFill();
thumbnailContainer_.setMask(thumbnailClipRegion_);
thumbnail_ = thumbnailContainer_.createEmptyMovieClip("thumbnail_", thumbnailContainer_.getNextHighestDepth());
thumbnail_._visible = false;
hitAreaClip_ = createEmptyMovieClip("hitAreaClip_", getNextHighestDepth());
hitAreaClip_._visible = false;
hitAreaClip_.beginFill(16777215, 100);
com.google.ui.common.Drawing.drawRectangle(hitAreaClip_, 0, 0, width_, height_, 0);
hitAreaClip_.endFill();
hitArea = hitAreaClip_;
nowPlaying_ = com.google.ui.common.StylishText(attachMovie(com.google.ui.common.StylishText.linkageName, "nowPlaying_", getNextHighestDepth(), {size:12, color:16777215, style:com.google.ui.common.StylishText.BOLD}));
nowPlaying_.text = "Playing Now";
nowPlaying_._visible = false;
miniPlay_ = com.google.video.ui.PlayPauseButton(attachMovie(com.google.video.ui.PlayPauseButton.linkageName, "miniPlay_", getNextHighestDepth()));
miniPlay_._xscale = 75;
miniPlay_._yscale = 75;
miniPlay_._x = THUMB_X + ((THUMB_W / 2) - 18);
miniPlay_._y = THUMB_Y + ((THUMB_H / 2) - 10);
miniPlay_._visible = false;
var miniPlay = miniPlay_;
var _local3 = function () {
return(miniPlay._alpha);
};
var _local4 = function (val) {
miniPlay._alpha = val;
};
visibleFader_ = new com.google.ui.common.SmoothFader(_local3, _local4, 4);
visibleFader_.target = 0;
redraw();
}
function set active(val) {
active_ = val;
nowPlaying_._visible = active_;
redraw();
//return(__get__active());
}
function loadThumbnail(thumbnailUrl) {
var _local3 = new Object();
_local3.onLoadInit = com.google.utils.DelegateEx.create(this, onThumbnailLoadInit);
var _local4 = new MovieClipLoader();
_local4.addListener(_local3);
var _local5 = _local4.loadClip(thumbnailUrl, thumbnail_);
}
function drawThumbBackground() {
lineStyle(2, 13421772, 100);
beginFill(0, 30);
com.google.ui.common.Drawing.drawRectangle(this, THUMB_X, THUMB_Y, 64, 48, 0);
endFill();
}
function drawBackground() {
miniPlay_._visible = (state == com.google.video.ui.SimpleButton.OVER) || (state == com.google.video.ui.SimpleButton.DOWN);
if ((state == com.google.video.ui.SimpleButton.OVER) || (state == com.google.video.ui.SimpleButton.DOWN)) {
visibleFader_.target = 60;
} else {
visibleFader_.target = 0;
}
var _local2 = {a:0, b:24, c:0, d:-24, e:0, f:0, g:0, h:0, i:1};
if (active_) {
lineStyle(1, 16777215, 60);
beginGradientFill("linear", [5605563, 2250120], [60, 60], [0, 255], _local2);
com.google.ui.common.Drawing.drawRectangle(this, 3, 3, width_ - 7, height_ - 7, 0);
endFill();
lineStyle(0, 0, 0);
if (state == com.google.video.ui.SimpleButton.OVER) {
beginFill(16777215, 5);
} else if (state == com.google.video.ui.SimpleButton.DOWN) {
beginFill(16777215, 2);
}
com.google.ui.common.Drawing.drawRectangle(this, 3, 3, width_ - 7, height_ - 7, 0);
endFill();
} else {
lineStyle(0, 0, 0);
if (state == com.google.video.ui.SimpleButton.OVER) {
lineStyle(1, 16777215, 60);
beginGradientFill("linear", [5605563, 2250120], [20, 20], [0, 255], _local2);
} else if (state == com.google.video.ui.SimpleButton.DOWN) {
lineStyle(1, 16777215, 60);
beginGradientFill("linear", [5605563, 2250120], [20, 20], [0, 255], _local2);
}
com.google.ui.common.Drawing.drawRectangle(this, 3, 3, width_ - 7, height_ - 7, 0);
endFill();
}
}
function drawButtonContainer() {
drawBackground();
drawThumbBackground();
}
function onThumbnailLoadInit(target) {
thumbnail_._x = -(THUMB_W * 0.2);
thumbnail_._y = -(THUMB_H * 0.2);
thumbnail_._width = THUMB_W * 1.8;
thumbnail_._height = THUMB_H * 1.8;
thumbnail_._visible = true;
}
static var classPath = com.google.video.ui.ListItem;
static var linkageName = "__Packages.com.google.video.ui.ListItem";
static var forceLinkage = Object.registerClass(linkageName, classPath);
static var THUMB_X = 4;
static var THUMB_Y = 4;
static var THUMB_W = 64;
static var THUMB_H = 48;
static var TEXT_X = (THUMB_X + THUMB_W) + 4;
}
Symbol 20488 MovieClip [__Packages.com.google.video.ui.VideoItem] Frame 0
class com.google.video.ui.VideoItem extends com.google.video.ui.ListItem
{
var title_, attachMovie, getNextHighestDepth, metaData_, duration_, nowPlaying_, loadThumbnail;
function VideoItem () {
super();
title_ = com.google.ui.common.StylishText(attachMovie(com.google.ui.common.StylishText.linkageName, "title_", getNextHighestDepth(), {size:13, color:16777215, style:com.google.ui.common.StylishText.UNDERLINE}));
title_._x = com.google.video.ui.ListItem.TEXT_X;
title_._y = 2;
title_.maxWidth = 220;
metaData_ = com.google.ui.common.StylishText(attachMovie(com.google.ui.common.StylishText.linkageName, "metaData_", getNextHighestDepth(), {size:12, color:8947848}));
metaData_._x = com.google.video.ui.ListItem.TEXT_X;
metaData_._y = 20;
metaData_.maxWidth = 220;
duration_ = com.google.ui.common.StylishText(attachMovie(com.google.ui.common.StylishText.linkageName, "duration_", getNextHighestDepth(), {size:12, color:8947848}));
duration_._x = com.google.video.ui.ListItem.TEXT_X;
duration_._y = 34;
nowPlaying_._x = (300 - nowPlaying_.width) - 10;
nowPlaying_._y = 34;
}
function initialize(itemData) {
var _local4 = 0;
var _local5 = itemData.mediagroup;
var _local6 = 0;
for ( ; _local6 < _local5.length ; _local6++) {
if ((_local5[_local6].name == "media:content") && ((_local5[_local6].type == "video/x-flv") && (_local5[_local6].duration != undefined))) {
_local4 = _local5[_local6].duration;
}
if (_local5[_local6].name == "media:thumbnail") {
var _local3 = _local5[_local6].url;
}
}
loadThumbnail(_local3);
title_.text = itemData.title;
duration_.text = com.google.utils.StringUtils.FormatTime(_local4);
if (itemData["gm:cpa_choice"] != undefined) {
metaData_.text = "Advertisement";
} else if (itemData.description != undefined) {
metaData_.text = itemData.description;
} else if (itemData.author != undefined) {
metaData_.text = itemData.author;
} else {
metaData_.text = duration_.text;
duration_.text = " ";
}
}
static var classPath = com.google.video.ui.VideoItem;
static var linkageName = "__Packages.com.google.video.ui.VideoItem";
static var forceLinkage = Object.registerClass(linkageName, classPath);
}
Symbol 20489 MovieClip [__Packages.com.google.ui.common.ShadowedText] Frame 0
class com.google.ui.common.ShadowedText
{
var backgroundWidth_, backgroundHeight_, formatPrefixFront, formatPrefixShadow, formatSuffixFront, formatSuffixShadow, backgroundOn_, valignment_, __get__text, __get__visible, __get__shadowOn, __get__valignment;
function ShadowedText (parent, x, y, width, height, depth) {
if ((depth == null) || ((depth == undefined) || (depth < 0))) {
depth = parent.getNextHighestDepth();
}
textLayer_ = parent.createEmptyMovieClip("textLayer", depth);
textLayer_._visible = false;
initBackground(width, height);
textFields_ = new Array();
var _local8 = 0;
for ( ; _local8 < TEXT_OFFSETS_X.length ; _local8++) {
textFields_.push(initDisplayField("shadowedTextField" + _local8, x, y, width, height));
}
setFont(null, null, null, null, false);
backgroundOn = false;
valignment = VALIGN_CENTER;
}
function initDisplayField(fieldname, x, y, w, h) {
textLayer_.createTextField(fieldname, textLayer_.getNextHighestDepth(), x, y, w, h);
var _local7 = textLayer_[fieldname];
_local7.background = false;
_local7.border = false;
_local7.html = true;
_local7.htmlText = "";
_local7.multiline = true;
_local7.selectable = false;
_local7.tabEnabled = false;
_local7.wordWrap = true;
var _local8 = new TextField.StyleSheet();
var _local9 = new Object();
_local9.color = "#0000ff";
_local8.setStyle("a", _local9);
_local9["text-decoration"] = "underline";
_local8.setStyle("a:hover", _local9);
_local7.styleSheet = _local8;
return(_local7);
}
function initBackground(width, height) {
background_ = textLayer_.createEmptyMovieClip("background_", textLayer_.getNextHighestDepth());
backgroundWidth_ = width;
backgroundHeight_ = height;
setBackgroundColor(BACKGROUND_COLOR, BACKGROUND_ALPHA);
}
function setFont(face, size, frontColor, shadowColor, opt_refresh) {
if (face == null) {
face = FORMAT_FONT_FACE;
}
if (size == null) {
size = FORMAT_FONT_SIZE;
}
if (frontColor == null) {
frontColor = FORMAT_COLOR_FRONT;
}
if (shadowColor == null) {
shadowColor = FORMAT_COLOR_SHADOW;
}
formatPrefixFront = (((((((("<p align=\"center\">" + "<font size=\"") + size) + "\"") + " color=\"#") + frontColor) + "\"") + " face=\"") + face) + "\">";
formatPrefixShadow = (((((((("<p align=\"center\">" + "<font size=\"") + size) + "\"") + " color=\"#") + shadowColor) + "\"") + " face=\"") + face) + "\">";
formatSuffixFront = "</font></p>";
formatSuffixShadow = "</font></p>";
if (opt_refresh) {
update();
}
}
function repositionAndScale(x, y, xs, ys) {
var _local6 = 0;
for ( ; _local6 < textFields_.length ; _local6++) {
textFields_[_local6]._x = x + (((xs * 0.01) * TEXT_OFFSETS_X[_local6]) * TEXT_OFFSET_SCALE_X);
textFields_[_local6]._y = y + (((ys * 0.01) * TEXT_OFFSETS_Y[_local6]) * TEXT_OFFSET_SCALE_Y);
textFields_[_local6]._xscale = xs;
textFields_[_local6]._yscale = ys;
}
}
function update() {
var _local2 = (text_ != null) && (text_ != "");
var _local3 = "";
var _local4 = "";
if (_local2) {
_local3 = (formatPrefixFront + text_) + formatSuffixFront;
_local4 = (formatPrefixShadow + text_) + formatSuffixShadow;
}
var _local5 = 0;
for ( ; _local5 < (textFields_.length - 1) ; _local5++) {
textFields_[_local5].htmlText = _local4;
}
textFields_[textFields_.length - 1].htmlText = _local3;
var _local6 = textFields_[textFields_.length - 1];
var _local7 = ((_local6.textWidth / 100) + TEXT_H_MARGIN_RATIO) * _local6._xscale;
var _local8 = ((_local6.textHeight / 100) + TEXT_V_MARGIN_RATIO) * _local6._yscale;
background_._visible = _local2 && (backgroundOn_);
if (background_._visible) {
background_._width = _local7;
background_._height = _local8;
background_._x = _local6._x + ((_local6._width - _local7) / 2);
background_._y = _local6._y;
}
if (_local2) {
switch (valignment_) {
case VALIGN_TOP :
textLayer_._y = 0;
break;
case VALIGN_BOTTOM :
textLayer_._y = _local6._height - _local8;
break;
default :
textLayer_._y = (_local6._height - _local8) / 2;
}
}
}
function set text(str) {
text_ = str;
update();
//return(__get__text());
}
function set visible(isVisible) {
textLayer_._visible = isVisible;
//return(__get__visible());
}
function set shadowOn(isOn) {
var _local3 = 0;
for ( ; _local3 < (textFields_.length - 1) ; _local3++) {
textFields_[_local3]._visible = isOn;
}
update();
//return(__get__shadowOn());
}
function get backgroundOn() {
return(backgroundOn_);
}
function set backgroundOn(isOn) {
backgroundOn_ = isOn;
shadowOn = !isOn;
//return(backgroundOn);
}
function toggleBackground() {
backgroundOn = !backgroundOn;
}
function setBackgroundColor(color, alpha) {
if (color < 0) {
color = BACKGROUND_COLOR;
}
if (alpha < 0) {
alpha = BACKGROUND_ALPHA;
}
background_._alpha = 100;
background_.clear();
background_.lineStyle(0, color, 0);
background_.beginFill(color, alpha);
background_.moveTo(0, 0);
background_.lineTo(backgroundWidth_, 0);
background_.lineTo(backgroundWidth_, backgroundHeight_);
background_.lineTo(0, backgroundHeight_);
background_.lineTo(0, 0);
background_.endFill();
}
function set valignment(value) {
if ((value != VALIGN_TOP) && (value != VALIGN_BOTTOM)) {
value = VALIGN_CENTER;
}
valignment_ = value;
update();
//return(__get__valignment());
}
static var VALIGN_TOP = -1;
static var VALIGN_CENTER = 0;
static var VALIGN_BOTTOM = 1;
var textLayer_ = null;
var textFields_ = null;
var text_ = null;
var background_ = null;
static var BACKGROUND_COLOR = 526344;
static var BACKGROUND_ALPHA = 85;
static var TEXT_H_MARGIN_RATIO = 0.05;
static var TEXT_V_MARGIN_RATIO = 0.05;
static var TEXT_OFFSET_SCALE_X = 0.8;
static var TEXT_OFFSET_SCALE_Y = 1;
static var TEXT_OFFSETS_X = new Array(-1, -1, -1, 0, 0, 1, 1, 1, 0.5, 0.5, -0.5, -0.5, -1, 1, -1, 1, 0);
static var TEXT_OFFSETS_Y = new Array(-1, 0, 1, -1, 1, -1, 0, 1, -1, 1, -1, 1, 0.5, 0.5, -0.5, -0.5, 0);
static var FORMAT_FONT_SIZE = 12;
static var FORMAT_FONT_FACE = "Arial";
static var FORMAT_COLOR_FRONT = "ffffff";
static var FORMAT_COLOR_SHADOW = "222222";
}
Symbol 20490 MovieClip [__Packages.com.google.video.ui.TransparentButton] Frame 0
class com.google.video.ui.TransparentButton extends com.google.video.ui.SimpleButton
{
var lineStyle, state, beginFill, endFill;
function TransparentButton () {
super();
}
function drawButtonContainer() {
var _local2 = 0;
var _local3 = 0;
var _local4 = 48;
var _local5 = 24;
lineStyle(2, 13421772, 100);
if (state == com.google.video.ui.SimpleButton.UP) {
beginFill(3355443, 100);
com.google.ui.common.Drawing.drawRectangle(this, _local2, _local3, _local4, _local5, 3);
} else if (state == com.google.video.ui.SimpleButton.OVER) {
beginFill(6710886, 100);
com.google.ui.common.Drawing.drawRectangle(this, _local2, _local3, _local4, _local5, 3);
} else {
beginFill(4473924, 100);
com.google.ui.common.Drawing.drawRectangle(this, _local2, _local3, _local4, _local5, 3);
}
endFill();
}
static var classPath = com.google.video.ui.TransparentButton;
static var linkageName = "__Packages.com.google.video.ui.TransparentButton";
static var forceLinkage = Object.registerClass(linkageName, Function(classPath));
}
Symbol 20491 MovieClip [__Packages.com.google.video.ui.MailButton] Frame 0
class com.google.video.ui.MailButton extends com.google.video.ui.TransparentButton
{
var redraw, lineStyle, beginFill, endFill, moveTo, lineTo, state;
function MailButton () {
super();
redraw();
}
function drawButtonContents() {
var _local2 = 2.5;
var _local3 = 5.5;
var _local4 = 8.5;
var _local5 = 11.5;
var _local6 = 14.5;
var _local7 = 4.5;
var _local8 = 7.5;
var _local9 = 10.5;
var _local10 = 13.5;
lineStyle(0, 0, 0);
beginFill(16777215, 20);
com.google.ui.common.Drawing.drawRectangle(this, _local2, _local7, _local6 - _local2, _local10 - _local7, 0);
endFill();
lineStyle(1, 13421772, 100);
moveTo(_local2, _local7);
lineTo(_local6, _local7);
lineTo(_local6, _local10);
lineTo(_local2, _local10);
lineTo(_local2, _local7);
lineStyle(1, 15658734, 100);
moveTo(_local2, _local10);
lineTo(_local2, _local7);
lineTo(_local4, _local9);
lineTo(_local6, _local7);
lineTo(_local6, _local10);
lineStyle(1, 15658734, 25);
moveTo(_local2, _local10 - 2);
lineTo(_local3 + 1, _local8);
moveTo(_local6, _local10 - 2);
lineTo(_local5 - 1, _local8);
}
function drawButtonContainer() {
var _local2 = 0;
var _local3 = 2;
var _local4 = 17;
var _local5 = 14;
lineStyle(0, 13421772, 0);
if (state == com.google.video.ui.SimpleButton.UP) {
beginFill(0, 10);
} else if (state == com.google.video.ui.SimpleButton.OVER) {
beginFill(4473924, 100);
} else if (state == com.google.video.ui.SimpleButton.DOWN) {
beginFill(2236962, 100);
}
com.google.ui.common.Drawing.drawRectangle(this, _local2, _local3, _local4, _local5, 3);
endFill();
}
static var classPath = com.google.video.ui.MailButton;
static var linkageName = "__Packages.com.google.video.ui.MailButton";
static var forceLinkage = Object.registerClass(linkageName, classPath);
}
Symbol 20492 MovieClip [__Packages.com.google.ui.common.popupmenu.PopupMenu] Frame 0
class com.google.ui.common.popupmenu.PopupMenu
{
var menuItems_, visibleItems_, containerClip_, dropShadowClip_, backgroundClip_, highlightClip_, textFormat_, textFormatHighlight_, contentWidth_, selectedItemIndex_, hideTimer_, timeoutTimer_, lastActivity_, timeout_, dispatchEvent;
function PopupMenu (parentClip, depth) {
mx.events.EventDispatcher.initialize(this);
if (parentClip == undefined) {
parentClip = _root;
}
if (depth == undefined) {
depth = parentClip.getNextHighestDepth();
}
menuItems_ = new Array();
visibleItems_ = new Array();
var _local4 = 5;
containerClip_ = parentClip.createEmptyMovieClip("containerClip_", depth, {_width:_local4, _height:_local4, _x:0, _y:0});
containerClip_._visible = false;
dropShadowClip_ = containerClip_.createEmptyMovieClip("dropShadowClip_", containerClip_.getNextHighestDepth(), {_width:_local4, _height:_local4});
dropShadowClip_.beginFill(COLOR_DROPSHADOW, ALPHA_DROPSHADOW);
dropShadowClip_.moveTo(0, 0);
dropShadowClip_.lineTo(_local4, 0);
dropShadowClip_.lineTo(_local4, _local4);
dropShadowClip_.lineTo(0, _local4);
dropShadowClip_.lineTo(0, 0);
dropShadowClip_.endFill();
backgroundClip_ = containerClip_.createEmptyMovieClip("backgroundClip_", containerClip_.getNextHighestDepth(), {_width:_local4, _height:_local4, _x:0, _y:0});
backgroundClip_.onRelease = com.google.utils.DelegateEx.create(this, onContainerRelease);
backgroundClip_.onRollOver = com.google.utils.DelegateEx.create(this, onContainerRollOver, {drag:false});
backgroundClip_.onRollOut = com.google.utils.DelegateEx.create(this, onContainerRollOut);
backgroundClip_.onDragOver = com.google.utils.DelegateEx.create(this, onContainerRollOver, {drag:true});
backgroundClip_.onDragOut = com.google.utils.DelegateEx.create(this, onContainerRollOut);
backgroundClip_.trackAsMenu = true;
drawBackground();
highlightClip_ = containerClip_.createEmptyMovieClip("highlightClip_", containerClip_.getNextHighestDepth(), {_width:_local4, _height:_local4, _x:0, _y:0});
highlightClip_.beginFill(COLOR_HIGHLIGHT_BACKGROUND);
highlightClip_.moveTo(0, 0);
highlightClip_.lineTo(_local4, 0);
highlightClip_.lineTo(_local4, _local4);
highlightClip_.lineTo(0, _local4);
highlightClip_.lineTo(0, 0);
highlightClip_.endFill();
highlightClip_._visible = false;
textFormat_ = new TextFormat();
textFormat_.color = COLOR_MENUTEXT;
textFormat_.font = TEXT_FONT;
textFormat_.size = TEXT_SIZE;
textFormatHighlight_ = new TextFormat();
textFormatHighlight_.color = COLOR_HIGHLIGHT_MENUTEXT;
}
function addItem(name, text) {
var _local4 = new com.google.ui.common.popupmenu.PopupMenuTextItem(name, textFormat_, textFormatHighlight_);
_local4.addToContainer(containerClip_);
_local4.setText(text);
var _local5 = new Object();
_local5.item = _local4;
_local5.visible = true;
menuItems_.push(_local5);
size();
}
function addSeparator() {
var _local2 = new com.google.ui.common.popupmenu.PopupMenuSeparatorItem();
_local2.addToContainer(containerClip_);
var _local3 = new Object();
_local3.item = _local2;
_local3.visible = true;
menuItems_.push(_local3);
size();
}
function hasItem(name) {
return(findItem(name) >= 0);
}
function removeItem(name) {
var _local3 = findItem(name);
if (_local3 < 0) {
return(undefined);
}
menuItems_.splice(_local3, 1);
size();
}
function hideItem(name) {
var _local3 = findItem(name);
if (_local3 < 0) {
return(undefined);
}
menuItems_[_local3].item.setVisible(false);
menuItems_[_local3].visible = false;
menuItems_[_local3].checkMarkClip._visible = false;
size();
}
function showItem(name) {
var _local3 = findItem(name);
if (_local3 < 0) {
return(undefined);
}
menuItems_[_local3].item.setVisible(true);
menuItems_[_local3].visible = true;
if (menuItems_[_local3].checked) {
menuItems_[_local3].checkMarkClip._visible = true;
}
size();
}
function setItemText(itemName, text) {
var _local4 = findItem(itemName);
if (_local4 < 0) {
return(undefined);
}
var _local5 = menuItems_[_local4];
var _local6 = _local5.item;
_local6.setText(text);
}
function drawBackground() {
backgroundClip_.clear();
backgroundClip_.beginFill(COLOR_BACKGROUND);
backgroundClip_.lineStyle(1);
backgroundClip_.moveTo(0, 0);
backgroundClip_.lineTo(menuWidth_, 0);
backgroundClip_.lineTo(menuWidth_, menuHeight_);
backgroundClip_.lineTo(0, menuHeight_);
backgroundClip_.lineTo(0, 0);
backgroundClip_.endFill();
}
function size() {
var _local2 = 0;
var _local3 = 0;
visibleItems_.splice(0);
var _local4 = 0;
var _local5 = 0;
for ( ; _local5 < menuItems_.length ; _local5++) {
var _local6 = menuItems_[_local5];
var _local7 = _local6.item;
for ( ; !_local6.visible ; _local5++) {
}
visibleItems_.push(_local6);
_local6.contentWidth = _local7.getWidth();
_local6.contentHeight = _local7.getHeight();
_local2 = Math.max(_local2, _local6.contentWidth);
_local3 = Math.max(_local3, _local6.contentHeight);
_local4 = _local4 + _local6.contentHeight;
}
contentWidth_ = _local2;
itemWidth_ = (_local2 + LEFT_GUTTER_WIDTH) + RIGHT_GUTTER_WIDTH;
menuWidth_ = itemWidth_ + (2 * OUTER_MARGIN);
menuHeight_ = _local4 + (2 * OUTER_MARGIN);
dropShadowClip_._width = menuWidth_;
dropShadowClip_._height = menuHeight_;
dropShadowClip_._x = DROP_SHADOW_OFFSET_X;
dropShadowClip_._y = DROP_SHADOW_OFFSET_Y;
drawBackground();
var _local8 = OUTER_MARGIN;
_local5 = 0;
for ( ; _local5 < visibleItems_.length ; _local5++) {
var _local9 = visibleItems_[_local5];
var _local10 = _local9.item;
_local9.y = _local8;
if (_local10.isSelectable()) {
_local10.moveTo(OUTER_MARGIN + LEFT_GUTTER_WIDTH, _local8);
_local10.setSize(contentWidth_, _local9.contentHeight);
} else {
_local10.moveTo(OUTER_MARGIN, _local8);
_local10.setSize(itemWidth_, _local9.contentHeight);
}
_local8 = _local8 + _local9.contentHeight;
}
}
function hide() {
Mouse.removeListener(this);
if (selectedItemIndex_ != undefined) {
onItemRollOut(selectedItemIndex_);
}
containerClip_._visible = false;
if (hideTimer_ != undefined) {
_global.clearInterval(hideTimer_);
hideTimer_ = undefined;
}
if (timeoutTimer_ != undefined) {
_global.clearInterval(timeoutTimer_);
timeoutTimer_ = undefined;
}
}
function show(timeout) {
selectedItemIndex_ = undefined;
containerClip_._visible = true;
Mouse.addListener(this);
lastActivity_ = getTimer();
timeout_ = timeout;
timeoutTimer_ = _global.setInterval(this, "checkTimeout", 1000);
}
function active() {
return(containerClip_._visible);
}
function checkItem(itemName, checkMarkClipName) {
var _local4 = findItem(itemName);
if (_local4 < 0) {
return(undefined);
}
var _local5 = menuItems_[_local4];
var _local6 = _local5.item;
_local5.checked = checkMarkClipName != null;
if ((checkMarkClipName != null) && (_local5.checkMarkClipName != checkMarkClipName)) {
delete _local5.checkMarkClip;
_local5.checkMarkClip = containerClip_.attachMovie(checkMarkClipName, "checkMarkClip", containerClip_.getNextHighestDepth(), {_visible:false});
_local5.checkMarkClipName = checkMarkClipName;
}
if (_local5.checked) {
_local5.checkMarkClip._x = OUTER_MARGIN + ((LEFT_GUTTER_WIDTH - _local5.checkMarkClip._width) / 2);
_local5.checkMarkClip._y = _local5.y + ((_local5.contentHeight - _local5.checkMarkClip._height) / 2);
if (_local5.visible) {
_local5.checkMarkClip._visible = true;
}
} else {
_local5.checkMarkClip._visible = false;
}
}
function isItemChecked(item) {
var _local3 = findItem(item);
if (_local3 < 0) {
return(false);
}
return(menuItems_[_local3].checked);
}
function positionHighlight() {
highlightClip_._width = itemWidth_;
highlightClip_._height = visibleItems_[selectedItemIndex_].contentHeight;
highlightClip_._x = OUTER_MARGIN;
highlightClip_._y = visibleItems_[selectedItemIndex_].y;
highlightClip_._visible = selectedItemIndex_ != undefined;
}
function mouseInsideMenu() {
if (active() && ((containerClip_._xmouse >= 0) && ((containerClip_._xmouse < containerClip_._width) && ((containerClip_._ymouse >= 0) && (containerClip_._ymouse < containerClip_._height))))) {
return(true);
}
return(false);
}
function onMouseDown() {
if (!mouseInsideMenu()) {
hideTimer_ = _global.setInterval(this, "hide", 10);
}
}
function onMouseUp() {
if (active() && (selectedItemIndex_ != undefined)) {
onContainerRelease();
}
}
function moveTo(x, y) {
containerClip_._x = x;
containerClip_._y = y;
}
function getWidth() {
return(menuWidth_);
}
function getHeight() {
return(menuHeight_);
}
function onContainerRelease() {
if (selectedItemIndex_ != undefined) {
dispatchEvent({type:"select", item:visibleItems_[selectedItemIndex_].item.toString()});
hide();
}
}
function onMouseMove() {
var _local2;
if (mouseInsideMenu()) {
var _local3 = 0;
for ( ; _local3 < visibleItems_.length ; _local3++) {
if ((containerClip_._ymouse > visibleItems_[_local3].y) && (containerClip_._ymouse < (visibleItems_[_local3].y + visibleItems_[_local3].contentHeight))) {
_local2 = _local3;
break;
}
}
}
if (_local2 != selectedItemIndex_) {
if (selectedItemIndex_ != undefined) {
onItemRollOut(selectedItemIndex_);
}
if ((_local2 >= 0) && (_local2 < visibleItems_.length)) {
onItemRollOver(_local2);
}
}
lastActivity_ = getTimer();
}
function onContainerRollOver(context) {
}
function onContainerRollOut() {
delete containerClip_.onMouseMove;
if (selectedItemIndex_ != undefined) {
onItemRollOut(selectedItemIndex_);
}
}
function onItemRollOver(itemIndex) {
var _local3 = visibleItems_[itemIndex].item;
if (_local3.isSelectable() && (_local3.rollOver())) {
selectedItemIndex_ = itemIndex;
positionHighlight();
}
}
function onItemRollOut(itemIndex) {
var _local3 = visibleItems_[itemIndex].item;
_local3.rollOut();
selectedItemIndex_ = undefined;
positionHighlight();
}
function findItem(name) {
var _local4 = 0;
for ( ; _local4 < menuItems_.length ; _local4++) {
if (menuItems_[_local4].item.toString() == name) {
return(_local4);
}
}
return(-1);
}
function checkTimeout() {
var _local2 = getTimer() - lastActivity_;
if (_local2 > timeout_) {
hide();
}
}
static var OUTER_MARGIN = 3;
static var LEFT_GUTTER_WIDTH = 14;
static var RIGHT_GUTTER_WIDTH = 14;
static var DROP_SHADOW_OFFSET_X = 2;
static var DROP_SHADOW_OFFSET_Y = 2;
static var TEXT_PADDING = 5;
static var TEXT_FONT = "Arial";
static var TEXT_SIZE = 11;
static var COLOR_BACKGROUND = 15527148;
static var COLOR_MENUTEXT = 0;
static var COLOR_HIGHLIGHT_BACKGROUND = 13750737;
static var COLOR_HIGHLIGHT_MENUTEXT = 0;
static var COLOR_DROPSHADOW = 0;
static var ALPHA_DROPSHADOW = 50;
var menuWidth_ = 0;
var menuHeight_ = 0;
var itemWidth_ = 0;
}
Symbol 20493 MovieClip [__Packages.com.google.ui.common.UIComponent] Frame 0
class com.google.ui.common.UIComponent extends MovieClip
{
var __width, _width, __height, _height, _xscale, _yscale;
function UIComponent () {
super();
__width = _width;
__height = _height;
_xscale = 100;
_yscale = 100;
init();
createChildren();
size();
}
function setSize(newWidth, newHeight) {
__width = newWidth;
__height = newHeight;
size();
}
function get width() {
return(__width);
}
function get height() {
return(__height);
}
function init() {
}
function createChildren() {
}
function size() {
_width = __width;
_height = __height;
}
static var classPath = com.google.ui.common.UIComponent;
static var linkageName = "__Packages.com.google.ui.common.UIComponent";
static var forceLinkage = Object.registerClass(linkageName, classPath);
}
Symbol 20494 MovieClip [__Packages.com.google.ui.common.ColorLayer] Frame 0
class com.google.ui.common.ColorLayer extends com.google.ui.common.UIComponent
{
var clear, lineStyle, beginFill, __width, __height, endFill;
function ColorLayer () {
super();
}
function init() {
mx.events.EventDispatcher.initialize(this);
super.init();
}
function size() {
clear();
lineStyle(1, lineColor_, lineAlpha_);
beginFill(layerColor_, layerAlpha_);
com.google.ui.common.Drawing.drawRectangle(this, 0, 0, __width, __height, radius_);
endFill();
}
function set layerColor(val) {
layerColor_ = val;
size();
//return(layerColor);
}
function get layerColor() {
return(layerColor_);
}
function set layerAlpha(val) {
layerAlpha_ = val;
size();
//return(layerAlpha);
}
function get layerAlpha() {
return(layerAlpha_);
}
function set lineColor(val) {
lineColor_ = val;
size();
//return(lineColor);
}
function get lineColor() {
return(lineColor_);
}
function set lineAlpha(val) {
lineAlpha_ = val;
size();
//return(lineAlpha);
}
function get lineAlpha() {
return(lineAlpha_);
}
function set radius(val) {
radius_ = val;
size();
//return(radius);
}
function get radius() {
return(radius_);
}
static var classPath = com.google.ui.common.ColorLayer;
static var linkageID = "__Packages.com.google.ui.common.ColorLayer";
static var forceLinkage = Object.registerClass(linkageID, classPath);
var layerColor_ = 0;
var layerAlpha_ = 100;
var lineColor_ = 16777215;
var lineAlpha_ = 100;
var radius_ = 0;
}
Symbol 20495 MovieClip [__Packages.com.google.video.ui.MetadataBar] Frame 0
class com.google.video.ui.MetadataBar extends MovieClip
{
var showLeft_, showMetadata_, simpleBackground_, createEmptyMovieClip, getNextHighestDepth, left_, attachMovie, right_, width_, __get__showLeft, __get__showMetadata;
function MetadataBar () {
super();
showLeft_ = true;
showMetadata_ = true;
simpleBackground_ = createEmptyMovieClip("simpleBackground_", getNextHighestDepth());
left_ = com.google.ui.common.StylishText(attachMovie(com.google.ui.common.StylishText.linkageName, "left_", getNextHighestDepth(), {color:16113331, size:12, style:com.google.ui.common.StylishText.BORDER}));
right_ = com.google.ui.common.StylishText(attachMovie(com.google.ui.common.StylishText.linkageName, "right_", getNextHighestDepth(), {color:16777215, size:12, style:com.google.ui.common.StylishText.UNDERLINE}));
}
function setSize(newWidth, newHeight) {
width_ = newWidth;
size();
}
function size() {
left_._x = PADDING;
left_._y = -1;
right_._y = -1;
right_.maxWidth = (width_ - left_.width) - (PADDING * 4);
right_._x = (width_ - right_.width) - PADDING;
simpleBackground_.clear();
simpleBackground_.lineStyle(0, 0, 0);
simpleBackground_.beginFill(0, 100);
com.google.ui.common.Drawing.drawRectangle(simpleBackground_, 0, 0, width_, 17, 0);
simpleBackground_.endFill();
}
function setLeft(text) {
left_.text = text;
size();
}
function set showLeft(val) {
showLeft_ = val;
left_._visible = showLeft_ && (showMetadata_);
//return(__get__showLeft());
}
function setRight(text, destination) {
right_.text = text;
right_.linkDestination = destination;
size();
}
function set showMetadata(val) {
showMetadata_ = val;
left_._visible = showLeft_ && (showMetadata_);
right_._visible = showMetadata_;
//return(__get__showMetadata());
}
static var classPath = com.google.video.ui.MetadataBar;
static var linkageName = "__Packages.com.google.video.ui.MetadataBar";
static var forceLinkage = Object.registerClass(linkageName, Function(classPath));
static var PADDING = 8;
}
Symbol 20496 MovieClip [__Packages.com.google.video.apps.VideoPlaylists] Frame 0
class com.google.video.apps.VideoPlaylists
{
var playlists, channelTitle, channelDescription, allItems, curIndex_, dispatchEvent;
function VideoPlaylists () {
mx.events.EventDispatcher.initialize(this);
playlists = new Object();
curIndex = 0;
}
function loadFromMediaRssData(channelData) {
channelTitle = channelData.title;
channelDescription = channelData.description;
var _local3 = channelData.mediaChannel;
if (_local3 != undefined) {
channelTitle = _local3.title;
channelDescription = _local3.title;
var _local4 = 0;
for ( ; _local4 < _local3.playlistArray.length ; _local4++) {
var _local5 = (((_local3.playlistArray[_local4]["gm:apptype"] + ":") + _local3.playlistArray[_local4]["gm:userid"]) + ":") + _local3.playlistArray[_local4]["gm:cpid"];
playlists[_local5] = new Object();
playlists[_local5].title = _local3.playlistArray[_local4].title;
playlists[_local5].description = _local3.playlistArray[_local4].description;
playlists[_local5].playlistPos = _local4;
playlists[_local5].items = new Array();
}
}
allItems = channelData.itemArray;
var _local6 = 0;
for ( ; _local6 < allItems.length ; _local6++) {
allItems[_local6].itemPos = _local6;
var _local7 = channelData.itemArray[_local6];
var _local8 = getPlaylistName(_local7);
if (playlists[_local8] != undefined) {
_local7.itemPlaylistPos = playlists[_local8].items.length;
playlists[_local8].items.push(_local7);
if ((playlists[_local8].thumbnailUrl == undefined) && (_local7["gm:cpa_choice"] == undefined)) {
var _local9 = _local7.mediagroup;
var _local10 = 0;
for ( ; _local10 < _local9.length ; _local10++) {
if (_local9[_local10].name == "media:thumbnail") {
playlists[_local8].thumbnailUrl = _local9[_local10].url;
}
}
}
}
}
}
static function getPlaylistName(item) {
var _local3 = item["gm:media-playlist-ref"].split(":");
return((((_local3[0] + ":") + _local3[1]) + ":") + _local3[2]);
}
function get curPlaylistName() {
return(getPlaylistName(curItem));
}
function get curPlaylist() {
return(playlists[curPlaylistName]);
}
function get curItem() {
return(allItems[curIndex_]);
}
function get curIndex() {
return(curIndex_);
}
function set curIndex(val) {
curIndex_ = val;
dispatchEvent({type:"curIndexUpdated", target:this, curIndex:curIndex_});
//return(curIndex);
}
}
Symbol 20497 MovieClip [__Packages.com.google.chianti.event.EventBroadcaster] Frame 0
class com.google.chianti.event.EventBroadcaster
{
static var self;
var _eb_enabled, _eb_listeners, _eb_all_listeners, _eb_name;
function EventBroadcaster () {
}
static function initialize(obj, opt_ename) {
if (self == undefined) {
self = new com.google.chianti.event.EventBroadcaster();
}
for (var i in methods) {
obj[methods[i]] = self[methods[i]];
_global.ASSetPropFlags(obj, methods, 1);
}
obj._eb_listeners = new Object();
obj._eb_all_listeners = new Array();
obj._eb_enabled = true;
obj._eb_name = opt_ename;
_global.ASSetPropFlags(obj, ["_eb_listeners", "_eb_all_listeners", "_eb_enabled", "_eb_name"], 1);
}
static function bubbleEvent(event, target) {
event.bubbles = true;
var _local4 = target._parent;
while (_local4) {
if (_local4.broadcast != undefined) {
event.currentTarget = _local4;
_local4.broadcast(event);
break;
}
_local4 = _local4._parent;
}
}
function disableBroadcast() {
_eb_enabled = false;
}
function enableBroadcast() {
_eb_enabled = true;
}
function broadcast(event) {
if (_eb_enabled) {
if (event.target == undefined) {
event.target = this;
}
if (_eb_listeners[event.type] == undefined) {
_eb_listeners[event.type] = _eb_all_listeners.slice();
}
var _local3 = _eb_listeners[event.type].slice();
var _local4 = _local3.length;
if (_local4 > 0) {
var _local5 = 0;
for ( ; _local5 < _local4 ; _local5++) {
_local3[_local5](event);
}
}
if (event.bubbles) {
bubbleEvent(event, this);
}
}
}
function registerEvent(type, obj) {
if (typeof(obj) != "function") {
if (obj[_eb_name] == undefined) {
return(undefined);
}
obj = com.google.chianti.event.EventDelegate.create(obj, obj[_eb_name]);
}
if (type == ALL) {
_eb_all_listeners.push(obj);
for (var i in _eb_listeners) {
_eb_listeners[i].push(obj);
}
} else {
if (_eb_listeners[type] == undefined) {
_eb_listeners[type] = _eb_all_listeners.slice();
}
_eb_listeners[type].push(obj);
}
}
function registerEvents() {
var _local2 = arguments.pop();
var _local3 = arguments.length;
var _local4 = 0;
for ( ; _local4 < _local3 ; _local4++) {
registerEvent(arguments[_local4], _local2);
}
}
function unregisterEvent(type, obj) {
if (type == ALL) {
for (var i in _eb_listeners) {
unregisterEvent(i, obj);
}
var _local4 = _eb_all_listeners;
} else {
var _local4 = _eb_listeners[type];
}
var _local5 = _local4.length;
var _local6 = 0;
for ( ; _local6 < _local5 ; _local6++) {
if (_local4[_local6] == obj) {
_local4.splice(_local6, 1);
break;
}
}
}
function unregisterEvents() {
var _local2 = arguments.pop();
var _local3 = arguments.length;
var _local4 = 0;
for ( ; _local4 < _local3 ; _local4++) {
unregisterEvent(arguments[_local4], _local2);
}
}
function unregisterAll(opt_type) {
if (opt_type == undefined) {
delete _eb_listeners;
_eb_listeners = new Object();
} else {
delete _eb_listeners[opt_type];
}
}
function setEventName(name) {
_eb_name = name;
}
function getEventName() {
return(_eb_name);
}
static var ALL = "ALL";
static var methods = ["broadcast", "registerEvent", "unregisterEvent", "registerEvents", "unregisterEvents", "unregisterAll", "setEventName", "getEventName", "disableBroadcast", "enableBroadcast"];
}
Symbol 20498 MovieClip [__Packages.com.google.video.ui.MuteButton] Frame 0
class com.google.video.ui.MuteButton extends com.google.video.ui.TransparentButton
{
var redraw, lineStyle, beginFill, endFill, muted_, moveTo, curveTo, state;
function MuteButton () {
super();
redraw();
}
function drawButtonContents() {
lineStyle(0, 13421772, 0);
beginFill(13421772, 100);
com.google.ui.common.Drawing.drawRectangle(this, 2, 7, 6, 4, 0);
endFill();
beginFill(13421772, 100);
com.google.ui.common.Drawing.drawTriangle(this, 8, 3, 2, 9, 8, 15, 1);
endFill();
if (!muted_) {
lineStyle(1, 16777215, 80);
moveTo(10, 6);
curveTo(12, 9, 10, 12);
lineStyle(1.5, 16777215, 100);
moveTo(12, 4);
curveTo(17, 9, 12, 14);
}
}
function drawButtonContainer() {
var _local2 = 0;
var _local3 = 2;
var _local4 = 17;
var _local5 = 14;
lineStyle(0, 13421772, 0);
if (state == com.google.video.ui.SimpleButton.UP) {
beginFill(0, 10);
} else if (state == com.google.video.ui.SimpleButton.OVER) {
beginFill(4473924, 100);
} else if (state == com.google.video.ui.SimpleButton.DOWN) {
beginFill(2236962, 100);
}
com.google.ui.common.Drawing.drawRectangle(this, _local2, _local3, _local4, _local5, 3);
endFill();
}
function get muted() {
return(muted_);
}
function set muted(val) {
muted_ = val;
redraw();
//return(muted);
}
static var classPath = com.google.video.ui.MuteButton;
static var linkageName = "__Packages.com.google.video.ui.MuteButton";
static var forceLinkage = Object.registerClass(linkageName, classPath);
}
Symbol 20499 MovieClip [__Packages.com.google.youtube.players.ui.ITooltip] Frame 0
class com.google.youtube.players.ui.ITooltip
{
function ITooltip () {
}
}
Symbol 20500 MovieClip [__Packages.com.google.youtube.util.Drawing] Frame 0
class com.google.youtube.util.Drawing
{
function Drawing () {
}
static function drawRect(target, x, y, width, height, fill, lineStyle, radii, leaveFillOpen) {
drawRectWithPointer(target, x, y, width, height, fill, lineStyle, radii, leaveFillOpen);
}
static function drawRectWithPointer(target, x, y, width, height, fill, lineStyle, radii, leaveFillOpen, pointerWidth, pointerHeight, pointerOrientation, pointerOffset) {
if (fill != null) {
setFill(target, fill);
}
setLineStyle(target, lineStyle);
var _local15 = [];
if (typeof(radii) == "number") {
var _local16 = 0;
for ( ; _local16 < 4 ; _local16++) {
_local15[_local16] = radii;
}
} else {
_local15 = Array(radii);
}
if (!radii) {
target.moveTo(x, y);
if (pointerOrientation == TOP) {
target.lineTo((x + pointerOffset) + ((width - pointerWidth) / 2), y);
target.lineTo((x + pointerOffset) + (width / 2), y - pointerHeight);
target.lineTo((x + pointerOffset) + ((width + pointerWidth) / 2), y);
}
target.lineTo(x + width, y);
if (pointerOrientation == RIGHT) {
target.lineTo(x + width, (y + pointerOffset) + ((height - pointerWidth) / 2));
target.lineTo((x + width) + pointerHeight, (y + pointerOffset) + (height / 2));
target.lineTo(x + width, (y + pointerOffset) + ((height + pointerWidth) / 2));
}
target.lineTo(x + width, y + height);
if (pointerOrientation == BOTTOM) {
target.lineTo((x + pointerOffset) + ((width + pointerWidth) / 2), y + height);
target.lineTo((x + pointerOffset) + (width / 2), (y + height) + pointerHeight);
target.lineTo((x + pointerOffset) + ((width - pointerWidth) / 2), y + height);
}
target.lineTo(x, y + height);
if (pointerOrientation == LEFT) {
target.lineTo(x, (y + pointerOffset) + ((height + pointerWidth) / 2));
target.lineTo(x - pointerHeight, (y + pointerOffset) + (height / 2));
target.lineTo(x, (y + pointerOffset) + ((height - pointerWidth) / 2));
}
target.lineTo(x, y);
} else {
target.moveTo(x + _local15[0], y);
if (pointerOrientation == TOP) {
target.lineTo((x + pointerOffset) + ((width - pointerWidth) / 2), y);
target.lineTo((x + pointerOffset) + (width / 2), y - pointerHeight);
target.lineTo((x + pointerOffset) + ((width + pointerWidth) / 2), y);
}
target.lineTo((x + width) - _local15[1], y);
target.curveTo(x + width, y, x + width, y + _local15[1]);
if (pointerOrientation == RIGHT) {
target.lineTo(x + width, (y + pointerOffset) + ((height - pointerWidth) / 2));
target.lineTo((x + width) + pointerHeight, (y + pointerOffset) + (height / 2));
target.lineTo(x + width, (y + pointerOffset) + ((height + pointerWidth) / 2));
}
target.lineTo(x + width, (y + height) - _local15[2]);
target.curveTo(x + width, y + height, (x + width) - _local15[2], y + height);
if (pointerOrientation == BOTTOM) {
target.lineTo((x + pointerOffset) + ((width + pointerWidth) / 2), y + height);
target.lineTo((x + pointerOffset) + (width / 2), (y + height) + pointerHeight);
target.lineTo((x + pointerOffset) + ((width - pointerWidth) / 2), y + height);
}
target.lineTo(x + _local15[3], y + height);
target.curveTo(x, y + height, x, (y + height) - _local15[3]);
if (pointerOrientation == LEFT) {
target.lineTo(x, (y + pointerOffset) + ((height + pointerWidth) / 2));
target.lineTo(x - pointerHeight, (y + pointerOffset) + (height / 2));
target.lineTo(x, (y + pointerOffset) + ((height - pointerWidth) / 2));
}
target.lineTo(x, y + _local15[0]);
target.curveTo(x, y, x + _local15[0], y);
}
if ((fill != null) && (!leaveFillOpen)) {
target.endFill();
}
}
static function drawPoly(target, points, fill, lineStyle) {
if (fill != null) {
setFill(target, fill);
}
setLineStyle(target, lineStyle);
target.moveTo(points[0].x, points[0].y);
var _local6 = 1;
for ( ; _local6 < points.length ; _local6++) {
target.lineTo(points[_local6].x, points[_local6].y);
}
if (fill != null) {
target.endFill();
}
}
static function drawCircle(target, x, y, diameter, fill, lineStyle, leaveFillOpen) {
if (fill != null) {
setFill(target, fill);
}
setLineStyle(target, lineStyle);
var _local9 = Math.PI / 180;
var _local10 = diameter / 2;
var _local11 = 45 * _local9;
var _local12 = _local10 / Math.cos(_local11 / 2);
var _local13 = 0;
var _local14 = (-_local11) / 2;
target.moveTo(x + _local10, y);
var _local15 = 0;
for ( ; _local15 < 8 ; _local15++) {
_local13 = _local13 + _local11;
_local14 = _local14 + _local11;
var _local16 = _local10 * Math.cos(_local13);
var _local17 = _local10 * Math.sin(_local13);
var _local18 = _local12 * Math.cos(_local14);
var _local19 = _local12 * Math.sin(_local14);
target.curveTo(x + _local18, y + _local19, x + _local16, y + _local17);
}
if ((fill != null) && (!leaveFillOpen)) {
target.endFill();
}
}
static function drawDivider(target, x, y, size, orientation, topColor, bottomColor, linealpha) {
linealpha = (linealpha ? (linealpha) : 100);
target.moveTo(x, y);
setLineStyle(target, {thickness:0, alpha:linealpha, rgb:topColor});
if (orientation == VERTICAL) {
target.lineTo(x, y + size);
setLineStyle(target, {thickness:0, alpha:linealpha, rgb:bottomColor});
target.moveTo(x + 1, y);
target.lineTo(x + 1, y + size);
} else if (orientation == HORIZONTAL) {
target.lineTo(x + size, y);
setLineStyle(target, {thickness:0, alpha:linealpha, rgb:bottomColor});
target.moveTo(x, y + 1);
target.lineTo(x + size, y + 1);
}
}
static function drawArrow(target, x, y, orientation, fill, lineStyle) {
var _local8 = 9;
if (orientation == "left") {
x = x + _local8;
_local8 = -_local8;
}
var _local9 = [{x:x + (_local8 / 3), y:y}, {x:x + _local8, y:y + 7}, {x:x + (_local8 / 3), y:y + 14}, {x:x, y:y + 11.5}, {x:x + (_local8 / 2), y:y + 7}, {x:x, y:y + 2}];
drawPoly(target, _local9, fill, lineStyle);
}
static function drawPlus(target, x, y, plusSize, fill, lineStyle) {
var _local8 = [];
_local8 = [{x:x + (plusSize * 1), y:y + (plusSize * 0)}, {x:x + (plusSize * 2), y:y + (plusSize * 0)}, {x:x + (plusSize * 2), y:y + (plusSize * 1)}, {x:x + (plusSize * 3), y:y + (plusSize * 1)}, {x:x + (plusSize * 3), y:y + (plusSize * 2)}, {x:x + (plusSize * 2), y:y + (plusSize * 2)}, {x:x + (plusSize * 2), y:y + (plusSize * 3)}, {x:x + (plusSize * 1), y:y + (plusSize * 3)}, {x:x + (plusSize * 1), y:y + (plusSize * 2)}, {x:x + (plusSize * 0), y:y + (plusSize * 2)}, {x:x + (plusSize * 0), y:y + (plusSize * 1)}, {x:x + (plusSize * 1), y:y + (plusSize * 1)}, {x:x + (plusSize * 1), y:y + (plusSize * 0)}];
drawPoly(target, _local8, fill, lineStyle);
}
static function drawT(target, x, y, tSize, fill, lineStyle) {
var _local8 = [];
_local8 = [{x:x + (tSize * 0), y:y + (tSize * 0)}, {x:x + (tSize * 5), y:y + (tSize * 0)}, {x:x + (tSize * 5), y:y + (tSize * 1)}, {x:x + (tSize * 3), y:y + (tSize * 1)}, {x:x + (tSize * 3), y:y + (tSize * 5)}, {x:x + (tSize * 2), y:y + (tSize * 5)}, {x:x + (tSize * 2), y:y + (tSize * 1)}, {x:x + (tSize * 0), y:y + (tSize * 1)}, {x:x + (tSize * 0), y:y + (tSize * 0)}];
drawPoly(target, _local8, fill, lineStyle);
}
static function drawX(target, x, y, size, thickness, fill, lineStyle) {
var _local9 = thickness * Math.sin(45);
var _local10 = [];
_local10 = [{x:x + _local9, y:y}, {x:x + (size / 2), y:y + ((size - (_local9 * 2)) / 2)}, {x:x + (size - _local9), y:y}, {x:x + size, y:y + _local9}, {x:x + (size - ((size - (_local9 * 2)) / 2)), y:y + (size / 2)}, {x:x + size, y:y + (size - _local9)}, {x:x + (size - _local9), y:y + size}, {x:x + (size / 2), y:y + (size - ((size - (_local9 * 2)) / 2))}, {x:x + _local9, y:y + size}, {x:x, y:y + (size - _local9)}, {x:x + ((size - (_local9 * 2)) / 2), y:y + (size / 2)}, {x:x, y:y + _local9}];
drawPoly(target, _local10, fill, lineStyle);
}
static function drawStar(target, x, y, fill, lineStyle, points, innerRadius, outerRadius) {
var _local10 = points * 2;
if (fill != null) {
setFill(target, fill);
}
setLineStyle(target, lineStyle);
var _local11 = 360 / _local10;
var _local12 = 0;
while (_local12 <= _local10) {
var _local13 = ((_local11 * _local12) / 180) * Math.PI;
var _local14 = ((_local11 * (_local12 + 1)) / 180) * Math.PI;
var _local15 = innerRadius * Math.sin(_local13);
var _local16 = innerRadius * Math.cos(_local13);
var _local17 = outerRadius * Math.sin(_local14);
var _local18 = outerRadius * Math.cos(_local14);
if (_local12 == 0) {
target.moveTo(_local15, _local16);
target.moveTo(_local17, _local18);
} else {
target.lineTo(_local15, _local16);
target.lineTo(_local17, _local18);
}
_local12 = _local12 + 2;
}
if (fill != null) {
target.endFill();
}
if ((x != null) && (y != null)) {
target._x = outerRadius + x;
target._y = outerRadius + y;
}
}
static function setFill(target, fill) {
if (typeof(fill) == "number") {
target.beginFill(Number(fill));
} else if (fill != null) {
if ((!_global.isNaN(fill.color)) && (!_global.isNaN(fill.alpha))) {
target.beginFill(fill.color, fill.alpha);
} else {
target.beginGradientFill(fill.fillType, fill.colors, fill.alphas, fill.ratios, fill.matrix);
}
}
}
static function setLineStyle(target, lineStyle) {
if (lineStyle != undefined) {
target.lineStyle(lineStyle.thickness, lineStyle.rgb, lineStyle.alpha, lineStyle.pixelHinting, lineStyle.noScale, lineStyle.capsStyle, lineStyle.jointStyle, lineStyle.miterLimit);
}
}
static var VERTICAL = "vertical";
static var HORIZONTAL = "horizontal";
static var TOP = "top";
static var BOTTOM = "bottom";
static var LEFT = "left";
static var RIGHT = "right";
static var TO_RADIANS = Math.PI / 180;
}
Symbol 20501 MovieClip [__Packages.com.google.youtube.players.ui.Tooltip] Frame 0
class com.google.youtube.players.ui.Tooltip implements com.google.youtube.players.ui.ITooltip
{
static var stageRect;
var targetMc, localParent, displayDuration, isActive, tooltipTextColor, tooltipBgFill, tooltipBgPointerOrientation, tooltipTextFormat, tooltipText, offsetX, offsetY, tooltipIconClip, tooltipClip, alertInterval, hideInterval, tooltipTextField, width, height, pointerOffset;
function Tooltip (target, opt_pointerOrientation, opt_bgFill, opt_textColor, opt_localParent) {
targetMc = target;
localParent = (opt_localParent ? (opt_localParent) : (parentClips[_root]));
displayDuration = TOOLTIP_DURATION;
isActive = false;
tooltipTextColor = ((opt_textColor == undefined) ? (TOOLTIP_TEXT_COLOR) : (opt_textColor));
tooltipBgFill = ((opt_bgFill == undefined) ? (TOOLTIP_BG_COLOR) : (opt_bgFill));
tooltipBgPointerOrientation = opt_pointerOrientation || (TOOLTIP_BG_POINTER_ORIENTATION);
tooltipTextFormat = buildTextFormat();
buildTooltipClip();
}
static function createTooltip(target, opt_pointerOrientation, opt_bgFill, opt_textColor, opt_localParent) {
return(new com.google.youtube.players.ui.Tooltip(target, opt_pointerOrientation, opt_bgFill, opt_textColor, opt_localParent));
}
static function createErrorTooltip(target, opt_pointerOrientation, opt_localParent) {
return(new com.google.youtube.players.ui.Tooltip(target, opt_pointerOrientation, ERROR_TOOLTIP_BG_COLOR, undefined, opt_localParent));
}
function getTooltipText() {
return(tooltipText);
}
function setTooltipText(text) {
tooltipText = text;
makeTooltip();
}
function clearTooltipText() {
tooltipText = null;
makeTooltip();
}
function setOffset(x, y) {
offsetX = x;
offsetY = y;
repositionTooltip();
}
function setTooltipIcon(resourceId) {
if (tooltipIconClip) {
tooltipIconClip.removeMovieClip();
tooltipIconClip = null;
}
tooltipIconClip = tooltipClip.attachMovie(resourceId, "tooltipIconClip", tooltipClip.getNextHighestDepth());
if (!tooltipIconClip) {
}
makeTooltip();
}
function setTooltipIconFromBitmap(bmp) {
if (tooltipIconClip) {
tooltipIconClip.removeMovieClip();
tooltipIconClip = null;
}
tooltipIconClip = tooltipClip.createEmptyMovieClip("tooltipIconClip", tooltipClip.getNextHighestDepth());
tooltipIconClip.attachBitmap(bmp, tooltipIconClip.getNextHighestDepth());
makeTooltip();
}
function clearTooltipIcon() {
tooltipIconClip.removeMovieClip();
tooltipIconClip = null;
makeTooltip();
}
function showTooltip(opt_delay) {
if (isActive) {
return(undefined);
}
if (tooltipText.length > 0) {
isActive = true;
if (opt_delay == 0) {
doRealShow();
} else {
startShowTimer(opt_delay);
}
}
}
function hideTooltip() {
isActive = false;
clearTimers();
tooltipClip._visible = false;
}
function startShowTimer(opt_delay) {
if (alertInterval) {
clearTimers();
}
localParent.onMouseMove = com.google.chianti.event.EventDelegate.create(this, clearTimers, opt_delay);
if (opt_delay == 0) {
doRealShow();
} else {
alertInterval = _global.setInterval(this, "doRealShow", opt_delay || (TOOLTIP_DELAY));
}
}
function clearTimers(opt_delay) {
localParent.onMouseMove = null;
if (hideInterval) {
_global.clearInterval(hideInterval);
hideInterval = null;
}
if (alertInterval) {
_global.clearInterval(alertInterval);
alertInterval = null;
}
if (isActive) {
startShowTimer(opt_delay);
} else {
tooltipClip._visible = false;
}
}
function doRealShow() {
tooltipClip._visible = true;
_global.clearInterval(alertInterval);
if (displayDuration) {
_global.clearInterval(hideInterval);
hideInterval = _global.setInterval(this, "hideTooltip", displayDuration);
}
}
function buildTooltipClip() {
tooltipClip = getTooltipClip(localParent);
if (!tooltipClip) {
return(undefined);
}
makeTooltip();
hideTooltip();
}
function makeTooltip() {
if (tooltipText.length <= 0) {
return(undefined);
}
if (tooltipClip.tooltipTextField) {
tooltipClip.tooltipTextField.removeTextField();
}
if (needWordWrap(tooltipText)) {
tooltipTextField = tooltipClip.createTextField("tooltipTextField", tooltipClip.getNextHighestDepth(), 0, 0, getTextFieldMaxWidth(), 0);
tooltipTextField.wordWrap = true;
} else {
tooltipTextField = tooltipClip.createTextField("tooltipTextField", tooltipClip.getNextHighestDepth(), 0, 0, 0, 0);
}
tooltipTextField.autoSize = TOOLTIP_TEXT_FIELD_AUTO_SIZE;
tooltipTextField.selectable = false;
tooltipTextField.setNewTextFormat(tooltipTextFormat);
tooltipTextField.text = tooltipText;
width = getWidth(tooltipTextField);
height = getHeight(tooltipTextField);
repositionTooltip();
if (tooltipIconClip) {
drawTooltipIcon();
}
drawTooltipTextField();
}
function needWordWrap(text) {
var _local3 = getTextFieldMaxWidth();
var _local4 = tooltipClip.createTextField("testTextField", tooltipClip.getNextHighestDepth(), 0, 0, 0, 0);
_local4._alpha = 0;
_local4.text = text;
_local4.setTextFormat(tooltipTextFormat);
var _local5 = _local4.textWidth;
var _local6 = false;
if (_local5 > _local3) {
_local6 = true;
} else {
_local6 = false;
}
_local4.removeTextField();
return(_local6);
}
function getTextFieldMaxWidth() {
var _local2 = TOOLTIP_MAX_WIDTH - (TOOLTIP_TEXT_LEFT_PAD + TOOLTIP_TEXT_RIGHT_PAD);
if (tooltipIconClip) {
_local2 = _local2 - ((tooltipIconClip._width + TOOLTIP_ICON_LEFT_PAD) + TOOLTIP_ICON_RIGHT_PAD);
}
return(_local2);
}
function repositionTooltip() {
var _local2 = {x:0, y:0};
targetMc.localToGlobal(_local2);
pointerOffset = 0;
switch (tooltipBgPointerOrientation) {
case com.google.youtube.util.Drawing.LEFT :
_local2.x = _local2.x + (targetMc._width + TOOLTIP_OFFSET);
var _local3 = true;
break;
case com.google.youtube.util.Drawing.RIGHT :
_local2.x = _local2.x - (width + TOOLTIP_OFFSET);
_local3 = true;
break;
case com.google.youtube.util.Drawing.TOP :
_local2.y = _local2.y + (targetMc._height + TOOLTIP_OFFSET);
_local3 = false;
break;
case com.google.youtube.util.Drawing.BOTTOM :
_local2.y = _local2.y - (height + TOOLTIP_OFFSET);
_local3 = false;
break;
default :
return(undefined);
}
if (_local3) {
if (!_global.isNaN(offsetX)) {
_local2.x = _local2.x + offsetX;
}
if (_global.isNaN(offsetY)) {
_local2.y = _local2.y + ((targetMc._height - height) / 2);
} else {
_local2.y = _local2.y + (offsetY - (height / 2));
}
} else {
if (_global.isNaN(offsetX)) {
_local2.x = _local2.x + ((targetMc._width - width) / 2);
} else {
_local2.x = _local2.x + (offsetX - (width / 2));
}
if (!_global.isNaN(offsetY)) {
_local2.y = _local2.y + offsetY;
}
}
var _local4 = getStageRect();
var _local5 = ((_local2.x + width) + TOOLTIP_MARGIN) - (_local4.x + _local4.width);
if (_local5 > 0) {
if (!_local3) {
pointerOffset = _local5;
}
_local2.x = _local2.x - _local5;
}
_local5 = ((_local2.y + height) + TOOLTIP_MARGIN) - (_local4.y + _local4.height);
if (_local5 > 0) {
if (_local3) {
pointerOffset = _local5;
}
_local2.y = _local2.y - _local5;
}
_local5 = _local2.x - (TOOLTIP_MARGIN + _local4.x);
if (_local5 < 0) {
if (!_local3) {
pointerOffset = _local5;
}
_local2.x = _local2.x - _local5;
}
_local5 = _local2.y - (TOOLTIP_MARGIN + _local4.y);
if (_local5 < 0) {
if (_local3) {
pointerOffset = _local5;
}
_local2.y = _local2.y - _local5;
}
localParent.globalToLocal(_local2);
tooltipClip._x = Math.round(_local2.x);
tooltipClip._y = Math.round(_local2.y);
drawTooltipBackground();
}
function getHeight(textField) {
var _local3 = (textField._height + TOOLTIP_TEXT_TOP_PAD) + TOOLTIP_TEXT_BOTTOM_PAD;
if (tooltipIconClip) {
var _local4 = (tooltipIconClip._height + TOOLTIP_ICON_TOP_PAD) + TOOLTIP_ICON_BOTTOM_PAD;
_local3 = Math.max(_local3, _local4);
}
return(_local3);
}
function getWidth(textField) {
var _local3 = (textField._width + TOOLTIP_TEXT_LEFT_PAD) + TOOLTIP_TEXT_RIGHT_PAD;
if (tooltipIconClip) {
_local3 = _local3 + ((tooltipIconClip._width + TOOLTIP_ICON_LEFT_PAD) + TOOLTIP_ICON_RIGHT_PAD);
}
return(_local3);
}
function drawTooltipBackground() {
tooltipClip.clear();
var _local2 = Math.round(width);
var _local3 = Math.round(height);
var _local4 = 0 + TOOLTIP_BG_SHARPNESS_X_OFFSET;
var _local5 = 0 + TOOLTIP_BG_SHARPNESS_Y_OFFSET;
var _local6 = {thickness:TOOLTIP_BG_BORDER_LINESTYLE_THICKNESS, rgb:TOOLTIP_BG_SHADOW_COLOR, alpha:TOOLTIP_BG_OUTER_SHADOW_ALPHA, noScale:TOOLTIP_BG_BORDER_LINESTYLE_NO_SCALE};
var _local7 = _local4 - TOOLTIP_BG_OUTER_SHADOW_UPPER_LEFT_OFFSET;
var _local8 = _local5 - TOOLTIP_BG_OUTER_SHADOW_UPPER_LEFT_OFFSET;
var _local9 = (_local2 + TOOLTIP_BG_OUTER_SHADOW_UPPER_LEFT_OFFSET) + TOOLTIP_BG_OUTER_SHADOW_LOWER_RIGHT_OFFSET;
var _local10 = (_local3 + TOOLTIP_BG_OUTER_SHADOW_UPPER_LEFT_OFFSET) + TOOLTIP_BG_OUTER_SHADOW_LOWER_RIGHT_OFFSET;
var _local11 = TOOLTIP_BG_BORDER_CORNER_RADIUS + TOOLTIP_BG_OUTER_SHADOW_LOWER_RIGHT_OFFSET;
var _local12 = [_local11, _local11, _local11, _local11];
com.google.youtube.util.Drawing.drawRectWithPointer(tooltipClip, _local7, _local8, _local9, _local10, null, _local6, _local12, false, TOOLTIP_BG_POINTER_WIDTH, TOOLTIP_BG_POINTER_HEIGHT, tooltipBgPointerOrientation, pointerOffset);
var _local13 = {thickness:TOOLTIP_BG_BORDER_LINESTYLE_THICKNESS, rgb:TOOLTIP_BG_SHADOW_COLOR, alpha:TOOLTIP_BG_MIDDLE_SHADOW_ALPHA, noScale:TOOLTIP_BG_BORDER_LINESTYLE_NO_SCALE};
var _local14 = _local4 + TOOLTIP_BG_MIDDLE_SHADOW_OFFSET;
var _local15 = _local5 + TOOLTIP_BG_MIDDLE_SHADOW_OFFSET;
var _local16 = TOOLTIP_BG_BORDER_CORNER_RADIUS + TOOLTIP_BG_MIDDLE_SHADOW_OFFSET;
var _local17 = [_local16, _local16, _local16, _local16];
com.google.youtube.util.Drawing.drawRectWithPointer(tooltipClip, _local14, _local15, _local2, _local3, null, _local13, _local17, false, TOOLTIP_BG_POINTER_WIDTH, TOOLTIP_BG_POINTER_HEIGHT, tooltipBgPointerOrientation, pointerOffset);
var _local18 = {thickness:TOOLTIP_BG_BORDER_LINESTYLE_THICKNESS, rgb:TOOLTIP_BG_SHADOW_COLOR, alpha:TOOLTIP_BG_INNER_SHADOW_ALPHA, noScale:TOOLTIP_BG_BORDER_LINESTYLE_NO_SCALE};
var _local19 = _local4 + TOOLTIP_BG_INNER_SHADOW_OFFSET;
var _local20 = _local5 + TOOLTIP_BG_INNER_SHADOW_OFFSET;
var _local21 = TOOLTIP_BG_BORDER_CORNER_RADIUS + TOOLTIP_BG_INNER_SHADOW_OFFSET;
var _local22 = [_local21, _local21, _local21, _local21];
com.google.youtube.util.Drawing.drawRectWithPointer(tooltipClip, _local19, _local20, _local2, _local3, null, _local18, _local22, false, TOOLTIP_BG_POINTER_WIDTH, TOOLTIP_BG_POINTER_HEIGHT, tooltipBgPointerOrientation, pointerOffset);
var _local23 = {thickness:TOOLTIP_BG_BORDER_LINESTYLE_THICKNESS, rgb:TOOLTIP_BG_BORDER_LINESTYLE_COLOR, alpha:TOOLTIP_BG_BORDER_LINESTYLE_ALPHA, noScale:TOOLTIP_BG_BORDER_LINESTYLE_NO_SCALE};
var _local24 = [TOOLTIP_BG_BORDER_CORNER_RADIUS, TOOLTIP_BG_BORDER_CORNER_RADIUS, TOOLTIP_BG_BORDER_CORNER_RADIUS, TOOLTIP_BG_BORDER_CORNER_RADIUS];
com.google.youtube.util.Drawing.drawRectWithPointer(tooltipClip, _local4, _local5, _local2, _local3, tooltipBgFill, _local23, _local24, false, TOOLTIP_BG_POINTER_WIDTH, TOOLTIP_BG_POINTER_HEIGHT, tooltipBgPointerOrientation, pointerOffset);
}
function drawTooltipIcon() {
if (!tooltipIconClip) {
return(undefined);
}
tooltipIconClip._x = TOOLTIP_ICON_LEFT_PAD;
tooltipIconClip._y = TOOLTIP_ICON_TOP_PAD;
}
function drawTooltipTextField() {
var _local2 = TOOLTIP_TEXT_LEFT_PAD;
var _local3 = TOOLTIP_TEXT_TOP_PAD;
if (tooltipIconClip) {
_local2 = _local2 + ((tooltipIconClip._width + TOOLTIP_ICON_LEFT_PAD) + TOOLTIP_ICON_RIGHT_PAD);
}
tooltipTextField._x = _local2;
tooltipTextField._y = _local3;
tooltipTextField._visible = true;
}
static function setParentClip(tooltipParent) {
parentClips[_root] = tooltipParent;
}
static function setStageRect(newStageRect) {
stageRect = newStageRect;
}
static function getStageRect() {
if (stageRect) {
return(stageRect);
}
return(new com.google.geom.Rect(0, 0, Stage.width, Stage.height));
}
static function getTooltipClip(opt_localParent) {
var _local3 = (opt_localParent ? (opt_localParent) : (parentClips[_root]));
if (_local3) {
var _local4 = _local3.getNextHighestDepth();
return(_local3.createEmptyMovieClip("tooltip" + _local4, _local4));
}
}
function buildTextFormat() {
var _local2 = new TextFormat();
_local2.font = TOOLTIP_TEXT_FONT;
_local2.size = TOOLTIP_TEXT_SIZE;
_local2.color = tooltipTextColor;
return(_local2);
}
function setDisplayDuration(newDisplayDuration) {
if (newDisplayDuration >= 0) {
displayDuration = newDisplayDuration;
}
}
static var TOOLTIP_MAX_WIDTH = 185;
static var TOOLTIP_DELAY = 500;
static var TOOLTIP_DURATION = 5 * 1000;
static var TOOLTIP_MARGIN = 5;
static var TOOLTIP_OFFSET = 15;
static var TOOLTIP_BG_SHARPNESS_X_OFFSET = 0.5;
static var TOOLTIP_BG_SHARPNESS_Y_OFFSET = 0.5;
static var TOOLTIP_BG_COLOR = 1052688;
static var TOOLTIP_BG_BORDER_CORNER_RADIUS = 5;
static var TOOLTIP_BG_BORDER_LINESTYLE_COLOR = 16777215;
static var TOOLTIP_BG_BORDER_LINESTYLE_THICKNESS = 1;
static var TOOLTIP_BG_BORDER_LINESTYLE_ALPHA = 25;
static var TOOLTIP_BG_BORDER_LINESTYLE_NO_SCALE = "none";
static var TOOLTIP_BG_POINTER_WIDTH = 10;
static var TOOLTIP_BG_POINTER_HEIGHT = 5;
static var TOOLTIP_BG_POINTER_ORIENTATION = com.google.youtube.util.Drawing.BOTTOM;
static var ERROR_TOOLTIP_BG_COLOR = 5570560;
static var TOOLTIP_BG_SHADOW_COLOR = 0;
static var TOOLTIP_BG_INNER_SHADOW_ALPHA = 47;
static var TOOLTIP_BG_INNER_SHADOW_OFFSET = 1;
static var TOOLTIP_BG_MIDDLE_SHADOW_ALPHA = 27;
static var TOOLTIP_BG_MIDDLE_SHADOW_OFFSET = 2;
static var TOOLTIP_BG_OUTER_SHADOW_ALPHA = 7;
static var TOOLTIP_BG_OUTER_SHADOW_UPPER_LEFT_OFFSET = 1;
static var TOOLTIP_BG_OUTER_SHADOW_LOWER_RIGHT_OFFSET = 3;
static var TOOLTIP_ICON_LEFT_PAD = 5;
static var TOOLTIP_ICON_RIGHT_PAD = 0;
static var TOOLTIP_ICON_TOP_PAD = 4;
static var TOOLTIP_ICON_BOTTOM_PAD = 3;
static var TOOLTIP_TEXT_LEFT_PAD = 5;
static var TOOLTIP_TEXT_RIGHT_PAD = 5;
static var TOOLTIP_TEXT_TOP_PAD = 2;
static var TOOLTIP_TEXT_BOTTOM_PAD = 2;
static var TOOLTIP_TEXT_SIZE = 10;
static var TOOLTIP_TEXT_FONT = "Arial,_sans";
static var TOOLTIP_TEXT_COLOR = 16777215;
static var TOOLTIP_TEXT_FIELD_AUTO_SIZE = "left";
static var parentClips = {};
}
Symbol 20502 MovieClip [__Packages.com.google.youtube.players.ui.MovingTooltip] Frame 0
class com.google.youtube.players.ui.MovingTooltip extends com.google.youtube.players.ui.Tooltip
{
var repositionTooltip;
function MovingTooltip (target, opt_pointerOrientation, opt_bgFill, opt_textColor, opt_localParent) {
super(target, opt_pointerOrientation, opt_bgFill, opt_textColor, opt_localParent);
}
static function createTooltip(target, opt_pointerOrientation, opt_bgFill, opt_textColor, opt_localParent) {
return(new com.google.youtube.players.ui.MovingTooltip(target, opt_pointerOrientation, opt_bgFill, opt_textColor, opt_localParent));
}
static function createErrorTooltip(target, opt_pointerOrientation) {
return(new com.google.youtube.players.ui.MovingTooltip(target, opt_pointerOrientation, com.google.youtube.players.ui.Tooltip.ERROR_TOOLTIP_BG_COLOR));
}
function doRealShow() {
repositionTooltip();
super.doRealShow();
}
}
Symbol 20503 MovieClip [__Packages.com.google.xml.AbstractXmlFetcher] Frame 0
class com.google.xml.AbstractXmlFetcher
{
var xml_, dispatchEvent;
function AbstractXmlFetcher () {
mx.events.EventDispatcher.initialize(this);
}
function init(xmlUrl) {
xmlUrl_ = xmlUrl;
}
function getXmlUrl() {
return(xmlUrl_);
}
function fetch() {
xml_ = new XML();
xml_.ignoreWhite = true;
xml_.onLoad = com.google.utils.DelegateEx.create(this, onXmlLoad);
xml_.load(xmlUrl_);
}
function onXmlLoad(success) {
if (success) {
success = parseXml();
}
notify(success);
destroy();
}
function destroy() {
if (xml_ != undefined) {
delete xml_;
xml_ = null;
}
}
function parseRootNode(rootNode) {
return(false);
}
function notify(success, errorMsg) {
var _local4 = new Object();
_local4.type = "xmlParsed";
_local4.target = this;
_local4.success = success;
_local4.errorMsg = errorMsg;
dispatchEvent(_local4);
}
function initFromString(message) {
xml_ = new XML(message);
var _local3 = parseXml();
destroy();
return(_local3);
}
function parseXml() {
var _local2 = false;
if (xml_ != null) {
var _local3 = xml_.firstChild;
_local2 = parseRootNode(_local3);
}
return(_local2);
}
var xmlUrl_ = "";
}
Symbol 20504 MovieClip [__Packages.com.google.xml.MediaRSS] Frame 0
class com.google.xml.MediaRSS extends com.google.xml.AbstractXmlFetcher
{
var channelData_;
function MediaRSS () {
super();
channelData_ = new Object();
}
function getNodeValue(node, name) {
if ((node != null) && (node.nodeName == name)) {
return(node.firstChild.nodeValue);
}
return(null);
}
function getNodeAttributes(node, assocArray) {
if (node == null) {
return(false);
}
for (var attr in node.attributes) {
if ((attr == "url") && (!com.google.utils.SecurityUtils.isSafeUrl(node.attributes[attr]))) {
continue;
}
assocArray[attr] = node.attributes[attr];
}
return(true);
}
function parseChannel(node, assocArray) {
return(node.nodeName == "channel");
}
function parseMediaGroup(node, assocArray) {
assocArray.mediagroup = new Array();
var _local4 = 0;
for ( ; _local4 < node.childNodes.length ; _local4++) {
var _local5 = node.childNodes[_local4].nodeName;
var _local6 = new Object();
_local6.name = _local5;
switch (_local5) {
case "media:title" :
case "media:description" :
_local6.value = getNodeValue(node.childNodes[_local4], _local6.name);
if (_local6.value == null) {
}
break;
case "media:content" :
case "media:thumbnail" :
case "media:player" :
if (!getNodeAttributes(node.childNodes[_local4], _local6)) {
return(false);
}
break;
default :
return(false);
}
assocArray.mediagroup.push(_local6);
}
return(true);
}
function parseImage(node, newImage) {
var _local4 = node.childNodes.length;
var _local5 = 0;
for ( ; _local5 < _local4 ; _local5++) {
var _local6 = node.childNodes[_local5].nodeName;
switch (_local6) {
case "link" :
case "url" :
if (com.google.utils.SecurityUtils.isSafeUrl(node.childNodes[_local5].firstChild.nodeValue)) {
newImage[_local6] = node.childNodes[_local5].firstChild.nodeValue;
}
break;
case "title" :
case "width" :
case "height" :
newImage[_local6] = node.childNodes[_local5].firstChild.nodeValue;
}
}
return(true);
}
function parseItem(node, newItem) {
var _local4 = node.childNodes.length;
var _local5 = 0;
for ( ; _local5 < _local4 ; _local5++) {
var _local6 = node.childNodes[_local5].nodeName;
switch (_local6) {
case "title" :
case "link" :
case "guid" :
case "pubDate" :
case "description" :
case "author" :
case "gm:cpa_choice" :
case "gm:visible_url" :
case "gm:click_url" :
case "gm:media-package-ref" :
case "gm:media-channel-ref" :
case "gm:media-playlist-ref" :
case "gv:adSlots" :
case "gv:channelId" :
case "gv:publisherId" :
if (((_local6 == "link") || (_local6 == "gm:click_url")) && (!com.google.utils.SecurityUtils.isSafeUrl(node.childNodes[_local5].firstChild.nodeValue))) {
break;
}
newItem[_local6] = node.childNodes[_local5].firstChild.nodeValue;
break;
case "enclosure" :
newItem.enclosure = new Object();
getNodeAttributes(node.childNodes[_local5], newItem.enclosure);
break;
case "media:group" :
if (parseMediaGroup(node.childNodes[_local5], newItem)) {
break;
}
return(false);
}
}
return(true);
}
function parseMediaPlaylist(node, newPlaylist) {
var _local4 = node.childNodes.length;
var _local5 = 0;
for ( ; _local5 < _local4 ; _local5++) {
var _local6 = node.childNodes[_local5].nodeName;
switch (_local6) {
case "title" :
case "description" :
newPlaylist[_local6] = node.childNodes[_local5].firstChild.nodeValue;
}
}
return(true);
}
function parseMediaChannel(node, newChannel) {
var _local4 = node.childNodes.length;
var _local5 = 0;
for ( ; _local5 < _local4 ; _local5++) {
var _local6 = node.childNodes[_local5].nodeName;
switch (_local6) {
case "title" :
case "description" :
newChannel[_local6] = node.childNodes[_local5].firstChild.nodeValue;
break;
case "gm:media-playlist" :
if (newChannel.playlistArray == undefined) {
newChannel.playlistArray = new Array();
}
var _local7 = new Object();
getNodeAttributes(node.childNodes[_local5], _local7);
if (!parseMediaPlaylist(node.childNodes[_local5], _local7)) {
return(false);
}
newChannel.playlistArray.push(_local7);
}
}
return(true);
}
function parseMediaPackage(node, newPackage) {
var _local4 = node.childNodes.length;
var _local5 = 0;
for ( ; _local5 < _local4 ; _local5++) {
var _local6 = node.childNodes[_local5].nodeName;
if (!(_local6 === "gm:media-channel")) {
} else {
if (newPackage.channelArray == undefined) {
newPackage.channelArray = new Array();
}
var _local7 = new Object();
getNodeAttributes(node.childNodes[_local5], _local7);
if (!parseMediaChannel(node.childNodes[_local5], _local7)) {
return(false);
}
newPackage.channelArray.push(_local7);
}
}
return(true);
}
function parseRootNode(rootNode) {
if ((rootNode != null) && (rootNode.hasChildNodes())) {
rootNode = rootNode.firstChild;
} else {
return(false);
}
if (rootNode.hasChildNodes() && (parseChannel(rootNode))) {
var _local3 = 0;
for ( ; _local3 < rootNode.childNodes.length ; _local3++) {
var _local4 = rootNode.childNodes[_local3].nodeName;
switch (_local4) {
case "link" :
if (com.google.utils.SecurityUtils.isSafeUrl(rootNode.childNodes[_local3].firstChild.nodeValue)) {
channelData_[_local4] = rootNode.childNodes[_local3].firstChild.nodeValue;
}
break;
case "title" :
case "description" :
case "generator" :
channelData_[_local4] = rootNode.childNodes[_local3].firstChild.nodeValue;
break;
case "image" :
var _local5 = new Object();
if (!parseImage(rootNode.childNodes[_local3], _local5)) {
return(false);
}
channelData_[_local4] = _local5;
break;
case "item" :
if (channelData_.itemArray == undefined) {
channelData_.itemArray = new Array();
}
var _local6 = new Object();
if (!parseItem(rootNode.childNodes[_local3], _local6)) {
return(false);
}
channelData_.itemArray.push(_local6);
break;
case "gm:media-package" :
channelData_.mediaPackage = new Object();
getNodeAttributes(rootNode.childNodes[_local3], channelData_.mediaPackage);
if (!parseMediaPackage(rootNode.childNodes[_local3], channelData_.mediaPackage)) {
return(false);
}
break;
case "gm:media-channel" :
channelData_.mediaChannel = new Object();
getNodeAttributes(rootNode.childNodes[_local3], channelData_.mediaChannel);
if (parseMediaChannel(rootNode.childNodes[_local3], channelData_.mediaChannel)) {
break;
}
return(false);
}
}
return(true);
}
return(false);
}
function objToString(obj, level) {
var _local4 = "";
var _local5 = "";
var _local6 = 0;
for ( ; _local6 < level ; _local6++) {
_local5 = _local5 + " ";
}
for (var prop in obj) {
if (typeof(obj[prop]) == "object") {
_local4 = _local4 + (_local5 + (("[" + prop) + "]\n"));
_local4 = _local4 + objToString(obj[prop], level + 1);
} else {
_local4 = _local4 + (_local5 + (((prop + ": ") + obj[prop]) + newline));
}
}
return(_local4);
}
function toString() {
return(objToString(channelData_, 0));
}
}
Symbol 20505 MovieClip [__Packages.com.google.ui.common.StylishText] Frame 0
class com.google.ui.common.StylishText extends MovieClip
{
var maxWidth_, fullText_, createTextField, getNextHighestDepth, textClip_, onRelease, __get__linkDestination;
function StylishText () {
super();
maxWidth_ = 0;
fullText_ = "";
if ((style & BORDER) != 0) {
var _local3 = createTextFormat(font, 0, size, style);
var _local4 = 0;
for ( ; _local4 < 4 ; _local4++) {
var _local5 = ((_local4 & 1) ? -1 : 1);
var _local6 = ((_local4 & 2) ? -1 : 1);
createTextField("textClip_" + _local4, getNextHighestDepth(), _local5, _local6, 0, 0);
var _local7 = this["textClip_" + _local4];
_local7.html = true;
_local7.autoSize = true;
_local7.condenseWhite = true;
_local7.selectable = false;
_local7.multiline = true;
_local7.background = false;
_local7.setNewTextFormat(_local3);
_local7.text = "";
}
}
createTextField("textClip_", getNextHighestDepth(), 0, 0, 0, 0);
textClip_.html = true;
textClip_.autoSize = true;
textClip_.condenseWhite = true;
textClip_.background = false;
textClip_.selectable = false;
textClip_.multiline = true;
textClip_.setNewTextFormat(createTextFormat(font, color, size, style));
textClip_.text = "";
}
static function createTextFormat(font, color, size, style) {
var _local6 = new TextFormat();
_local6.color = color;
_local6.font = font;
_local6.size = size;
_local6.underline = (style & UNDERLINE) != 0;
_local6.bold = (style & BOLD) != 0;
return(_local6);
}
function set text(text) {
fullText_ = text;
textClip_.htmlText = text;
var _local3;
var _local4;
if ((maxWidth_ > 0) && (textClip_.textWidth > maxWidth_)) {
var _local5 = text;
var _local6 = 1;
for ( ; _local6 < text.length ; _local6++) {
if (isSpecialChar(text, _local6 - 1)) {
_local3 = _local6 - 1;
} else if ((text.charAt(_local6 - 1) == SPECIAL_CHAR_END) && (_local3 != undefined)) {
_local4 = _local6 - 1;
}
_local5 = text.substr(0, _local6) + "...";
textClip_.htmlText = _local5;
if (textClip_.textWidth > maxWidth_) {
if (_local4 != undefined) {
textClip_.htmlText = text.substr(0, _local3) + "...";
} else {
for ( ; _local3 != undefined ; _local6++) {
}
textClip_.htmlText = text.substr(0, _local6 - 1) + "...";
}
break;
}
if (_local4 != undefined) {
_local3 = undefined;
_local4 = undefined;
}
}
text = _local5;
}
if ((style & BORDER) != 0) {
var _local7 = 0;
for ( ; _local7 < 4 ; _local7++) {
var _local8 = this["textClip_" + _local7];
_local8.htmlText = text;
}
}
//return(this.text);
}
function get text() {
return(textClip_.htmlText);
}
function set maxWidth(val) {
maxWidth_ = val;
text = fullText_;
//return(maxWidth);
}
function get maxWidth() {
return(maxWidth_);
}
function get height() {
return(textClip_.textHeight);
}
function get width() {
return(textClip_.textWidth);
}
function set linkDestination(val) {
onRelease = function () {
getURL (val, "_top");
};
//return(__get__linkDestination());
}
static function filtersSupported() {
var _local2 = System.capabilities.version;
var _local3 = _local2.split(" ");
_local3 = _local3[1].split(",");
return(Number(_local3[0]) >= 8);
}
function isSpecialChar(text, i) {
var _local4 = 1;
for ( ; _local4 < MAX_SPECIAL_CHAR_LENGTH ; _local4++) {
if ((i + _local4) >= text.length) {
return(false);
}
textClip_.htmlText = text.substr(i, _local4);
var _local5 = textClip_.textWidth;
textClip_.text = text.substr(i, _local4);
if ((_local5 < textClip_.textWidth) && ((text.charAt(i) == SPECIAL_CHAR_START) && (text.charAt(i + _local4) == SPECIAL_CHAR_END))) {
return(true);
}
}
return(false);
}
static var classPath = com.google.ui.common.StylishText;
static var linkageName = "__Packages.com.google.ui.common.StylishText";
static var forceLinkage = Object.registerClass(linkageName, Function(classPath));
static var NONE = 0;
static var BORDER = 1 << 0;
static var UNDERLINE = 1 << 1;
static var BOLD = 1 << 2;
static var MAX_SPECIAL_CHAR_LENGTH = 8;
static var SPECIAL_CHAR_START = "&";
static var SPECIAL_CHAR_END = ";";
var font = "Arial";
var color = 0;
var size = 13;
var style = NONE;
}
Symbol 20506 MovieClip [__Packages.com.google.ui.common.IconButtonBase] Frame 0
class com.google.ui.common.IconButtonBase extends com.google.ui.common.UIComponent
{
var attachMovie, baseName_, getNextHighestDepth, clips_, __height, __width, iconClip_, textFieldClip_, _xmouse, _ymouse, dispatchEvent, timer_, createTextField, tabIndex_, tabChildren;
function IconButtonBase () {
super();
}
function init() {
mx.events.EventDispatcher.initialize(this);
super.init();
}
function createButtonClipsForState(state, suffix) {
var _local4 = new Array(3);
_local4[MIDDLE] = attachMovie((baseName_ + "_mid") + suffix, ((baseName_ + "_mid") + suffix) + "Clip", getNextHighestDepth());
_local4[LEFT] = attachMovie((baseName_ + "_left") + suffix, ((baseName_ + "_left") + suffix) + "Clip", getNextHighestDepth());
_local4[RIGHT] = attachMovie((baseName_ + "_right") + suffix, ((baseName_ + "_right") + suffix) + "Clip", getNextHighestDepth());
var _local5 = 0;
for ( ; _local5 < _local4.length ; _local5++) {
_local4[_local5].useHandCursor = true;
_local4[_local5].naturalWidth = _local4[_local5]._width;
}
return(_local4);
}
function createButtonClips() {
if (clips_ != undefined) {
var _local2 = 0;
for ( ; _local2 < clips_.length ; _local2++) {
var _local3 = 0;
for ( ; _local3 < clips_[_local2].length ; _local3++) {
clips_[_local2][_local3].removeMovieClip();
}
}
}
clips_ = new Array(3);
clips_[UP] = createButtonClipsForState(UP, "");
clips_[DOWN] = createButtonClipsForState(DOWN, "_click");
clips_[OVER] = createButtonClipsForState(OVER, "_mouse");
}
function createChildren() {
createButtonClips();
createPayload();
setDisplayState(UP);
size();
}
function size() {
var _local2 = 0;
for ( ; _local2 < clips_.length ; _local2++) {
clips_[_local2][LEFT]._x = 0;
clips_[_local2][LEFT]._y = 0;
clips_[_local2][LEFT]._width = clips_[_local2][LEFT].naturalWidth;
clips_[_local2][LEFT]._height = __height;
clips_[_local2][RIGHT]._width = clips_[_local2][RIGHT].naturalWidth;
clips_[_local2][RIGHT]._height = __height;
clips_[_local2][RIGHT]._x = __width - clips_[_local2][RIGHT]._width;
clips_[_local2][RIGHT]._y = 0;
clips_[_local2][MIDDLE]._x = clips_[_local2][LEFT]._width;
clips_[_local2][MIDDLE]._y = 0;
clips_[_local2][MIDDLE]._width = clips_[_local2][RIGHT]._x - clips_[_local2][LEFT]._width;
clips_[_local2][MIDDLE]._height = __height;
}
if (iconClip_ != undefined) {
iconClip_._x = (__width - iconClip_._width) / 2;
iconClip_._y = (__height - iconClip_._height) / 2;
} else {
textFieldClip_._width = __width;
textFieldClip_._height = __height;
textFieldClip_._x = ((__width - textFieldClip_._width) / 2) + 1;
textFieldClip_._y = ((__height - textFieldClip_._height) / 2) + 1;
}
}
function mouseInsideButton() {
return((_xmouse > 0) && ((_xmouse < __width) && ((_ymouse > 0) && (_ymouse < __height))));
}
function setDisplayState(state) {
var _local3 = 0;
for ( ; _local3 < clips_.length ; _local3++) {
var _local4 = 0;
for ( ; _local4 < clips_[_local3].length ; _local4++) {
clips_[_local3][_local4]._visible = _local3 == state;
}
}
}
function getDisplayState() {
var _local2 = 0;
for ( ; _local2 < clips_.length ; _local2++) {
if (clips_[_local2][MIDDLE]._visible) {
return(_local2);
}
}
return(UP);
}
function onPress() {
setDisplayState(DOWN);
dispatchEvent({type:"press", target:this});
timer_ = _global.setInterval(this, "onHoldTimer", HOLD_TIMER_DURATION);
}
function onRelease() {
var _local2 = false;
if (timer_ != undefined) {
_local2 = true;
_global.clearInterval(timer_);
timer_ = undefined;
}
dispatchEvent({type:"release", target:this, clicked:_local2});
setDisplayState(OVER);
}
function onReleaseOutside() {
if (timer_ != undefined) {
_global.clearInterval(timer_);
timer_ = undefined;
}
dispatchEvent({type:"releaseOutside", target:this});
setDisplayState(UP);
}
function setFocus() {
Selection.setFocus(this);
}
function onRollOver() {
setDisplayState(OVER);
}
function onRollOut() {
setDisplayState(UP);
}
function onSetFocus() {
setDisplayState(OVER);
}
function onKillFocus() {
setDisplayState(UP);
}
function onDragOut() {
setDisplayState(OVER);
captured_ = true;
}
function onDragOver() {
if (captured_) {
setDisplayState(DOWN);
} else {
setDisplayState(OVER);
}
}
function onHoldTimer() {
_global.clearInterval(timer_);
timer_ = undefined;
dispatchEvent({type:"hold", target:this});
}
function createPayload() {
if (icon_ != "") {
createIcon();
} else if (label_ != "") {
createLabel();
}
}
function createIcon() {
iconClip_.removeMovieClip();
if (icon_ != "") {
iconClip_ = attachMovie(icon_, "iconClip", getNextHighestDepth());
} else {
iconClip_ = undefined;
}
size();
}
function createLabel() {
textFieldClip_.removeTextField();
var _local2 = getNextHighestDepth();
createTextField(TEXT_FIELD_NAME + _local2, _local2, 0, 0, __width, __height);
textFieldClip_ = this[TEXT_FIELD_NAME + _local2];
var _local3 = new TextFormat();
_local3.font = labelFont_;
_local3.size = labelFontSize_;
_local3.color = labelColor_;
_local3.align = "center";
textFieldClip_.setNewTextFormat(_local3);
textFieldClip_.text = label_;
textFieldClip_._visible = true;
if (tabIndex_ != undefined) {
tabChildren = true;
textFieldClip_.focusEnabled = true;
textFieldClip_.tabEnabled = true;
textFieldClip_.tabIndex = tabIndex_;
}
}
function set icon(val) {
if (icon_ != val) {
icon_ = val;
createPayload();
}
//return(icon);
}
function get icon() {
return(icon_);
}
function set label(val) {
if (label_ != val) {
label_ = val;
createPayload();
}
//return(label);
}
function get label() {
return(label_);
}
function set baseName(val) {
if (baseName_ != val) {
var _local3 = getDisplayState();
baseName_ = val;
createButtonClips();
createPayload();
setDisplayState(_local3);
size();
}
//return(baseName);
}
function get baseName() {
return(baseName_);
}
function set tabIndex(val) {
tabIndex_ = val;
//return(tabIndex);
}
function get tabIndex() {
return(tabIndex_);
}
function set labelFont(val) {
labelFont_ = val;
size();
//return(labelFont);
}
function get labelFont() {
return(labelFont_);
}
function set labelFontSize(val) {
labelFontSize_ = val;
size();
//return(labelFontSize);
}
function get labelFontSize() {
return(labelFontSize_);
}
function set labelColor(val) {
labelColor_ = val;
size();
//return(labelColor);
}
function get labelColor() {
return(labelColor_);
}
static var UP = 0;
static var OVER = 1;
static var DOWN = 2;
static var LEFT = 0;
static var MIDDLE = 1;
static var RIGHT = 2;
static var HOLD_TIMER_DURATION = 200;
static var TEXT_FIELD_NAME = "IconButtonTextField";
var captured_ = false;
var icon_ = "";
var label_ = "";
var labelFont_ = "Arial";
var labelFontSize_ = 16;
var labelColor_ = 0;
}
Symbol 20507 MovieClip [__Packages.com.google.ui.common.IconButton] Frame 0
class com.google.ui.common.IconButton extends com.google.ui.common.IconButtonBase
{
function IconButton () {
super();
}
static var classPath = com.google.ui.common.IconButton;
static var linkageName = "__Packages.com.google.ui.common.IconButton";
static var forceLinkage = Object.registerClass(linkageName, classPath);
}
Symbol 20508 MovieClip [__Packages.com.google.video.ui.TitleCardRotator] Frame 0
class com.google.video.ui.TitleCardRotator extends MovieClip
{
var backDrop_, createEmptyMovieClip, getNextHighestDepth, backDropFader_, backBuffer_, backFader_, frontBuffer_, frontFader_, hide_, loaded_, backVisible_, curPos_, rotateId_, imgWidth_, imgHeight_, imgX_, imgY_, playlists_, dispatchEvent, __get__hide;
function TitleCardRotator () {
super();
mx.events.EventDispatcher.initialize(this);
backDrop_ = createEmptyMovieClip("backDrop_", getNextHighestDepth());
var backDrop = backDrop_;
var _local3 = function () {
return(backDrop._alpha);
};
var _local4 = function (val) {
backDrop._alpha = val;
};
backDropFader_ = new com.google.ui.common.SmoothFader(_local3, _local4, 1);
backDrop_._alpha = 0;
backDropFader_.target = 0;
backBuffer_ = createEmptyMovieClip("backBuffer_", getNextHighestDepth());
var backBuffer = backBuffer_;
var _local5 = function () {
return(backBuffer._alpha);
};
var _local6 = function (val) {
backBuffer._alpha = val;
};
backFader_ = new com.google.ui.common.SmoothFader(_local5, _local6, 1);
backBuffer_._alpha = 100;
backFader_.target = 100;
frontBuffer_ = createEmptyMovieClip("frontBuffer_", getNextHighestDepth());
var frontBuffer = frontBuffer_;
var _local7 = function () {
return(frontBuffer._alpha);
};
var _local8 = function (val) {
frontBuffer._alpha = val;
};
frontFader_ = new com.google.ui.common.SmoothFader(_local7, _local8, 1);
frontBuffer_._alpha = 0;
frontFader_.target = 0;
hide_ = false;
loaded_ = false;
backVisible_ = true;
curPos_ = -1;
rotateId_ = _global.setInterval(this, "rotateTitleCard", ROTATE_TIME);
}
function setSize(width, height) {
backDrop_.clear();
backDrop_.lineStyle(0, 0, 0);
backDrop_.beginFill(0, 100);
com.google.ui.common.Drawing.drawRectangle(backDrop_, 0, 0, width, height, 0);
backDrop_.endFill();
imgWidth_ = (height / 3) * 4;
imgHeight_ = (imgWidth_ / 4) * 3;
if ((imgWidth_ > width) || (imgHeight_ > height)) {
imgHeight_ = (width / 4) * 3;
imgWidth_ = (imgHeight_ / 3) * 4;
}
imgX_ = (width - imgWidth_) / 2;
imgY_ = (height - imgHeight_) / 2;
}
function loadFromPlaylists(playlists) {
playlists_ = playlists;
loaded_ = true;
}
function onPress() {
dispatchEvent({type:"clicked", target:this});
}
function loadThumbnail(target, pos) {
var _local4 = pos % playlists_.allItems.length;
var _local5 = playlists_.allItems[_local4].mediagroup;
var _local7 = 0;
for ( ; _local7 < _local5.length ; _local7++) {
if (_local5[_local7].name == "media:thumbnail") {
var _local6 = _local5[_local7].url;
}
}
var _local8 = new Object();
_local8.onLoadInit = com.google.utils.DelegateEx.create(this, onThumbnailLoadInit);
var _local9 = new MovieClipLoader();
_local9.addListener(_local8);
var _local10 = _local9.loadClip(_local6, target);
}
function onThumbnailLoadInit(target) {
if (hide_) {
return(undefined);
}
playlists_.curIndex = curPos_;
dispatchEvent({type:"curIndexUpdated", target:this, curIndex:curPos_, showMetadata:true});
frontFader_.target = (backVisible_ ? 100 : 0);
backDropFader_.target = 100;
backVisible_ = !backVisible_;
loaded_ = true;
target._x = imgX_;
target._y = imgY_;
target._width = imgWidth_;
target._height = imgHeight_;
}
function rotateTitleCard() {
if (hide_) {
_global.clearInterval(rotateId_);
return(undefined);
}
if (!loaded_) {
return(undefined);
}
var _local2 = 0;
while (_local2 < playlists_.allItems.length) {
curPos_ = (curPos_ + 1) % playlists_.allItems.length;
if (playlists_.allItems[curPos_]["gm:cpa_choice"] == undefined) {
break;
}
_local2++;
}
loaded_ = false;
loadThumbnail((backVisible_ ? (frontBuffer_) : (backBuffer_)), curPos_);
}
function set hide(val) {
hide_ = val;
if (backVisible_) {
frontBuffer_._visible = false;
} else {
backBuffer_._visible = false;
}
backDropFader_.target = 0;
frontFader_.target = 0;
backFader_.target = 0;
//return(__get__hide());
}
static var classPath = com.google.video.ui.TitleCardRotator;
static var linkageName = "__Packages.com.google.video.ui.TitleCardRotator";
static var forceLinkage = Object.registerClass(linkageName, classPath);
static var ROTATE_TIME = 4000;
}
Symbol 20509 MovieClip [__Packages.com.google.video.apps.VideoPlaybackStats] Frame 0
class com.google.video.apps.VideoPlaybackStats
{
var videoPlayback_, mediaPlayer_, running_, timers_, percentViewed, mediaTime_, startTime_, startBytes_, lastBytes_, firstFrameLatency_, estimatedBandwidth_, lastSourceStatusTime_, countStopPlaying_, playerState_;
function VideoPlaybackStats (videoPlayback) {
mx.events.EventDispatcher.initialize(this);
videoPlayback_ = videoPlayback;
mediaPlayer_ = videoPlayback.mediaPlayer;
running_ = false;
timers_ = new Object();
percentViewed = new Object();
mediaPlayer_.addEventListener("stateChange", com.google.utils.DelegateEx.create(this, onPlayerStateChange));
mediaPlayer_.addEventListener("onStatus", com.google.utils.DelegateEx.create(this, onSourceStatus));
mediaPlayer_.addEventListener("onNewSegment", com.google.utils.DelegateEx.create(this, onNewSegment));
mediaPlayer_.addEventListener("playProgressUpdated", com.google.utils.DelegateEx.create(this, onPlayProgressUpdated));
videoPlayback_.controlBar.addEventListener("prevItem", com.google.utils.DelegateEx.create(this, onPrevItem));
videoPlayback_.controlBar.addEventListener("nextItem", com.google.utils.DelegateEx.create(this, onNextItem));
}
function dispatchEvent() {
}
function addEventListener() {
}
function removeEventListener() {
}
function setReportTime(timings) {
timers_ = new Object();
percentViewed = new Object();
for (var i in timings) {
if (timings[i].charAt(timings[i].length - 1) == "%") {
percentViewed[timings[i]] = false;
} else {
timers_[timings[i]] = undefined;
}
}
}
function start() {
mediaTime_ = mediaPlayer_.time;
running_ = true;
startTime_ = getTimer();
startBytes_ = mediaPlayer_.bytesLoaded;
lastBytes_ = startBytes_;
firstFrameLatency_ = 0;
estimatedBandwidth_ = 0;
lastSourceStatusTime_ = 0;
countStopPlaying_ = 0;
playerState_ = com.google.ui.media.MediaPlayer.STATE_PAUSED;
for (var reporttime in timers_) {
if (timers_[reporttime] != undefined) {
_global.clearInterval(timers_[reporttime]);
}
timers_[reporttime] = _global.setInterval(this, "report", Number(reporttime), reporttime);
}
for (var key in percentViewed) {
percentViewed[key] = false;
}
}
function stop() {
running_ = false;
for (var reporttime in timers_) {
if (timers_[reporttime] != undefined) {
_global.clearInterval(timers_[reporttime]);
timers_[reporttime] = undefined;
}
}
for (var key in percentViewed) {
percentViewed[key] = false;
}
}
function report(reportevent) {
if (!running_) {
return(undefined);
}
mediaTime_ = mediaPlayer_.time;
var _local3 = getTimer() - startTime_;
updateEstimatedBandwidth(_local3);
var _local4 = mediaTime_ * 1000;
var _local5 = Math.round(estimatedBandwidth_);
var _local6 = new Object();
if (videoPlayback_.docid != undefined) {
_local6.docid = videoPlayback_.docid;
_local6.docidpos = videoPlayback_.docidPosition;
_local6.plsize = videoPlayback_.playlistSize;
_local6.ad = videoPlayback_.isAd;
_local6.duration = videoPlayback_.docidDuration;
for (var key in videoPlayback_.reportParams) {
_local6[key] = videoPlayback_.reportParams[key];
}
}
_local6.reportevent = _global.escape(reportevent);
_local6.segmenttime = _local3;
_local6.mediatime = _local4;
_local6.bandwidth = _local5;
_local6.stops = countStopPlaying_;
if (reportevent == "start") {
_local6.latency = firstFrameLatency_;
}
var _local7 = new Object();
_local7.type = "reportEvent";
_local7.stats = _local6;
dispatchEvent(_local7);
if (timers_[reportevent] != undefined) {
_global.clearInterval(timers_[reportevent]);
timers_[reportevent] = undefined;
}
if (percentViewed[reportevent] == false) {
percentViewed[reportevent] = true;
}
countStopPlaying_ = 0;
}
function onPlayerStateChange(evtObj) {
mediaTime_ = mediaPlayer_.time;
var _local3 = getTimer() - startTime_;
updateEstimatedBandwidth(_local3);
if (((evtObj.oldState == com.google.ui.media.MediaPlayer.STATE_PAUSED) || ((evtObj.oldState == com.google.ui.media.MediaPlayer.STATE_FASTFORWARD) || (evtObj.oldState == com.google.ui.media.MediaPlayer.STATE_REWIND))) && (evtObj.newState == com.google.ui.media.MediaPlayer.STATE_BUFFERING)) {
start();
}
if ((evtObj.oldState == com.google.ui.media.MediaPlayer.STATE_PAUSED) && (evtObj.newState == com.google.ui.media.MediaPlayer.STATE_PLAYING)) {
start();
report("start");
}
if ((evtObj.oldState == com.google.ui.media.MediaPlayer.STATE_BUFFERING) && (evtObj.newState == com.google.ui.media.MediaPlayer.STATE_PLAYING)) {
if (firstFrameLatency_ == 0) {
firstFrameLatency_ = _local3;
report("start");
}
}
if ((evtObj.oldState == com.google.ui.media.MediaPlayer.STATE_PLAYING) && (evtObj.newState == com.google.ui.media.MediaPlayer.STATE_PAUSED)) {
report("pause");
stop();
}
if ((evtObj.oldState == com.google.ui.media.MediaPlayer.STATE_PLAYING) && (evtObj.newState == com.google.ui.media.MediaPlayer.STATE_COMPLETED)) {
report("finish");
stop();
}
playerState_ = evtObj.newState;
}
function onPrevItem(evtObj) {
if ((videoPlayback_.docidPosition > 0) && (!videoPlayback_.inLoopMode)) {
report("prev");
}
}
function onNextItem(evtObj) {
if (((videoPlayback_.docidPosition + 1) < videoPlayback_.playlistSize) && (!videoPlayback_.inLoopMode)) {
report("next");
}
}
function onNewSegment(evtObj) {
report("seek");
start();
}
function onPlayProgressUpdated(evtObj) {
var _local3 = mediaPlayer_.duration;
if (_local3 == 0) {
return(undefined);
}
var _local4 = (evtObj.newTime * 100) / _local3;
for (var key in percentViewed) {
if (percentViewed[key]) {
continue;
}
var _local5 = key.substr(0, key.length - 1);
if (Number(_local5) <= _local4) {
report(key);
return(undefined);
}
}
}
function onSourceStatus(evtObj) {
if (!running_) {
return(undefined);
}
mediaTime_ = mediaPlayer_.time;
var _local3 = getTimer() - startTime_;
updateEstimatedBandwidth(_local3);
if ((playerState_ == com.google.ui.media.MediaPlayer.STATE_PLAYING) && ((mediaTime_ != lastSourceStatusTime_) && ((evtObj != null) && (evtObj.code == "NetStream.Play.Stop")))) {
countStopPlaying_++;
lastSourceStatusTime_ = mediaTime_;
}
}
function updateEstimatedBandwidth(elapsedTime) {
if (!running_) {
return(undefined);
}
var _local3 = mediaPlayer_.bytesLoaded;
var _local4 = _local3 - startBytes_;
var _local5 = _local3 - lastBytes_;
lastBytes_ = _local3;
if ((_local5 > 0) && (elapsedTime > 0)) {
estimatedBandwidth_ = _local4 / (elapsedTime / 1000);
}
}
}
Symbol 20510 MovieClip [__Packages.com.google.comm.ProxyStub] Frame 0
class com.google.comm.ProxyStub
{
var targetConnection_;
function ProxyStub (targetId) {
mx.events.EventDispatcher.initialize(this);
targetConnection_ = new LocalConnection();
targetConnection_.allowDomain = function () {
return(true);
};
targetConnection_.connect(targetId);
}
function setHandler(name, handler) {
targetConnection_[name] = handler;
}
}
Symbol 20511 MovieClip [__Packages.com.google.media.VideoSegment] Frame 0
class com.google.media.VideoSegment
{
var startTime, endTime, segmentLength, segmentBytes, readMetaTag_, transitions_, netStream, firstReceivedTime, firstReceivedSize, downloadStartTime, dispatchEvent;
function VideoSegment () {
mx.events.EventDispatcher.initialize(this);
}
function init(url, startTime, endTime, netConn, netStream) {
this.startTime = startTime;
this.endTime = endTime;
segmentLength = 0;
segmentBytes = 0;
readMetaTag_ = false;
transitions_ = new Array();
if ((netStream == undefined) || (netStream == null)) {
this.netStream = new NetStream(netConn);
} else {
this.netStream = netStream;
}
this.netStream.setBufferTime(1);
this.netStream.onStatus = com.google.utils.DelegateEx.create(this, onStatus);
this.netStream.onMetaData = com.google.utils.DelegateEx.create(this, onMetaData);
this.netStream.onTransition = com.google.utils.DelegateEx.create(this, onTransition);
firstReceivedTime = undefined;
firstReceivedSize = undefined;
downloadStartTime = getTimer();
this.netStream.play(url);
}
function onStatus(infoObject) {
if (infoObject.code == "NetStream.Buffer.Empty") {
}
var _local3 = new Object();
_local3.type = "onStatus";
_local3.target = this;
_local3.level = infoObject.level;
_local3.code = infoObject.code;
dispatchEvent(_local3);
}
function onMetaData(infoObject) {
readMetaTag_ = true;
if (infoObject.starttime != undefined) {
startTime = infoObject.starttime;
} else if ((infoObject.tags != undefined) && (infoObject.tags.gsst != undefined)) {
startTime = Number(infoObject.tags.gsst) / 1000;
} else {
startTime = 0;
}
var _local3 = infoObject.duration;
if (infoObject.totalduration != undefined) {
_local3 = infoObject.totalduration;
} else if ((infoObject.tags != undefined) && (infoObject.tags.gstd != undefined)) {
_local3 = Number(infoObject.tags.gstd) / 1000;
}
endTime = _local3 - startTime;
segmentLength = infoObject.duration;
segmentBytes = netStream.bytesTotal;
if ((netStream.bytesTotal != -1) && (netStream.bytesTotal == netStream.bytesLoaded)) {
segmentBytes = -1;
}
infoObject.type = "onMetaData";
infoObject.target = this;
dispatchEvent(infoObject);
}
function onTransition(infoObject) {
if (readMetaTag_) {
infoObject.type = "onTransition";
infoObject.target = this;
dispatchEvent(infoObject);
} else {
transitions_.push({width:infoObject.width, height:infoObject.height, timestamp:infoObject.timestamp});
}
}
function get transitions() {
return(transitions_);
}
function get readMetaDataTag() {
return(readMetaTag_);
}
}
Symbol 20512 MovieClip [__Packages.com.google.utils.DelegateEx] Frame 0
class com.google.utils.DelegateEx
{
function DelegateEx () {
}
static function create(scope, handler, context) {
var extraArgs = arguments.slice(2);
var _local3 = function () {
return(handler.apply(scope, arguments.concat(extraArgs)));
};
return(_local3);
}
}
Symbol 20513 MovieClip [__Packages.com.google.video.ui.PlaylistOpenButton] Frame 0
class com.google.video.ui.PlaylistOpenButton extends com.google.video.ui.TransparentButton
{
var text_, attachMovie, getNextHighestDepth, lineStyle, state, beginFill, endFill, beginGradientFill, direction_, redraw;
function PlaylistOpenButton () {
super();
text_ = com.google.ui.common.StylishText(attachMovie(com.google.ui.common.StylishText.linkageName, "text_", getNextHighestDepth(), {size:11, color:16777215, style:com.google.ui.common.StylishText.BOLD}));
text_._y = 1;
direction = SOUTH;
}
function drawButtonContainer() {
var _local2 = 2.5;
var _local3 = 2.5;
var _local4 = WIDTH;
var _local5 = 14;
lineStyle(1, 16777215, 20);
if (state == com.google.video.ui.SimpleButton.UP) {
beginFill(3368601, 40);
} else if (state == com.google.video.ui.SimpleButton.OVER) {
beginFill(6724044, 40);
} else if (state == com.google.video.ui.SimpleButton.DOWN) {
beginFill(4487082, 40);
}
com.google.ui.common.Drawing.drawRectangle(this, _local2, _local3, _local4, _local5, 4);
endFill();
var _local6 = {a:0, b:_local5, c:0, d:-_local5, e:0, f:0, g:0, h:0, i:1};
lineStyle(0, 0, 0);
beginGradientFill("linear", [16777215, 16777215], [40, 0], [0, 255], _local6);
com.google.ui.common.Drawing.drawRectangle(this, _local2 + 1, _local3 + 1, _local4 - 1, 9, 4);
endFill();
}
function get direction() {
return(direction_);
}
function set direction(val) {
direction_ = val;
if (direction_ == SOUTH) {
text_.text = "Hide Playlists";
} else {
text_.text = "Show Playlists";
}
text_._x = (WIDTH - text_.width) / 2;
redraw();
//return(direction);
}
static var classPath = com.google.video.ui.PlaylistOpenButton;
static var linkageName = "__Packages.com.google.video.ui.PlaylistOpenButton";
static var forceLinkage = Object.registerClass(linkageName, classPath);
static var NORTH = 0;
static var SOUTH = 1;
static var WIDTH = 84;
}
Symbol 20514 MovieClip [__Packages.com.google.video.subtitle.SubtitleFrame] Frame 0
class com.google.video.subtitle.SubtitleFrame
{
var startTime_, endTime_, content_;
function SubtitleFrame (start_t, end_t, content) {
setAll(start_t, end_t, content);
}
function setAll(start_t, end_t, content) {
startTime_ = start_t;
endTime_ = end_t;
content_ = content;
}
function addToContent(text) {
content_.push(text);
}
function get startTime() {
return(startTime_);
}
function get endTime() {
return(endTime_);
}
function get content() {
return(content_);
}
}
Symbol 20515 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 () {
if (data != undefined) {
arguments.push(data);
}
return(handler.apply(scope, arguments));
};
_local2.scope = scope;
return(_local2);
}
}
Symbol 20516 MovieClip [__Packages.com.google.utils.DownloadTimer] Frame 0
class com.google.utils.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);
}
function getSize() {
return(endBytes - startBytes);
}
}
Symbol 20517 MovieClip [__Packages.com.google.ui.common.IconHalfButton] Frame 0
class com.google.ui.common.IconHalfButton extends com.google.ui.common.IconButtonBase
{
var openHalf_, getDisplayState, spacingRatio_, __get__spacingRatio, clips_, __width, __height, iconClip_, textFieldClip_;
function IconHalfButton () {
super();
openHalf = OPEN_NONE;
spacingRatio = SPACING_RATIO_DEFAULT;
}
function set openHalf(val) {
if (openHalf_ != val) {
openHalf_ = val;
setDisplayState(getDisplayState());
size();
}
//return(openHalf);
}
function get openHalf() {
return(openHalf_);
}
function set spacingRatio(val) {
if (spacingRatio_ != val) {
spacingRatio_ = val;
size();
}
//return(__get__spacingRatio());
}
function setOpenHalfAndSpacingRatio(half, ratio) {
if ((openHalf_ != half) || (spacingRatio_ != ratio)) {
openHalf_ = half;
spacingRatio_ = ratio;
setDisplayState(getDisplayState());
size();
}
}
function size() {
var _local4 = 0;
for ( ; _local4 < clips_.length ; _local4++) {
var _local2 = 0;
var _local3 = __width;
if ((openHalf_ != OPEN_BOTH) && (openHalf_ != OPEN_LEFT)) {
clips_[_local4][com.google.ui.common.IconButtonBase.LEFT]._x = 0;
clips_[_local4][com.google.ui.common.IconButtonBase.LEFT]._y = 0;
clips_[_local4][com.google.ui.common.IconButtonBase.LEFT]._width = clips_[_local4][com.google.ui.common.IconButtonBase.LEFT].naturalWidth;
clips_[_local4][com.google.ui.common.IconButtonBase.LEFT]._height = __height;
_local2 = clips_[_local4][com.google.ui.common.IconButtonBase.LEFT]._width;
}
if ((openHalf_ != OPEN_BOTH) && (openHalf_ != OPEN_RIGHT)) {
clips_[_local4][com.google.ui.common.IconButtonBase.RIGHT]._width = clips_[_local4][com.google.ui.common.IconButtonBase.RIGHT].naturalWidth;
clips_[_local4][com.google.ui.common.IconButtonBase.RIGHT]._height = __height;
clips_[_local4][com.google.ui.common.IconButtonBase.RIGHT]._x = __width - clips_[_local4][com.google.ui.common.IconButtonBase.RIGHT]._width;
clips_[_local4][com.google.ui.common.IconButtonBase.RIGHT]._y = 0;
_local3 = clips_[_local4][com.google.ui.common.IconButtonBase.RIGHT]._x;
}
clips_[_local4][com.google.ui.common.IconButtonBase.MIDDLE]._x = _local2;
clips_[_local4][com.google.ui.common.IconButtonBase.MIDDLE]._y = 0;
clips_[_local4][com.google.ui.common.IconButtonBase.MIDDLE]._width = _local3 - _local2;
clips_[_local4][com.google.ui.common.IconButtonBase.MIDDLE]._height = __height;
}
if (iconClip_ != undefined) {
iconClip_._x = (__width - iconClip_._width) * spacingRatio_;
iconClip_._y = (__height - iconClip_._height) * 0.5;
} else {
textFieldClip_._width = __width;
textFieldClip_._height = __height;
textFieldClip_._x = ((__width - textFieldClip_._width) * spacingRatio_) + 1;
textFieldClip_._y = ((__height - textFieldClip_._height) * 0.5) + 1;
}
}
function setDisplayState(state) {
var _local3 = 0;
for ( ; _local3 < clips_.length ; _local3++) {
clips_[_local3][com.google.ui.common.IconButtonBase.LEFT]._visible = (_local3 == state) && ((openHalf_ != OPEN_BOTH) && (openHalf_ != OPEN_LEFT));
clips_[_local3][com.google.ui.common.IconButtonBase.RIGHT]._visible = (_local3 == state) && ((openHalf_ != OPEN_BOTH) && (openHalf_ != OPEN_RIGHT));
clips_[_local3][com.google.ui.common.IconButtonBase.MIDDLE]._visible = _local3 == state;
}
}
static var classPath = com.google.ui.common.IconHalfButton;
static var linkageName = "__Packages.com.google.ui.common.IconHalfButton";
static var forceLinkage = Object.registerClass(linkageName, classPath);
static var OPEN_NONE = "none";
static var OPEN_LEFT = "left";
static var OPEN_RIGHT = "right";
static var OPEN_BOTH = "both";
static var SPACING_RATIO_DEFAULT = 0.5;
}
Symbol 20518 MovieClip [__Packages.com.google.utils.StringUtils] Frame 0
class com.google.utils.StringUtils
{
function StringUtils () {
}
static function beginsWith(str, beginning) {
if ((str == undefined) || ((str == null) || ((!str.length) || ((beginning == undefined) || ((beginning == null) || ((!beginning.length) || (str.length < beginning.length))))))) {
return(false);
}
var _local4 = 0;
for ( ; _local4 < beginning.length ; _local4++) {
if (str.charAt(_local4) != beginning.charAt(_local4)) {
return(false);
}
}
return(true);
}
static function endsWith(str, ending) {
if ((str == undefined) || ((str == null) || ((!str.length) || ((ending == undefined) || ((ending == null) || ((!ending.length) || (str.length < ending.length))))))) {
return(false);
}
return(str.lastIndexOf(ending) == (str.length - ending.length));
}
static function FormatTime(time, opt_skipZeros) {
time = Math.floor(time);
var _local4 = time % 60;
var _local5 = Math.floor((time / 60) % 60);
var _local6 = Math.floor(time / 3600);
var _local7 = "";
if (_local6 > 0) {
_local7 = _local7 + (_local6 + ":");
}
if ((_local5 < 10) && ((_local6 > 0) || (!opt_skipZeros))) {
_local7 = _local7 + "0";
}
_local7 = _local7 + (_local5 + ":");
if (_local4 < 10) {
_local7 = _local7 + "0";
}
_local7 = _local7 + String(_local4);
return(_local7);
}
static function trim(str) {
if ((str == undefined) || (str == null)) {
return(str);
}
var _local3 = " \t\n\r";
var _local4 = 0;
// unexpected jump
do {
_local4++;
if (_local4 >= str.length) {
break;
}
} while (_local3.indexOf(str.charAt(_local4)) >= 0);
var _local5 = str.length - 1;
// unexpected jump
do {
_local5--;
if (_local5 < _local4) {
break;
}
} while (_local3.indexOf(str.charAt(_local5)) >= 0);
if (_local4 > _local5) {
return("");
}
return(str.substring(_local4, _local5 + 1));
}
static function truncate(str, num) {
if (str.length <= num) {
return(str);
}
return(str.substr(0, num - 3) + "...");
}
static function replace(str, pat, rep) {
if ((str == undefined) || ((pat == undefined) || (pat == ""))) {
return(str);
}
if (rep == undefined) {
rep = "";
}
return(str.split(pat).join(rep));
}
static function isEmpty(str) {
return((str == null) || ((str == undefined) || (str == "")));
}
static function isAlphaNumeric(ascii) {
return(((ascii > 64) && (ascii < 91)) || (((ascii > 96) && (ascii < 123)) || ((ascii > 47) && (ascii < 58))));
}
static function xmlDecode(str) {
str = replace(str, "&", "&");
str = replace(str, """, "\"");
str = replace(str, "'", "'");
str = replace(str, ">", ">");
str = replace(str, "<", "<");
return(str);
}
static function parseTime(str) {
var _local3 = parseColonTime(str);
if (_global.isNaN(_local3)) {
_local3 = parseEnglishTime(str);
}
return(_local3);
}
static function parseColonTime(str) {
var _local3 = str.split(":");
if ((!_local3) || ((!_local3.length) || (_local3.length > 3))) {
return(_global.NaN);
}
var _local4 = ((_global.parseFloat(_local3[0] + "1") < 0) ? -1 : 1);
var _local5 = _local3.length;
var _local6 = Math.max(0, _local3.length - 1);
var _local7 = Math.max(0, _local3.length - 2);
var _local8 = Math.abs(_global.parseFloat(_local3[_local5 - 1]));
if (_local6) {
_local8 = _local8 + (Math.abs(_global.parseInt(_local3[_local6 - 1])) * 60);
}
if (_local7) {
_local8 = _local8 + (Math.abs(_global.parseInt(_local3[_local7 - 1])) * 3600);
}
return(_local4 * _local8);
}
static function parseEnglishTime(str) {
var _local3 = 0;
if (str.indexOf("h") != -1) {
var _local4 = str.split("h");
if (!_local5) {
var _local5 = ((_global.parseFloat(_local4[0] + "1") < 0) ? -1 : 1);
}
_local3 = _local3 + (Math.abs(_global.parseInt(_local4[0])) * 3600);
str = _local4[1];
}
if (str.indexOf("m") != -1) {
var _local4 = str.split("m");
if (!_local5) {
var _local5 = ((_global.parseFloat(_local4[0] + "1") < 0) ? -1 : 1);
}
_local3 = _local3 + (Math.abs(_global.parseInt(_local4[0])) * 60);
str = _local4[1];
}
if (str.indexOf("s") != -1) {
var _local4 = str.split("s");
if (!_local5) {
var _local5 = ((_global.parseFloat(_local4[0] + "1") < 0) ? -1 : 1);
}
_local3 = _local3 + Math.abs(_global.parseFloat(_local4[0]));
}
if (!_local3) {
return(_global.parseFloat(str));
}
return(_local5 * _local3);
}
}
Symbol 20519 MovieClip [__Packages.com.google.utils.UrlConstructor] Frame 0
class com.google.utils.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 _local3 = baseUrl_;
var _local4 = hasParameter_;
for (var key in args) {
if (_local4) {
_local3 = _local3 + "&";
}
_local3 = _local3 + ((key + "=") + args[key]);
_local4 = true;
}
return(_local3);
}
}
Symbol 20520 MovieClip [__Packages.com.google.video.ui.ButtonFader] Frame 0
class com.google.video.ui.ButtonFader extends com.google.video.ui.TransparentButton
{
var showButton_, curIntensity_, decayRate_, wakeup_, state, _alpha, __get__showButton, __get__wakeup;
function ButtonFader () {
super();
showButton_ = true;
curIntensity_ = 132;
decayRate_ = -4;
}
function onEnterFrame() {
var _local2 = 0;
if (showButton_ || (wakeup_ || (state == com.google.video.ui.SimpleButton.OVER))) {
_local2 = 100 + HOLD_TIME;
}
if (curIntensity_ != _local2) {
curIntensity_ = curIntensity_ + ((curIntensity_ < _local2) ? 8 : (decayRate_));
_alpha = ((curIntensity_ > 100) ? 100 : (curIntensity_));
} else {
wakeup_ = false;
}
}
function set showButton(val) {
showButton_ = val;
//return(__get__showButton());
}
function set wakeup(val) {
wakeup_ = val;
//return(__get__wakeup());
}
static var classPath = com.google.video.ui.ButtonFader;
static var linkageName = "__Packages.com.google.video.ui.ButtonFader";
static var forceLinkage = Object.registerClass(linkageName, Function(classPath));
static var HOLD_TIME = 36;
}
Symbol 20521 MovieClip [__Packages.com.google.video.ui.PlayPauseButton] Frame 0
class com.google.video.ui.PlayPauseButton extends com.google.video.ui.ButtonFader
{
var showPlay_, redraw, lineStyle, beginFill, endFill, state, beginGradientFill, showButton_, mouseOverVideo_, showingMetadata_, __get__showPlay, wakeup_, __get__mouseOverVideo, __get__showingMetadata;
function PlayPauseButton () {
super();
showPlay_ = true;
redraw();
}
function drawButtonContents() {
lineStyle(0, 0, 0);
if (showPlay_) {
beginFill(16777215, 100);
com.google.ui.common.Drawing.drawTriangle(this, 16, 4, 32, 12, 16, 20, 1);
} else {
beginFill(15658734, 100);
com.google.ui.common.Drawing.drawRectangle(this, 18, 4, 4, 16, 2);
com.google.ui.common.Drawing.drawRectangle(this, 26, 4, 4, 16, 2);
}
endFill();
}
function drawButtonContainer() {
var _local2 = 0;
var _local3 = 0;
var _local4 = 48;
var _local5 = 24;
var _local6 = {a:0, b:24, c:0, d:-24, e:0, f:0, g:0, h:0, i:1};
if (showPlay_) {
lineStyle(4, 3368601, 40);
beginFill(0, 0);
com.google.ui.common.Drawing.drawRectangle(this, _local2, _local3, _local4, _local5, 3);
endFill(0, 0);
lineStyle(2, 16777215, 100);
if (state == com.google.video.ui.SimpleButton.UP) {
beginGradientFill("linear", [6724044, 3368601], [100, 100], [0, 255], _local6);
com.google.ui.common.Drawing.drawRectangle(this, _local2, _local3, _local4, _local5, 3);
} else if (state == com.google.video.ui.SimpleButton.OVER) {
beginGradientFill("linear", [7842525, 4487082], [100, 100], [0, 255], _local6);
com.google.ui.common.Drawing.drawRectangle(this, _local2, _local3, _local4, _local5, 3);
} else {
beginGradientFill("linear", [5605563, 2250120], [100, 100], [0, 255], _local6);
com.google.ui.common.Drawing.drawRectangle(this, _local2, _local3, _local4, _local5, 3);
}
endFill();
} else {
lineStyle(2, 15658734, 100);
if (state == com.google.video.ui.SimpleButton.UP) {
beginGradientFill("linear", [9803157, 6513507], [100, 100], [0, 255], _local6);
com.google.ui.common.Drawing.drawRectangle(this, _local2, _local3, _local4, _local5, 3);
} else if (state == com.google.video.ui.SimpleButton.OVER) {
beginGradientFill("linear", [10921638, 7631988], [100, 100], [0, 255], _local6);
com.google.ui.common.Drawing.drawRectangle(this, _local2, _local3, _local4, _local5, 3);
} else {
beginGradientFill("linear", [8684676, 5460819], [100, 100], [0, 255], _local6);
com.google.ui.common.Drawing.drawRectangle(this, _local2, _local3, _local4, _local5, 3);
}
endFill();
}
}
function set showPlay(val) {
if (val != showPlay_) {
showPlay_ = val;
showButton_ = showPlay_ || (mouseOverVideo_ || (showingMetadata_));
redraw();
}
//return(__get__showPlay());
}
function set mouseOverVideo(val) {
if (val != mouseOverVideo_) {
mouseOverVideo_ = val;
showButton_ = showPlay_ || (mouseOverVideo_ || (showingMetadata_));
wakeup_ = true;
redraw();
}
//return(__get__mouseOverVideo());
}
function set showingMetadata(val) {
if (val != showingMetadata_) {
showingMetadata_ = val;
showButton_ = showPlay_ || (mouseOverVideo_ || (showingMetadata_));
wakeup_ = true;
redraw();
}
//return(__get__showingMetadata());
}
static var classPath = com.google.video.ui.PlayPauseButton;
static var linkageName = "__Packages.com.google.video.ui.PlayPauseButton";
static var forceLinkage = Object.registerClass(linkageName, Function(classPath));
}
Symbol 20522 MovieClip [__Packages.com.google.logs.Logger] Frame 0
class com.google.logs.Logger
{
static var xmlDoc_;
var area_, instance_;
function Logger (area) {
area_ = area;
instance_ = InstanceNumber++;
}
static function enableLogging(enabled) {
if (enabled) {
slog = slogImpl;
} else {
slog = function () {
};
}
}
static function slog(instance, area, level, message) {
}
static function slogImpl(instance, area, level, message) {
if (!loaded_) {
LoadLevels();
var _local6 = new Object();
_local6.instance = instance;
_local6.area = area;
_local6.level = level;
_local6.message = message;
queuedLogs_.push(_local6);
return(undefined);
}
if (levels_[area] >= level) {
var _local7 = (((((area + "-") + instance) + "(") + level) + "): ") + message;
_global.logListener.output(_local7);
}
}
function log(level, message) {
slog(instance_, area_, level, message);
}
static function serror(instance, area, message) {
}
function error(message) {
serror(instance_, area_, message);
}
static function LoadLevels() {
if (loading_) {
return(undefined);
}
loading_ = true;
xmlDoc_ = new XML();
xmlDoc_.load("FlashVideoDebug.xml");
xmlDoc_.onLoad = OnXMLLoaded;
}
static function OnXMLLoaded(succeeded) {
var _local3 = xmlDoc_.firstChild;
while (_local3) {
if (_local3.nodeName == "Logger") {
var _local4 = _local3.firstChild;
while (_local4) {
if (_local4.nodeName == "Level") {
var _local5 = _local4.attributes.area;
var _local6 = _local4.attributes.level;
levels_[_local5] = _local6;
}
_local4 = _local4.nextSibling;
}
}
_local3 = _local3.nextSibling;
}
loaded_ = true;
loading_ = false;
if (queuedLogs_.length > 0) {
}
var _local7 = 0;
for ( ; _local7 < queuedLogs_.length ; _local7++) {
slog(queuedLogs_[_local7].instance, queuedLogs_[_local7].area, queuedLogs_[_local7].level, queuedLogs_[_local7].message);
}
delete queuedLogs_;
}
static var InstanceNumber = 1;
static var loading_ = false;
static var loaded_ = false;
static var levels_ = new Array();
static var queuedLogs_ = new Array();
}
Symbol 20523 MovieClip [__Packages.com.google.utils.SecurityUtils] Frame 0
class com.google.utils.SecurityUtils
{
function SecurityUtils () {
}
static function hasValidUrlScheme(url) {
return(com.google.utils.StringUtils.beginsWith(url, "http:") || (com.google.utils.StringUtils.beginsWith(url, "https:") || (com.google.utils.StringUtils.beginsWith(url, "ftp:"))));
}
static function hasUrlDirectoryTraversal(url) {
var _local3 = _global.unescape(url).toUpperCase();
return((_local3.indexOf("..") >= 0) || ((_local3.indexOf(".%2E") >= 0) || ((_local3.indexOf("%2E.") >= 0) || (_local3.indexOf("%2E%2E") >= 0))));
}
static function isSafeUrl(url) {
return(hasValidUrlScheme(url) && (!hasUrlDirectoryTraversal(url)));
}
}
Symbol 20524 MovieClip [__Packages.com.google.utils.VideoStats] Frame 0
class com.google.utils.VideoStats
{
static var downloadPerfLoaded_, downloadPerf_;
var urlBase_, namespace_, parameters_, playbackStarted_, startTimes_, endTimes_, sendSegments_, lastBufferEmptyEvents_, thresholdCount_, multipleInterval_, eventReporter_, sendDownloadData_, getBytesDownloaded, recordedDownloadPerformance_, downloadTimer_, downloadPerformanceTimer_, numSegments_, numSegmentsSent_, startTime_, lastMediaTime_, getMediaTime, lastRealTime_, segmentStart_, sendInterval_, lastReportedPlaybackDelay, totalPlaybackDelay, lastPlaybackDelay, sentInitialPing_, sentTimeoutPing_, mediaInterval_, count_, lastBytes_, getPlayerState, getMediaDuration, getVideoDownloadRetries, getBufferEmptyEvents;
function VideoStats (urlBase, namespace, parameters) {
urlBase_ = urlBase;
namespace_ = namespace;
parameters_ = {};
for (var key in parameters) {
if ((typeof(parameters[key]) == "string") || (typeof(parameters[key]) == "number")) {
parameters_[key] = parameters[key];
}
}
playbackStarted_ = false;
startTimes_ = new Array();
endTimes_ = new Array();
sendSegments_ = false;
lastBufferEmptyEvents_ = 0;
downloadPerfLoaded_ = false;
thresholdCount_ = 3;
multipleInterval_ = 4;
}
function setEventReporterParameters(eventReporter, docid, sw) {
if ((namespace_ != undefined) && (namespace_ != "")) {
eventReporter.addGlobalParameters({ns:namespace_});
}
eventReporter.addGlobalParameters({docid:docid});
if (sw != undefined) {
eventReporter.addGlobalParameters({sw:sw});
}
eventReporter.addGlobalParameters(parameters_);
}
function sendEventPoint(docid, samplingWeight, args) {
var _local5 = new com.google.utils.EventReporter(urlBase_);
setEventReporterParameters(_local5, docid, samplingWeight);
_local5.send(args);
}
function startPlayback(docid, sw) {
if (playbackStarted_) {
endPlayback();
}
playbackStarted_ = true;
if (eventReporter_ == undefined) {
eventReporter_ = new com.google.utils.EventReporter(urlBase_);
setEventReporterParameters(eventReporter_, docid, sw);
}
if (sw != undefined) {
sendSegments_ = true;
}
loadBandwidthData();
var _local4 = 0;
var _local5 = 0;
for (var index in downloadPerf_) {
_local4 = _local4 + downloadPerf_[index].bytes;
_local5 = _local5 + downloadPerf_[index].time;
}
if ((_local4 > 0) && (_local5 > 0)) {
eventReporter_.addGlobalParameters({hbd:_local4});
eventReporter_.addGlobalParameters({hbt:_local5});
}
sendDownloadData_ = false;
var _local6 = getBytesDownloaded();
var _local7 = getTimerInSeconds();
recordedDownloadPerformance_ = false;
downloadTimer_ = new com.google.utils.DownloadTimer(_local6, _local7);
downloadPerformanceTimer_ = new com.google.utils.DownloadTimer(_local6, _local7);
numSegments_ = 0;
numSegmentsSent_ = 0;
startTime_ = _local7;
lastMediaTime_ = getMediaTime();
lastRealTime_ = startTime_;
segmentStart_ = lastMediaTime_;
sendInterval_ = null;
lastReportedPlaybackDelay = 0;
totalPlaybackDelay = 0;
lastPlaybackDelay = 0;
sentInitialPing_ = false;
sentTimeoutPing_ = false;
mediaInterval_ = _global.setInterval(this, "mediaUpdate", 100);
}
function endPlayback() {
if (playbackStarted_) {
playbackStarted_ = false;
if (mediaInterval_ != null) {
_global.clearInterval(mediaInterval_);
}
if (sendInterval_ != null) {
_global.clearInterval(sendInterval_);
}
addSegment();
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 _local2 = getBytesDownloaded();
var _local3 = getMediaTime();
var _local4 = getTimerInSeconds();
downloadTimer_.addData(_local2, _local4);
downloadPerformanceTimer_.addData(_local2, _local4);
lastBytes_ = _local2;
if ((!recordedDownloadPerformance_) && (downloadPerformanceTimer_.getSize() >= BW_SAMPLE_SIZE)) {
recordedDownloadPerformance_ = true;
var _local5 = new Object();
_local5.bytes = downloadPerformanceTimer_.getSize();
_local5.time = downloadPerformanceTimer_.getDuration();
if (downloadPerf_.length > BW_MAX_SAMPLES) {
downloadPerf_.shift();
}
downloadPerf_.push(_local5);
sendDownloadData_ = true;
var _local6 = SharedObject.getLocal("videostats", "/");
if (_local6 != null) {
_local6.data.perf = downloadPerf_;
_local6.flush();
}
}
if (sendSegments_ && ((!sentInitialPing_) && ((!sentTimeoutPing_) && ((_local2 <= 0) && ((_local4 - startTime_) > PLAYBACK_TIMEOUT))))) {
sentTimeoutPing_ = true;
var _local7 = {st:_local3, et:_local3, pt:1};
setStandardArgs(_local7, true);
eventReporter_.send(_local7);
}
if ((!sentInitialPing_) && (_local3 > 0)) {
sentInitialPing_ = true;
var _local8 = {st:_local3, et:_local3, fv:_global.escape(System.capabilities.version)};
setStandardArgs(_local8, true);
eventReporter_.send(_local8);
count_ = 1;
sendInterval_ = _global.setInterval(this, "onInterval", 10000);
}
var _local9 = _local3 - lastMediaTime_;
if (_local9 != 0) {
var _local10 = _local4 - lastRealTime_;
if ((_local9 < 0) || (_local9 > (_local10 + 0.2))) {
addSegment();
segmentStart_ = _local3;
}
lastRealTime_ = _local4;
}
lastMediaTime_ = _local3;
if (getPlayerState) {
var _local11 = getPlayerState().pd;
if (_local11 < lastPlaybackDelay) {
totalPlaybackDelay = totalPlaybackDelay + lastPlaybackDelay;
}
lastPlaybackDelay = _local11;
}
}
function getTotalPlaybackDelay() {
if (getPlayerState != undefined) {
return(totalPlaybackDelay + getPlayerState().pd);
}
return(0);
}
function setStandardArgs(args, sendStatefulArgs) {
var _local4 = getMediaDuration();
if (_local4 != undefined) {
args.len = _local4;
}
if (getVideoDownloadRetries != undefined) {
var _local5 = getVideoDownloadRetries();
if (_local5 > 0) {
args.retries = _local5;
}
}
if (sendStatefulArgs) {
if (getBufferEmptyEvents != undefined) {
var _local6 = getBufferEmptyEvents();
var _local7 = _local6 - lastBufferEmptyEvents_;
if (_local7 > 0) {
args.nbe = _local7;
}
lastBufferEmptyEvents_ = _local6;
}
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 _local8 = downloadTimer_.getSize();
if (_local8 > 0) {
args.bd = _local8;
args.bt = downloadTimer_.getDuration();
downloadTimer_.clearHistory();
}
var _local9 = getTotalPlaybackDelay();
if (_local9 > lastReportedPlaybackDelay) {
args.pd = Math.round((_local9 - lastReportedPlaybackDelay) * 1000) / 1000;
lastReportedPlaybackDelay = _local9;
}
}
if (getPlayerState != undefined) {
var _local10 = getPlayerState();
if (_local10) {
delete _local10.pd;
for (var i in _local10) {
args[i] = _local10[i];
}
}
}
var _local11 = getTimerInSeconds() - startTime_;
args.rt = _local11;
}
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 _local3 = String(startTimes_[0]);
var _local4 = String(endTimes_[0]);
var _local5 = 1;
for ( ; _local5 < numSegments_ ; _local5++) {
_local3 = _local3 + ("," + String(startTimes_[_local5]));
_local4 = _local4 + ("," + String(endTimes_[_local5]));
}
if (sendSegments_ || (forced)) {
var _local6 = {st:_local3, et:_local4};
setStandardArgs(_local6, true);
eventReporter_.send(_local6);
}
numSegmentsSent_++;
numSegments_ = 0;
}
}
function sendWatchPoint(altBaseUrl, opt_args) {
var _local4 = getMediaTime();
var _local5 = (opt_args ? (opt_args) : ({}));
_local5.st = _local4;
_local5.et = _local4;
_local5.yttk = 1;
setStandardArgs(_local5, false);
eventReporter_.send(_local5, altBaseUrl);
}
static function loadBandwidthData() {
if (downloadPerfLoaded_) {
return(undefined);
}
downloadPerf_ = [];
var _local2 = SharedObject.getLocal("videostats", "/");
if ((_local2 != null) && (_local2.data.perf != undefined)) {
var _local3 = _local2.data.perf;
for (var index in _local3) {
var _local4 = new Object();
_local4.bytes = _local3[index].bytes;
_local4.time = _local3[index].time;
downloadPerf_.push(_local4);
}
}
downloadPerfLoaded_ = true;
}
static function predictedBandwidthInBitsPerSecond() {
loadBandwidthData();
var _local2 = 0;
var _local3 = 0;
for (var index in downloadPerf_) {
_local2 = _local2 + downloadPerf_[index].bytes;
_local3 = _local3 + downloadPerf_[index].time;
}
if (_local3 < 0.1) {
return(0);
}
return(((_local2 * 8) / _local3) * 0.636717);
}
static function getTimerInSeconds() {
return(getTimer() / 1000);
}
var MAX_REQ = 400;
var BW_SAMPLE_SIZE = 1048576;
var BW_MAX_SAMPLES = 3;
var PLAYBACK_TIMEOUT = 5;
}
Symbol 20525 MovieClip [__Packages.com.google.utils.EventReporter] Frame 0
class com.google.utils.EventReporter extends com.google.utils.UrlConstructor
{
var makeUrl;
function EventReporter (baseUrl) {
super(baseUrl);
}
function send(args, altBaseUrl) {
var _local4 = makeUrl(args);
if (altBaseUrl != undefined) {
_local4 = altBaseUrl + _local4.substr(_local4.indexOf("?"));
}
sendUrl(_local4);
}
function sendUrl(url) {
var _local3 = new MovieClipLoader();
var _local4 = _root.createEmptyMovieClip("junkClip", 999999);
_local3.loadClip(url, _local4);
}
}
Symbol 20526 MovieClip [__Packages.com.google.video.ui.Thumb] Frame 0
class com.google.video.ui.Thumb extends com.google.video.ui.TransparentButton
{
var redraw, lineStyle, beginFill, endFill;
function Thumb () {
super();
redraw();
}
function drawButtonContainer() {
lineStyle(3, 0, 60);
beginFill(0, 0);
com.google.ui.common.Drawing.drawRectangle(this, -4.5, 3.5, 8, 15, 2);
endFill();
lineStyle(1, 16777215, 100);
beginFill(107374182, 100);
com.google.ui.common.Drawing.drawRectangle(this, -4.5, 3.5, 8, 15, 2);
endFill();
}
static var classPath = com.google.video.ui.Thumb;
static var linkageName = "__Packages.com.google.video.ui.Thumb";
static var forceLinkage = Object.registerClass(linkageName, classPath);
}
Symbol 20527 MovieClip [__Packages.com.google.video.subtitle.SubtitleSet] Frame 0
class com.google.video.subtitle.SubtitleSet extends com.google.xml.AbstractXmlFetcher
{
var name_, langCode_, langOriginal_, langTranslated_, langDefault_, id_, loaded_, frames_, timetable_, timetableStep_, timeMax_, init, fetch;
function SubtitleSet () {
super();
name_ = "";
langCode_ = "";
langOriginal_ = "";
langTranslated_ = "";
langDefault_ = false;
id_ = "";
loaded_ = false;
frames_ = null;
timetable_ = null;
timetableStep_ = DEFAULT_TIME_TABLE_STEP;
timeMax_ = 0;
}
function get name() {
return(name_);
}
function get langCode() {
return(langCode_);
}
function get langOriginal() {
return(langOriginal_);
}
function get langTranslated() {
return(langTranslated_);
}
function get loaded() {
return(loaded_);
}
function get id() {
return(id_);
}
static function computeID(name, langCode) {
return(((("<" + langCode) + ", ") + name) + ">");
}
function setNameAndLanguage(name, langCode, langOri, langTr, langDef) {
name_ = name;
langCode_ = langCode;
langOriginal_ = langOri;
langTranslated_ = langTr;
langDefault_ = langDef;
id_ = computeID(name, langCode);
loaded_ = false;
}
function getDisplayString() {
var _local2 = com.google.utils.StringUtils.isEmpty(langTranslated_);
var _local3 = com.google.utils.StringUtils.isEmpty(name_);
if (_local2 && (_local3)) {
return("---");
}
if (_local2) {
return("--- : " + name_);
}
if (_local3) {
return(langTranslated_);
}
return((langTranslated_ + ": ") + name_);
}
function loadFromUrl(url) {
init(url);
fetch();
}
function parseRootNode(rootNode) {
loaded_ = false;
if ((rootNode == null) || (rootNode.nodeName != "transcript")) {
return(false);
}
var _local4 = new Array();
var _local7 = new Array();
var _local8 = new Array();
var _local10 = 0;
for ( ; _local10 < rootNode.childNodes.length ; _local10++) {
var _local9 = rootNode.childNodes[_local10];
for ( ; (_local9.nodeName == null) || (_local9.nodeName != "text") ; _local10++) {
}
var _local3 = Number(com.google.utils.StringUtils.trim(_local9.attributes.start));
for ( ; _global.isNaN(_local3) ; _local10++) {
}
var _local5 = DEFAULT_DURATION;
if ((_local9.attributes.dur != undefined) && (_local9.attributes.dur != null)) {
_local5 = Number(com.google.utils.StringUtils.trim(_local9.attributes.dur));
if (_global.isNaN(_local5) || (_local5 <= 0)) {
_local5 = DEFAULT_DURATION;
}
}
var _local6 = _local3 + _local5;
if ((_local9.attributes.end != undefined) && (_local9.attributes.end != null)) {
_local6 = Number(com.google.utils.StringUtils.trim(_local9.attributes.end));
if (_global.isNaN(_local6) || (_local6 <= _local3)) {
_local6 = _local3 + _local5;
}
}
for ( ; (_local9.childNodes.length != 1) || ((_local9.childNodes[0].nodeType != 3) || (_local9.childNodes[0].nodeValue == null)) ; _local10++) {
}
_local4.push(_local3);
_local7.push(_local6);
var _local11 = com.google.utils.StringUtils.trim(_local9.childNodes[0].nodeValue);
_local8.push(_local11);
}
if (_local4.length <= 0) {
return(false);
}
return(loadFromLists(_local4, _local7, _local8));
}
function loadFromLists(start_time_list, end_time_list, script_text_list) {
start_time_list.push(start_time_list[start_time_list.length - 1] + 120);
frames_ = new Array();
var _local5 = 0;
var _local6 = 0;
for ( ; _local6 < (start_time_list.length - 1) ; _local6++) {
var _local9 = start_time_list[_local6];
var _local10 = end_time_list[_local6];
var _local11 = (_local10 - _local9) == DEFAULT_DURATION;
var _local12 = start_time_list[_local6 + 1];
if (_local10 > _local12) {
_local10 = _local12;
}
var _local13 = script_text_list[_local6].split(newline);
var _local14 = new Array();
var _local15 = 0;
var _local7 = 0;
for ( ; _local7 < _local13.length ; _local7++) {
// unexpected jump
do {
_local7++;
if (_local7 >= _local13.length) {
break;
}
var _local16 = com.google.utils.StringUtils.trim(_local13[_local7]);
} while (!((_local16 != null) && (_local16 != "")));
var _local17 = new Array();
for ( ; _local7 < _local13.length ; _local7++) {
_local16 = com.google.utils.StringUtils.trim(_local13[_local7]);
if ((_local16 == null) || (_local16 == "")) {
break;
}
var _local18 = chopLongSentence(_local16, com.google.video.subtitle.SubtitleControl.TEXT_MAX_CHAR_LENGTH);
_local17 = _local17.concat(_local18);
}
var _local19 = _local17.length;
var _local20 = com.google.video.subtitle.SubtitleControl.TEXT_MAX_NUM_OF_LINES;
var _local8 = 0;
for ( ; _local8 < _local19 ; _local8 = _local8 + _local20) {
if ((_local8 + _local20) < _local19) {
_local14.push(_local17.slice(_local8, _local8 + _local20));
} else {
_local14.push(_local17.slice(_local8, _local19));
}
}
_local15 = _local15 + _local19;
}
for ( ; _local15 <= 0 ; _local6++) {
}
_local5 = _local5 + _local15;
var _local21 = _local10 - _local9;
var _local22 = _local21 / _local15;
if (_local11 && (_local22 > com.google.video.subtitle.SubtitleControl.TIME_MAX_INTERVAL)) {
_local22 = com.google.video.subtitle.SubtitleControl.TIME_MAX_INTERVAL;
}
if (_local22 < com.google.video.subtitle.SubtitleControl.TIME_MIN_INTERVAL) {
_local22 = com.google.video.subtitle.SubtitleControl.TIME_MIN_INTERVAL;
_local12 = _local9 + (_local15 * _local22);
if (_local12 > start_time_list[_local6 + 1]) {
start_time_list[_local6 + 1] = _local12;
}
}
var _local23 = _local9;
_local7 = 0;
for ( ; _local7 < _local14.length ; _local7++) {
var _local24 = _local23 + (_local14[_local7].length * _local22);
frames_.push(new com.google.video.subtitle.SubtitleFrame(_local23, _local24, _local14[_local7]));
_local23 = _local24;
}
}
timeMax_ = frames_[frames_.length - 1].endTime + DEFAULT_TIME_TABLE_STEP;
frames_.push(new com.google.video.subtitle.SubtitleFrame(timeMax_, timeMax_, new Array("")));
buildLookupTable();
loaded_ = true;
return(loaded_);
}
function buildLookupTable() {
timetableStep_ = DEFAULT_TIME_TABLE_STEP;
var _local2 = Math.ceil(timeMax_ / timetableStep_);
if (_local2 > MAX_TIME_TABLE_SIZE) {
_local2 = MAX_TIME_TABLE_SIZE;
timetableStep_ = Math.ceil(timeMax_ / _local2);
}
timetable_ = new Array(_local2);
timetable_[0] = 0;
var _local3 = 1;
var _local4 = 0;
for ( ; _local3 < timetable_.length ; _local3++) {
var _local5 = _local3 * timetableStep_;
while ((_local5 > frames_[_local4].startTime) && (_local4 < frames_.length)) {
_local4++;
}
timetable_[_local3] = _local4;
}
}
static function chopLongSentence(str, maxlen) {
var _local4 = new String(com.google.utils.StringUtils.trim(str));
var _local5 = new Array();
while (_local4.length > maxlen) {
var _local6 = _local4.indexOf(" ");
var _local7 = -1;
while ((0 < _local6) && (_local6 < maxlen)) {
_local7 = _local6;
_local6 = _local4.indexOf(" ", _local7 + 1);
}
if (_local7 < 0) {
if (_local6 < 0) {
break;
}
_local7 = _local6;
}
_local5.push(com.google.utils.StringUtils.trim(_local4.substring(0, _local7)));
_local4 = _local4.substring(_local7, _local4.length);
_local4 = com.google.utils.StringUtils.trim(_local4);
}
_local5.push(_local4);
return(_local5);
}
function getCurrentFrame(time) {
if ((!loaded_) || ((time < 0) || (time > timeMax_))) {
return(null);
}
var _local3 = time / timetableStep_;
var _local4 = Math.floor(_local3);
var _local5 = Math.ceil(_local3);
var _local6 = timetable_[_local4];
var _local7 = timetable_[_local5];
var _local8 = _local6;
while ((frames_[_local8].startTime < time) && (_local8 <= _local7)) {
_local8++;
}
if (_local8 == 0) {
if ((frames_[_local8].startTime - time) > com.google.video.subtitle.SubtitleControl.TIME_WINDOW_PRE) {
_local8 = -1;
}
} else {
var _local9 = time - frames_[_local8 - 1].endTime;
var _local10 = frames_[_local8].startTime - time;
if ((_local9 <= com.google.video.subtitle.SubtitleControl.TIME_WINDOW_POST) && (_local10 <= com.google.video.subtitle.SubtitleControl.TIME_WINDOW_PRE)) {
_local8 = ((_local9 < _local10) ? (_local8 - 1) : (_local8));
} else if (_local9 <= com.google.video.subtitle.SubtitleControl.TIME_WINDOW_POST) {
_local8 = _local8 - 1;
} else if (_local10 <= com.google.video.subtitle.SubtitleControl.TIME_WINDOW_PRE) {
} else {
_local8 = -1;
}
}
if ((0 <= _local8) && (_local8 < frames_.length)) {
return(frames_[_local8]);
}
return(null);
}
static var MAX_TIME_TABLE_SIZE = 512;
static var DEFAULT_TIME_TABLE_STEP = 10;
static var DEFAULT_DURATION = 10000;
}
Symbol 20528 MovieClip [__Packages.com.google.video.ui.ListCard] Frame 0
class com.google.video.ui.ListCard extends MovieClip
{
var createEmptyMovieClip, getNextHighestDepth, scrollContents_, scrollUp_, attachMovie, scrollDown_, title_, smoothFader_, items_;
function ListCard () {
super();
var _local3 = createEmptyMovieClip("scrollArea_", getNextHighestDepth());
var _local4 = _local3.createEmptyMovieClip("scrollClip_", _local3.getNextHighestDepth());
scrollContents_ = _local3.createEmptyMovieClip("scrollContents_", _local3.getNextHighestDepth());
_local4.beginFill(0, 100);
com.google.ui.common.Drawing.drawRectangle(_local4, 0, 0, 300, 170, 0);
_local4.endFill();
_local3.setMask(_local4);
_local3._y = 40;
scrollUp_ = com.google.video.ui.ScrollButton(attachMovie(com.google.video.ui.ScrollButton.linkageName, "scrollUp_", getNextHighestDepth()));
scrollUp_.direction = com.google.video.ui.ScrollButton.NORTH;
scrollUp_._x = 4;
scrollUp_._y = 22;
scrollUp_.addEventListener("clicked", com.google.utils.DelegateEx.create(this, onScrollUp));
scrollDown_ = com.google.video.ui.ScrollButton(attachMovie(com.google.video.ui.ScrollButton.linkageName, "scrollDown_", getNextHighestDepth()));
scrollDown_.direction = com.google.video.ui.ScrollButton.SOUTH;
scrollDown_._x = 4;
scrollDown_._y = 250 - 38;
scrollDown_.addEventListener("clicked", com.google.utils.DelegateEx.create(this, onScrollDown));
title_ = com.google.ui.common.StylishText(attachMovie(com.google.ui.common.StylishText.linkageName, "title_", getNextHighestDepth(), {size:13, color:16777215, style:com.google.ui.common.StylishText.BOLD}));
title_._y = 22;
var scrollContents = scrollContents_;
var _local5 = function () {
return(scrollContents._y);
};
var _local6 = function (val) {
scrollContents._y = val;
};
smoothFader_ = new com.google.ui.common.SmoothFader(_local5, _local6, 4);
}
function onScrollUp(evtObj) {
var _local3 = smoothFader_.target + (56 * 3);
if (_local3 > 0) {
_local3 = 0;
}
smoothFader_.target = _local3;
var _local4 = (-(smoothFader_.target / 56)) + 1;
if (items_.length > 3) {
scrollUp_._visible = _local4 != 1;
scrollDown_._visible = _local4 < (items_.length - 2);
}
}
function onScrollDown(evtObj) {
var _local3 = smoothFader_.target - (56 * 3);
var _local4 = -((items_.length - 3) * 56);
if (_local3 < _local4) {
_local3 = _local4;
}
smoothFader_.target = _local3;
var _local5 = (-(smoothFader_.target / 56)) + 1;
if (items_.length > 3) {
scrollUp_._visible = _local5 != 1;
scrollDown_._visible = _local5 < (items_.length - 2);
}
}
static var classPath = com.google.video.ui.ListCard;
static var linkageName = "__Packages.com.google.video.ui.ListCard";
static var forceLinkage = Object.registerClass(linkageName, classPath);
}
Symbol 20529 MovieClip [__Packages.com.google.video.ui.VideolistCard] Frame 0
class com.google.video.ui.VideolistCard extends com.google.video.ui.ListCard
{
var playlists_, playlistPosition_, curPlaylist_, title_, items_, scrollContents_, scrollUp_, scrollDown_, smoothFader_, onScrollUp, dispatchEvent;
function VideolistCard () {
super()
mx.events.EventDispatcher.initialize(this);
}
function loadFromPlaylists(playlists) {
playlists_ = playlists;
playlists_.addEventListener("curIndexUpdated", com.google.utils.DelegateEx.create(this, onCurIndexUpdated));
setPlaylist(playlists_.curPlaylistName);
playlistPosition_ = -1;
onCurIndexUpdated(null);
}
function setPlaylist(playlistName) {
curPlaylist_ = playlistName;
var _local3 = playlists_.playlists[playlistName];
title_.text = _local3.title;
title_._x = (300 - 10) - title_.width;
if (items_ != undefined) {
var _local4 = 0;
for ( ; _local4 < items_.length ; _local4++) {
if (scrollContents_["item_" + _local4] != undefined) {
scrollContents_["item_" + _local4].removeMovieClip();
}
}
}
items_ = new Array();
var _local5 = 0;
for ( ; _local5 < _local3.items.length ; _local5++) {
var _local6 = _local3.items[_local5];
var _local7 = scrollContents_.attachMovie(com.google.video.ui.VideoItem.linkageName, "item_" + _local5, scrollContents_.getNextHighestDepth());
_local7._x = 0;
_local7._y = 56 * _local5;
items_[_local5] = _local7;
items_[_local5].initialize(_local6);
items_[_local5].itemPos = _local5;
items_[_local5].itemData = _local6;
items_[_local5].addEventListener("clicked", com.google.utils.DelegateEx.create(this, onVideoItemClicked));
}
if (items_.length > 3) {
scrollUp_._visible = false;
scrollDown_._visible = true;
} else {
scrollUp_._visible = false;
scrollDown_._visible = false;
}
smoothFader_.target = 0;
onScrollUp(null);
onCurIndexUpdated(null);
}
function onVideoItemClicked(evtObj) {
dispatchEvent({type:"videoItemClicked", target:this, itemPos:evtObj.target.itemData.itemPos});
}
function onCurIndexUpdated(evtObj) {
if (playlistPosition_ >= 0) {
items_[playlistPosition_].active = false;
playlistPosition_ = -1;
}
if (playlists_.curPlaylistName == curPlaylist_) {
playlistPosition_ = playlists_.curItem.itemPlaylistPos;
items_[playlistPosition_].active = true;
}
}
static var classPath = com.google.video.ui.VideolistCard;
static var linkageName = "__Packages.com.google.video.ui.VideolistCard";
static var forceLinkage = Object.registerClass(linkageName, classPath);
}
Symbol 20530 MovieClip [__Packages.com.google.ui.common.ToolTips] Frame 0
class com.google.ui.common.ToolTips
{
function ToolTips () {
}
static function init(parent, depth) {
if ((tipText_ != null) || ((parent == null) || (parent == undefined))) {
return(undefined);
}
parent_ = parent;
tipsPane_ = parent.createEmptyMovieClip("tooltipsPane_", (((depth == null) || (depth < 0)) ? (parent.getNextHighestDepth()) : (depth)));
tipsPane_._visible = false;
shadow_ = tipsPane_.createEmptyMovieClip("shadow_", tipsPane_.getNextHighestDepth());
var _local4 = "ToolTip";
tipsPane_.createTextField(_local4, tipsPane_.getNextHighestDepth(), 0, 0, MAX_WIDTH, INIT_HEIGHT);
tipText_ = tipsPane_[_local4];
tipText_.background = false;
tipText_.border = false;
tipText_.html = true;
tipText_.htmlText = "";
tipText_.autoSize = false;
tipText_.multiline = false;
tipText_.wordWrap = false;
tipText_.selectable = false;
tipText_.tabEnabled = false;
callerMessages_ = new Array();
callerShowDelays_ = new Array();
callerHideDelays_ = new Array();
callerOnRollOvers_ = new Array();
callerOnRollOuts_ = new Array();
callerOnDragOuts_ = new Array();
enable(true);
}
static function enable(enabled) {
if (!enabled) {
hide(null);
}
enabled_ = enabled;
}
static function registerEventHandlers(caller, message, showDelay, hideDelay, replaceOld) {
if ((caller == null) || (caller == undefined)) {
return(undefined);
}
registerMessage(caller, message);
registerShowDelay(caller, showDelay);
registerHideDelay(caller, hideDelay);
if (!replaceOld) {
callerOnRollOvers_[caller] = caller.onRollOver;
callerOnRollOuts_[caller] = caller.onRollOut;
callerOnDragOuts_[caller] = caller.onDragOut;
} else {
callerOnRollOvers_[caller] = null;
callerOnRollOuts_[caller] = null;
callerOnDragOuts_[caller] = null;
}
caller.onRollOver = function () {
com.google.ui.common.ToolTips.onGainFocus(caller);
};
caller.onRollOut = function () {
com.google.ui.common.ToolTips.onLoseFocusWhenRollOut(caller);
};
caller.onDragOut = function () {
com.google.ui.common.ToolTips.onLoseFocusWhenDragOut(caller);
};
}
static function registerMessage(caller, message) {
callerMessages_[caller] = message;
}
static function registerShowDelay(caller, showDelay) {
if ((showDelay == null) || (showDelay == undefined)) {
showDelay = SHOW_DELAY;
}
callerShowDelays_[caller] = showDelay;
}
static function registerHideDelay(caller, hideDelay) {
if ((hideDelay == null) || (hideDelay == undefined)) {
hideDelay = HIDE_DELAY;
}
callerHideDelays_[caller] = hideDelay;
}
static function hideToolTips(caller) {
if (caller == caller_) {
hide(caller_);
}
}
static function onGainFocus(caller) {
if (callerOnRollOvers_[caller] != null) {
callerOnRollOvers_[caller].apply(caller);
}
if ((!enabled_) || (tipText_ == null)) {
return(undefined);
}
if ((callerMessages_[caller] == null) || ((callerMessages_[caller] == undefined) || (callerMessages_[caller] == ""))) {
return(undefined);
}
clearShowTimer();
clearHideTimer();
caller_ = caller;
showTimer_ = _global.setInterval(show, callerShowDelays_[caller] * 1000, caller);
}
static function onLoseFocusWhenRollOut(caller) {
if (callerOnRollOuts_[caller] != null) {
callerOnRollOuts_[caller].apply(caller);
}
if ((!enabled_) || (tipText_ == null)) {
return(undefined);
}
hide(caller);
}
static function onLoseFocusWhenDragOut(caller) {
if (callerOnDragOuts_[caller] != null) {
callerOnDragOuts_[caller].apply(caller);
}
if ((!enabled_) || (tipText_ == null)) {
return(undefined);
}
hide(caller);
}
static function show(caller) {
if ((!enabled_) || (tipText_ == null)) {
return(undefined);
}
clearShowTimer();
var _local3 = caller.getBounds(parent_);
var _local4 = _local3.xMin;
var _local5 = _local3.yMin;
var _local6 = _local3.xMax;
var _local7 = _local3.yMax;
var _local8 = parent_._xmouse;
var _local9 = parent_._ymouse;
var _local10 = parent_.getBounds(parent_);
var _local11 = _local10.xMin;
var _local12 = _local10.yMin;
var _local13 = _local10.xMax;
var _local14 = _local10.yMax;
tipText_.autoSize = false;
tipText_._width = MAX_WIDTH * 2;
tipText_.htmlText = (FORMAT_PREFIX + callerMessages_[caller]) + FORMAT_SUFFIX;
var _local15 = tipText_.textWidth;
var _local16 = tipText_.textHeight;
if (_local15 <= MAX_WIDTH) {
tipText_.multiline = false;
tipText_.wordWrap = false;
tipText_.autoSize = "left";
} else {
tipText_._width = MAX_WIDTH;
tipText_.multiline = true;
tipText_.wordWrap = true;
tipText_.autoSize = "left";
}
var _local17 = tipText_._width + (PADDING_X * 2);
var _local18 = tipText_._height + (PADDING_Y * 2);
var _local19 = _local9 - (OFFSET_Y + _local18);
if (_local19 < (_local12 + BUFFER_Y)) {
_local19 = _local9 + OFFSET_Y;
}
var _local20 = BUFFER_X + (_local17 / 2);
if ((_local8 - _local11) < _local20) {
var _local21 = _local11 + BUFFER_X;
} else if ((_local13 - _local8) < _local20) {
var _local21 = (_local13 - BUFFER_X) - _local17;
} else {
var _local21 = _local8 - (_local17 / 2);
}
tipText_._x = _local21 + PADDING_X;
tipText_._y = _local19 + PADDING_Y;
shadow_._x = _local21;
shadow_._y = _local19;
drawBackgroundAndShadow(_local17, _local18);
tipsPane_._visible = true;
clearHideTimer();
hideTimer_ = _global.setInterval(hide, callerHideDelays_[caller] * 1000, caller);
}
static function drawBackgroundAndShadow(width, height) {
shadow_._alpha = 100;
shadow_.clear();
shadow_.lineStyle(0, SHADOW_COLOR, 0);
shadow_.beginFill(SHADOW_COLOR);
shadow_.moveTo(0, 0);
shadow_.lineTo(width, 0);
shadow_.lineTo(width + SHADOW_OFFSET_X, SHADOW_OFFSET_Y);
shadow_.lineTo(width + SHADOW_OFFSET_X, height + SHADOW_OFFSET_Y);
shadow_.lineTo(SHADOW_OFFSET_X, height + SHADOW_OFFSET_Y);
shadow_.lineTo(0, height);
shadow_.lineTo(0, 0);
shadow_.endFill();
shadow_.lineStyle(1, BORDER_COLOR, 100);
shadow_.beginFill(BACKGOUND_COLOR);
shadow_.moveTo(0, 0);
shadow_.lineTo(width, 0);
shadow_.lineTo(width, height);
shadow_.lineTo(0, height);
shadow_.lineTo(0, 0);
shadow_.endFill();
}
static function hide(caller) {
if ((!enabled_) || (tipText_ == null)) {
return(undefined);
}
clearShowTimer();
clearHideTimer();
tipsPane_._visible = false;
}
static function clearShowTimer() {
if (showTimer_ != null) {
_global.clearInterval(showTimer_);
showTimer_ = null;
}
}
static function clearHideTimer() {
if (hideTimer_ != null) {
_global.clearInterval(hideTimer_);
hideTimer_ = null;
}
}
static var parent_ = null;
static var tipsPane_ = null;
static var tipText_ = null;
static var shadow_ = null;
static var enabled_ = false;
static var showTimer_ = null;
static var hideTimer_ = null;
static var caller_ = null;
static var callerMessages_ = null;
static var callerShowDelays_ = null;
static var callerHideDelays_ = null;
static var callerOnRollOvers_ = null;
static var callerOnRollOuts_ = null;
static var callerOnDragOuts_ = null;
static var SHOW_DELAY = 1;
static var HIDE_DELAY = 5;
static var FORMAT_PREFIX = "<p align=\"center\"><font color=\"#333333\" face=\"Arial\" size=\"11\">";
static var FORMAT_SUFFIX = "</font></p>";
static var BACKGOUND_COLOR = 15658683;
static var BORDER_COLOR = 4473924;
static var SHADOW_COLOR = 7829367;
static var MAX_WIDTH = 160;
static var INIT_HEIGHT = 20;
static var BUFFER_X = 20;
static var BUFFER_Y = 20;
static var OFFSET_X = 10;
static var OFFSET_Y = 10;
static var PADDING_X = 3;
static var PADDING_Y = 1;
static var SHADOW_OFFSET_X = 2;
static var SHADOW_OFFSET_Y = 2;
}
Symbol 20531 MovieClip [__Packages.com.google.video.ui.PlaylistControl] Frame 0
class com.google.video.ui.PlaylistControl extends MovieClip
{
var positionText_, attachMovie, getNextHighestDepth, prevButton_, nextButton_, playlistSize_, width_, height_, position_, showPlaylist_, __get__playlistSize, _visible, __get__visible, __get__position, dispatchEvent;
function PlaylistControl () {
super();
mx.events.EventDispatcher.initialize(this);
positionText_ = com.google.ui.common.StylishText(attachMovie(com.google.ui.common.StylishText.linkageName, "positionText_", getNextHighestDepth(), {color:16113331}));
prevButton_ = com.google.video.ui.PlaylistButton(attachMovie(com.google.video.ui.PlaylistButton.linkageName, "prevButton_", getNextHighestDepth()));
prevButton_.direction = com.google.video.ui.PlaylistButton.LEFT;
prevButton_.addEventListener("clicked", com.google.utils.DelegateEx.create(this, onPrev));
nextButton_ = com.google.video.ui.PlaylistButton(attachMovie(com.google.video.ui.PlaylistButton.linkageName, "nextButton_", getNextHighestDepth()));
nextButton_.direction = com.google.video.ui.PlaylistButton.RIGHT;
nextButton_.addEventListener("clicked", com.google.utils.DelegateEx.create(this, onNext));
playlistSize_ = 0;
visible = false;
}
function setSize(width, height) {
width_ = width;
height_ = height;
positionText_.text = (playlistSize_ + " of ") + playlistSize_;
positionText_._x = (width / 2) - (positionText_.width / 2);
positionText_._y = (height - positionText_.height) - 4;
prevButton_._x = positionText_._x - com.google.video.ui.PlaylistButton.BUTTON_WIDTH;
nextButton_._x = (positionText_._x + positionText_.width) + 4;
prevButton_._y = height - 18;
nextButton_._y = height - 18;
positionText_.text = (position_ + " of ") + playlistSize_;
}
function set playlistSize(val) {
playlistSize_ = val;
setSize(width_, height_);
visible = showPlaylist_;
//return(__get__playlistSize());
}
function set visible(val) {
var _local3 = playlistSize_ > 1;
showPlaylist_ = val;
positionText_._visible = _local3 && (val);
prevButton_._visible = _local3 && (val);
nextButton_._visible = _local3 && (val);
_visible = _local3 && (val);
//return(__get__visible());
}
function set position(val) {
position_ = val;
positionText_.text = (position_ + " of ") + playlistSize_;
//return(__get__position());
}
function get width() {
return((nextButton_._x - prevButton_._x) + com.google.video.ui.PlaylistButton.BUTTON_WIDTH);
}
function onNext(evtObj) {
dispatchEvent({type:"nextItem", target:this});
}
function onPrev(evtObj) {
dispatchEvent({type:"prevItem", target:this});
}
static var classPath = com.google.video.ui.PlaylistControl;
static var linkageName = "__Packages.com.google.video.ui.PlaylistControl";
static var forceLinkage = Object.registerClass(linkageName, Function(classPath));
}
Symbol 20532 MovieClip [__Packages.com.google.xml.XlbMessages] Frame 0
class com.google.xml.XlbMessages extends com.google.xml.AbstractXmlFetcher
{
var messages_, locale_;
function XlbMessages () {
super();
messages_ = {};
}
function parseMessagesGroup(node) {
var _local3 = 0;
for ( ; _local3 < node.childNodes.length ; _local3++) {
var _local4 = node.childNodes[_local3];
if ((_local4.nodeName == "msg") && ((_local4.attributes.name != null) && (_local4.childNodes[0] != null))) {
var _local5 = _local4.childNodes[0].nodeValue;
var _local6 = _local5.split("\\n").join(newline);
messages_[_local4.attributes.name] = _local6;
}
}
}
function parseRootNode(rootNode) {
if ((rootNode == null) || ((!rootNode.hasChildNodes()) || (rootNode.nodeName != "localizationbundle"))) {
return(false);
}
locale_ = rootNode.attributes.locale;
var _local3 = 0;
for ( ; _local3 < rootNode.childNodes.length ; _local3++) {
if (rootNode.childNodes[_local3].nodeName == "messages") {
parseMessagesGroup(rootNode.childNodes[_local3]);
}
}
return(true);
}
function getMessage(messageId) {
return(messages_[messageId]);
}
static var LOCALE_DE = "de";
static var LOCALE_EN_AU = "en-AU";
static var LOCALE_EN_CA = "en";
static var LOCALE_EN_GB = "en-GB";
static var LOCALE_EN_US = "en";
static var LOCALE_ES = "es";
static var LOCALE_FR = "fr";
static var LOCALE_IT = "it";
static var LOCALE_JA = "ja";
static var LOCALE_KO = "ko";
static var LOCALE_NL = "nl";
static var LOCALE_PL = "pl";
}
Symbol 20533 MovieClip [__Packages.com.google.youtube.IBroadcaster] Frame 0
class com.google.youtube.IBroadcaster
{
function IBroadcaster () {
}
}
Symbol 20534 MovieClip [__Packages.com.google.youtube.AbstractElement] Frame 0
class com.google.youtube.AbstractElement extends MovieClip implements com.google.youtube.IBroadcaster
{
var _width, _height, _x, _y, _xscale, _yscale;
function AbstractElement () {
super();
com.google.chianti.event.EventBroadcaster.initialize(this);
}
function broadcast(evt) {
}
function disableBroadcast() {
}
function enableBroadcast() {
}
function registerEvent(type, obj) {
}
function registerEvents() {
}
function unregisterEvent(type, obj) {
}
function unregisterEvents() {
}
function unregisterAll() {
}
function setSize(newWidth, newHeight) {
_width = newWidth;
_height = newHeight;
}
function setLocation(newX, newY) {
_x = newX;
_y = newY;
}
function setScale(newXScale, newYScale) {
_xscale = newXScale;
_yscale = newYScale;
}
}
Symbol 20535 MovieClip [__Packages.com.google.youtube.ui.BaseButton] Frame 0
class com.google.youtube.ui.BaseButton extends com.google.youtube.AbstractElement
{
var buttonWidth, buttonHeight, isEnabled, isTooltipEnabled, hit, bg, onRollOver, onRollOut, tooltip, createEmptyMovieClip, getNextHighestDepth;
function BaseButton () {
super();
buttonWidth = DEFAULT_BUTTON_WIDTH;
buttonHeight = DEFAULT_BUTTON_HEIGHT;
isEnabled = true;
isTooltipEnabled = false;
}
function enable() {
hit.useHandCursor = true;
isEnabled = true;
}
function enableTooltip() {
isTooltipEnabled = true;
}
function disable() {
hit.useHandCursor = false;
isEnabled = false;
}
function disableTooltip() {
isTooltipEnabled = false;
}
function drawBgUpState() {
bg._visible = false;
}
function drawBgDownState() {
bg._visible = true;
}
function hover() {
}
function unhover() {
}
function dragOver() {
onRollOver();
}
function dragOut() {
onRollOut();
}
function press() {
bg._visible = true;
}
function release() {
drawBgUpState();
}
function releaseOutside() {
unhover();
drawBgUpState();
}
function rollOver() {
hover();
}
function rollOut() {
unhover();
}
function setTooltip(s) {
tooltip = s;
}
function getTooltip() {
return(tooltip);
}
function setSize(newWidth, newHeight) {
hit.clear();
com.google.youtube.util.Drawing.drawRect(hit, 0, 0, buttonWidth, buttonHeight, 16711680);
}
function build(opt_width, opt_height) {
if (opt_width != undefined) {
buttonWidth = opt_width;
}
if (opt_height != undefined) {
buttonHeight = opt_height;
}
if (!bg) {
bg = createEmptyMovieClip("bg", getNextHighestDepth());
bg._visible = false;
} else {
bg.clear();
}
if (!hit) {
hit = createEmptyMovieClip("hit", getNextHighestDepth());
hit._alpha = 0;
hit.onRollOver = com.google.chianti.event.EventDelegate.create(this, rollOver);
hit.onRollOut = com.google.chianti.event.EventDelegate.create(this, rollOut);
hit.onPress = com.google.chianti.event.EventDelegate.create(this, press);
hit.onRelease = com.google.chianti.event.EventDelegate.create(this, release);
hit.onReleaseOutside = com.google.chianti.event.EventDelegate.create(this, releaseOutside);
hit.onDragOver = com.google.chianti.event.EventDelegate.create(this, dragOver);
hit.onDragOut = com.google.chianti.event.EventDelegate.create(this, dragOut);
} else {
hit.clear();
}
com.google.youtube.util.Drawing.drawRect(hit, 0, 0, buttonWidth, buttonHeight, 16711680);
}
static var LINK_NAME = "__Packages.com.google.youtube.ui.BaseButton";
static var FORCE_LINK = Object.registerClass(LINK_NAME, com.google.youtube.ui.BaseButton);
static var BUTTON_UP = "up";
static var BUTTON_DOWN = "down";
static var BUTTON_PLAYING = "playing";
static var BUTTON_PAUSED = "paused";
static var BUTTON_DISABLED = "disabled";
static var BUTTON_ERROR = "error";
static var DEFAULT_BUTTON_WIDTH = 28;
static var DEFAULT_BUTTON_HEIGHT = 23;
static var DISABLED_ALPHA = 45;
static var ICON_SHADOW_ALPHA = 60;
static var ICON_SHADOW_COLOR = 16777215;
}
Symbol 20536 MovieClip [__Packages.com.google.youtube.ui.CompoundButton] Frame 0
class com.google.youtube.ui.CompoundButton extends com.google.youtube.ui.BaseButton
{
var mouseActivity, monitorMouse, activated, timeoutDueToIdle, jumpInterval, broadcast, registerEvent, rollOver, rollOut;
function CompoundButton () {
super();
mouseActivity = new com.google.youtube.util.MouseActivity(true);
mouseActivity.registerEvent(com.google.youtube.util.MouseActivity.MOUSE_ACTIVE, com.google.chianti.event.EventDelegate.create(this, attemptActivate));
monitorMouse = false;
activated = false;
timeoutDueToIdle = false;
jumpInterval = 0;
}
function hover() {
if (!timeoutDueToIdle) {
broadcast({type:com.google.youtube.event.GenericButtonEvent.ROLL_OVER, target:this});
monitorMouse = true;
_global.clearInterval(jumpInterval);
attemptActivate();
}
}
function unhover() {
broadcast({type:com.google.youtube.event.GenericButtonEvent.ROLL_OUT, target:this});
monitorMouse = false;
_global.clearInterval(jumpInterval);
jumpInterval = _global.setInterval(this, "attemptDeactivate", JUMP_TIMEOUT);
}
function attemptActivate() {
timeoutDueToIdle = false;
if (monitorMouse && (!activated)) {
activate();
activated = true;
}
}
function attemptDeactivate(opt_mouseIdle) {
if (activated) {
timeoutDueToIdle = opt_mouseIdle;
deactivate();
activated = false;
}
_global.clearInterval(jumpInterval);
}
function isActive() {
return(activated);
}
function activate() {
broadcast({type:com.google.youtube.event.GenericButtonEvent.ACTIVATE, target:this});
}
function deactivate() {
broadcast({type:com.google.youtube.event.GenericButtonEvent.DEACTIVATE, target:this});
}
function registerParentButton(parent) {
registerEvent(com.google.youtube.event.GenericButtonEvent.ROLL_OVER, com.google.chianti.event.EventDelegate.create(parent, parent.hover));
registerEvent(com.google.youtube.event.GenericButtonEvent.ROLL_OUT, com.google.chianti.event.EventDelegate.create(parent, parent.unhover));
}
function includeMouseActivityOf(target, opt_recurse) {
if (opt_recurse && (!hasMouseListeners(target))) {
for (var child in target) {
if (typeof(target[child]) == "movieclip") {
includeMouseActivityOf(target[child], opt_recurse);
}
}
} else {
target.onRollOver = com.google.utils.FunctionUtils.concat(com.google.chianti.event.EventDelegate.create(target, target.onRollOver), com.google.chianti.event.EventDelegate.create(this, rollOver));
target.onRollOut = com.google.utils.FunctionUtils.concat(com.google.chianti.event.EventDelegate.create(target, target.onRollOut), com.google.chianti.event.EventDelegate.create(this, rollOut));
target.onReleaseOutside = com.google.utils.FunctionUtils.concat(com.google.chianti.event.EventDelegate.create(target, target.onReleaseOutside), com.google.chianti.event.EventDelegate.create(this, rollOut));
}
}
function hasMouseListeners(target) {
return(target.onPress || (target.onRelease || (target.onReleaseOutside || (target.onRollOver || (target.onRollOut)))));
}
static var LINK_NAME = "__Packages.com.google.youtube.ui.CompoundButton";
static var FORCE_LINK = Object.registerClass(LINK_NAME, com.google.youtube.ui.CompoundButton);
static var JUMP_TIMEOUT = 500;
}
Symbol 20537 MovieClip [__Packages.com.google.ui.media.SpeedControl] Frame 0
class com.google.ui.media.SpeedControl extends com.google.youtube.ui.CompoundButton
{
var hit, sliderVisibleY, sliderOriginalY, broadcast, getNextHighestDepth;
function SpeedControl () {
super();
}
function init(parentClip) {
parent = parentClip;
build();
hit._accProps = {name:"Speed Control"};
}
function getWidth() {
return(speedControlButton._width);
}
function setPosition(x, y) {
speedControlButton._x = x;
speedControlButton._y = y;
sliderHolder._x = speedControlButton._x;
sliderMask._x = sliderHolder._x - SLIDER_MASK_WIDTH_PADDING;
}
function setSize(width, height) {
speedControlButton.setSize(width, height);
}
function enable() {
speedControlButton._visible = true;
}
function disable() {
speedControlButton._visible = false;
toolTips.hideTooltip();
}
function setButtonIcon() {
if (currentSpeed < 1) {
speedControlButton.icon = SPEED_ICON_BUTTON_SLOW;
} else if (currentSpeed > 1) {
speedControlButton.icon = SPEED_ICON_BUTTON_FAST;
} else {
speedControlButton.icon = SPEED_ICON_BUTTON_NORMAL;
}
}
function showTooltip() {
toolTips.setTooltipText(speedStrings[positionToTick(speedSlider.getValue())]);
toolTips.showTooltip(1);
}
function positionToTick(pos) {
var _local3 = Math.round(((pos - 1) * (speeds.length - 1)) / SLIDER_MAX_VALUE);
_local3 = Math.max(_local3, 0);
return(_local3);
}
function tickToPosition(tick) {
return(Math.round((SLIDER_MAX_VALUE * tick) / (speeds.length - 1)));
}
function speedToTick(speed) {
var _local3 = 0;
for ( ; _local3 < speeds.length ; _local3++) {
if (speed <= speeds[_local3]) {
return(_local3);
}
}
return(speeds.length - 1);
}
function speedUp() {
var _local2 = speedToTick(currentSpeed);
if (_local2 < (speeds.length - 2)) {
setSpeed(speeds[_local2 + 1]);
}
}
function speedDown() {
var _local2 = speedToTick(currentSpeed);
if (_local2 > 0) {
setSpeed(speeds[_local2 - 1]);
}
}
function speedButtonRollOver() {
sliderHolder.hover();
}
function speedButtonRollOut() {
sliderHolder.unhover();
}
function sliderActivate() {
showSlider();
}
function sliderDeactivate() {
toolTips.hideTooltip();
hideSlider();
}
function showSlider() {
sliderHolder._visible = true;
speedSlider.enable();
com.gs.TweenLite.to(sliderHolder, SLIDER_SHOW_HIDE_SPEED, {_y:sliderVisibleY});
}
function hideSlider() {
var slider = sliderHolder;
var _local2 = function () {
slider._visible = false;
};
com.gs.TweenLite.to(sliderHolder, SLIDER_SHOW_HIDE_SPEED, {_y:sliderOriginalY, onComplete:_local2});
}
function speedButtonRelease() {
if (currentSpeed != 1) {
setSpeed(1);
} else {
setSpeed(SPEED_DEFAULT_CLICK);
}
}
function onSliderChange() {
showTooltip();
}
function onSliderRelease() {
setSpeed(speeds[positionToTick(speedSlider.getValue())]);
}
function onSliderClick() {
var _local2 = sliderBg._height - (2 * SLIDER_BG_EDGE_PADDING);
var _local3 = (sliderBg._height - SLIDER_BG_EDGE_PADDING) - sliderBg._ymouse;
if (_local3 > _local2) {
_local3 = _local2;
} else if (_local3 < 0) {
_local3 = 0;
}
var _local4 = positionToTick((SLIDER_MAX_VALUE * _local3) / _local2);
setSpeed(speeds[_local4]);
}
function setSpeed(newSpeed) {
var _local3 = currentSpeed;
currentSpeed = newSpeed;
speedSlider.setValue(tickToPosition(speedToTick(currentSpeed)), true);
if (currentSpeed != _local3) {
broadcast({type:CHANGE, data:currentSpeed, target:this});
}
showTooltip();
setButtonIcon();
}
function build() {
super.build();
speedControlButton = parent.attachMovie(com.google.ui.common.IconButton.linkageName, "speedControl", parent.getNextHighestDepth(), {baseName:"btn", icon:SPEED_ICON_BUTTON_NORMAL});
speedControlButton.onRollOver = com.google.chianti.event.EventDelegate.create(this, speedButtonRollOver);
speedControlButton.onRollOut = com.google.chianti.event.EventDelegate.create(this, speedButtonRollOut);
speedControlButton.onRelease = com.google.chianti.event.EventDelegate.create(this, speedButtonRelease);
speedControlButton.onPress = undefined;
speedControlButton.onReleaseOutside = undefined;
sliderHolder = com.google.youtube.ui.CompoundButton(parent.attachMovie(com.google.youtube.ui.CompoundButton.LINK_NAME, "sliderHolder", getNextHighestDepth()));
sliderHolder.registerEvent(com.google.youtube.event.GenericButtonEvent.ACTIVATE, com.google.chianti.event.EventDelegate.create(this, sliderActivate));
sliderHolder.registerEvent(com.google.youtube.event.GenericButtonEvent.DEACTIVATE, com.google.chianti.event.EventDelegate.create(this, sliderDeactivate));
sliderHolder._x = speedControlButton._x;
sliderHolder.includeMouseActivityOf(hit);
sliderHolder._visible = false;
sliderBg = sliderHolder.attachMovie(SPEED_MENU_BG, "sliderBg", sliderHolder.getNextHighestDepth());
sliderBg.onRelease = com.google.chianti.event.EventDelegate.create(this, onSliderClick);
sliderBg.tabEnabled = false;
sliderHolder.includeMouseActivityOf(sliderBg);
sliderMask = parent.createEmptyMovieClip("sliderMask", parent.getNextHighestDepth());
com.google.youtube.util.Drawing.drawRect(sliderMask, sliderHolder._x, -sliderHolder._height, sliderHolder._width + SLIDER_MASK_WIDTH_PADDING, sliderHolder._height, SLIDER_MASK_COLOR);
sliderHolder.setMask(sliderMask);
speedSlider = com.google.youtube.ui.SliderControl(sliderHolder.attachMovie(com.google.youtube.ui.SliderControl.LINK_NAME, "speedSlider", getNextHighestDepth()));
speedSlider.registerParentButton(sliderHolder);
speedSlider.registerEvent(com.google.youtube.event.UIEvent.CHANGE, com.google.chianti.event.EventDelegate.create(this, onSliderChange));
speedSlider.registerEvent(com.google.youtube.event.GenericButtonEvent.RELEASE, com.google.chianti.event.EventDelegate.create(this, onSliderRelease));
speedSlider.setValues(SLIDER_MIN_VALUE, SLIDER_MAX_VALUE);
speedSlider.setSize(sliderBg._height - 4);
speedSlider._y = SLIDER_VERTICAL_OFFSET + 1;
sliderOriginalY = sliderHolder._y + 1;
sliderVisibleY = sliderHolder._y - sliderHolder._height;
setSpeed(1);
toolTips = com.google.youtube.players.ui.MovingTooltip.createTooltip(speedSlider.getHandle(), com.google.youtube.util.Drawing.RIGHT, TOOLTIP_BG_COLOR, undefined, speedSlider.getHandle());
toolTips.setOffset(8, 4);
}
static var LINK_NAME = "__Packages.com.google.ui.media.SpeedControl";
static var FORCE_LINK = Object.registerClass(LINK_NAME, com.google.ui.media.SpeedControl);
static var CHANGE = "onChange";
static var SPEED_ICON_BUTTON_FAST = "speed_button_fast";
static var SPEED_ICON_BUTTON_NORMAL = "speed_button_normal";
static var SPEED_ICON_BUTTON_SLOW = "speed_button_slow";
static var SPEED_MENU_BG = "speed_menu_bg";
static var SLIDER_MIN_VALUE = 0;
static var SLIDER_MAX_VALUE = 64;
static var SLIDER_BG_EDGE_PADDING = 6;
static var SLIDER_VERTICAL_OFFSET = 1;
static var SLIDER_SHOW_HIDE_SPEED = 0.3;
static var SLIDER_MASK_WIDTH_PADDING = 100;
static var SLIDER_MASK_COLOR = 16750848;
static var TOOLTIP_BG_COLOR = 3158064;
static var SPEED_DEFAULT_CLICK = 1.5;
var speeds = [0.5, 0.75, 1, 1.25, 1.5, 1.75, 2, 2.5, 3];
var speedStrings = [" .5x ", " .75x", "1.0x ", "1.25x", "1.5x ", "1.75x", "2.0x ", "2.5x ", "3.0x "];
var currentSpeed = 1;
var parent = null;
var speedControlButton = null;
var sliderHolder = null;
var sliderBg = null;
var sliderMask = null;
var speedSlider = null;
var toolTips = null;
}
Symbol 20538 MovieClip [__Packages.com.google.video.ui.CloseButton] Frame 0
class com.google.video.ui.CloseButton extends com.google.video.ui.TransparentButton
{
var redraw, lineStyle, moveTo, lineTo, state, beginFill, endFill;
function CloseButton () {
super();
redraw();
}
function drawButtonContents() {
lineStyle(2, 13421772, 100);
moveTo(6, 6);
lineTo(14, 14);
moveTo(14, 6);
lineTo(6, 14);
}
function drawButtonContainer() {
var _local2 = 2;
var _local3 = 2;
var _local4 = 16;
var _local5 = 16;
lineStyle(0, 13421772, 0);
if (state == com.google.video.ui.SimpleButton.UP) {
beginFill(0, 10);
} else if (state == com.google.video.ui.SimpleButton.OVER) {
beginFill(4473924, 100);
} else if (state == com.google.video.ui.SimpleButton.DOWN) {
beginFill(2236962, 100);
}
com.google.ui.common.Drawing.drawRectangle(this, _local2, _local3, _local4, _local5, 3);
endFill();
}
static var classPath = com.google.video.ui.CloseButton;
static var linkageName = "__Packages.com.google.video.ui.CloseButton";
static var forceLinkage = Object.registerClass(linkageName, Function(classPath));
}
Symbol 20539 MovieClip [__Packages.com.google.video.ui.MetadataCard] Frame 0
class com.google.video.ui.MetadataCard extends MovieClip
{
var titleArea_, attachMovie, getNextHighestDepth, providerArea_, clippingRegion_, createEmptyMovieClip, cardHeight_, curPos_, scrollTop_, showMetadata_, clear, lineStyle, beginFill, width_, endFill, _y, setMask, wakeup_, playPauseButton_, __get__title, __get__provider, __get__showMetadata, __get__playPauseButton;
function MetadataCard () {
super();
titleArea_ = com.google.ui.common.StylishText(attachMovie(com.google.ui.common.StylishText.linkageName, "titleArea_", getNextHighestDepth(), {color:16113331, size:14, style:com.google.ui.common.StylishText.BORDER}));
providerArea_ = com.google.ui.common.StylishText(attachMovie(com.google.ui.common.StylishText.linkageName, "providerArea_", getNextHighestDepth(), {color:16777215, size:12, style:com.google.ui.common.StylishText.NONE}));
clippingRegion_ = createEmptyMovieClip("clippingRegion_", getNextHighestDepth());
titleArea_.text = " ";
providerArea_.text = " ";
cardHeight_ = ((titleArea_.height + providerArea_.height) + 8) & (1 ^ -1);
curPos_ = cardHeight_;
scrollTop_ = cardHeight_;
showMetadata_ = false;
}
function redraw() {
clear();
titleArea_._y = scrollTop_;
providerArea_._y = (titleArea_._y + titleArea_.height) + 2;
titleArea_._x = 48 + 18;
providerArea_._x = 48 + 18;
lineStyle(1, 13421772, 40);
beginFill(0, 80);
com.google.ui.common.Drawing.drawRectangle(this, -16, scrollTop_, width_ + 16, 100, 0);
endFill();
}
function setSize(width, height) {
width_ = width;
titleArea_.maxWidth = ((width - 48) - 16) - 16;
titleArea_.text = titleArea_.text;
providerArea_.maxWidth = ((width - 48) - 16) - 16;
providerArea_.text = providerArea_.text;
_y = (height - 16) - cardHeight_;
clippingRegion_.beginFill(0, 100);
com.google.ui.common.Drawing.drawRectangle(clippingRegion_, 0, 0, width, cardHeight_ - 4, 0);
clippingRegion_.endFill();
setMask(clippingRegion_);
redraw();
}
function onEnterFrame() {
var _local2 = ((showMetadata_ || (wakeup_)) ? -36 : (cardHeight_));
if ((titleArea_.text.length == 0) || (titleArea_.text == " ")) {
_local2 = cardHeight_;
}
if (curPos_ != _local2) {
curPos_ = curPos_ + ((curPos_ < _local2) ? 2 : -2);
var _local3 = (curPos_ / cardHeight_) - 0.5;
if (_local3 < -0.5) {
_local3 = -0.5;
}
if (_local3 > 0.5) {
_local3 = 0.5;
}
scrollTop_ = (Math.sin(_local3 * Math.PI) * (cardHeight_ / 2)) + (cardHeight_ / 2);
playPauseButton_.showingMetadata = _local3 < 0;
redraw();
} else {
wakeup_ = false;
}
}
function set title(text) {
titleArea_.text = text;
redraw();
//return(__get__title());
}
function set provider(text) {
providerArea_.text = text;
redraw();
//return(__get__provider());
}
function set showMetadata(val) {
showMetadata_ = val;
if (showMetadata_) {
wakeup_ = true;
}
//return(__get__showMetadata());
}
function set playPauseButton(val) {
playPauseButton_ = val;
//return(__get__playPauseButton());
}
static var classPath = com.google.video.ui.MetadataCard;
static var linkageName = "__Packages.com.google.video.ui.MetadataCard";
static var forceLinkage = Object.registerClass(linkageName, Function(classPath));
}
Symbol 20540 MovieClip [__Packages.com.google.video.apps.FlashApi] Frame 0
class com.google.video.apps.FlashApi
{
var rootMc, playerApiId, docId, mediaPlayer, totalBytes;
function FlashApi () {
}
function initFlashApi(clip) {
rootMc = clip;
playerApiId = clip.playerapiid;
docId = clip.docid;
System.security.allowDomain("*");
addCallback("playVideo", this, playTheVideo);
addCallback("pauseVideo", this, pauseTheVideo);
addCallback("stopVideo", this, stopTheVideo);
addCallback("getVideoBytesLoaded", this, getBytesLoaded);
addCallback("getVideoBytesTotal", this, getBytesTotal);
addCallback("mute", this, muteTheVolume);
addCallback("unMute", this, unMuteTheVolume);
addCallback("isMuted", this, isVolumeMuted);
addCallback("setVolume", this, setTheVolume);
addCallback("getVolume", this, getTheVolume);
addCallback("seekTo", this, seekToHere);
addCallback("getPlayerState", this, getThePlayerState);
addCallback("getCurrentTime", this, getTheCurrentTime);
addCallback("getDuration", this, getTheDuration);
addCallback("getVideoUrl", this, getTheVideoUrl);
addCallback("getVideoEmbedCode", this, getEmbedCode);
addCallback("setSize", this, setTheSize);
addCallback("addEventListener", this, addListener);
}
function addCallback(callback, obj, objfn) {
if (rootMc._parent.addCallback != undefined) {
rootMc._parent.addCallback(callback, obj, objfn);
} else {
flash.external.ExternalInterface.addCallback(callback, obj, objfn);
}
}
function playTheVideo() {
mediaPlayer.play();
}
function pauseTheVideo() {
mediaPlayer.pause();
}
function stopTheVideo() {
mediaPlayer.pause();
}
function getBytesLoaded() {
return(mediaPlayer.bytesLoaded);
}
function getBytesTotal() {
updateTotalBytes();
return(totalBytes);
}
function muteTheVolume() {
mediaPlayer.mute = true;
}
function unMuteTheVolume() {
mediaPlayer.mute = false;
}
function isVolumeMuted() {
return((mediaPlayer.mute ? 1 : 0));
}
function setTheVolume(volume) {
mediaPlayer.volume = volume / 100;
}
function getTheVolume() {
if (!mediaPlayer.mute) {
return(mediaPlayer.volume * 100);
}
return(mediaPlayer.controlBar.unMuteVolume * 100);
}
function seekToHere(seconds, unused_allowSeekAhead) {
mediaPlayer.seek(seconds);
}
function getThePlayerState() {
if (mediaPlayer.bytesLoaded == undefined) {
return(STATE_UNSTARTED);
}
return(mpStateToFlashApiState(mediaPlayer.currentState));
}
static function mpStateToFlashApiState(state) {
switch (state) {
case com.google.ui.media.MediaPlayer.STATE_PAUSED :
return(STATE_PAUSED);
case com.google.ui.media.MediaPlayer.STATE_BUFFERING :
return(STATE_BUFFERING);
case com.google.ui.media.MediaPlayer.STATE_PLAYING :
return(STATE_PLAYING);
case com.google.ui.media.MediaPlayer.STATE_SCRUBBING :
return(STATE_VGC_SCRUBBING);
case com.google.ui.media.MediaPlayer.STATE_ERROR :
return(STATE_VGC_ERROR);
case com.google.ui.media.MediaPlayer.STATE_COMPLETED :
return(STATE_COMPLETED);
}
return(STATE_VGC_UNKNOWN);
}
function getTheCurrentTime() {
return(mediaPlayer.time);
}
function getTheDuration() {
return(mediaPlayer.duration);
}
function getTheVideoUrl() {
return(mediaPlayer.playPage);
}
function getEmbedCode() {
if (docId == undefined) {
return(null);
}
return((((("<embed id=\"VideoPlayback\" " + "src=\"http://video.google.com/googleplayer.swf?docid=") + docId) + "&hl=en&fs=true\" style=\"width:400px;height:326px\" ") + "allowFullScreen=\"true\" allowScriptAccess=\"always\" ") + "type=\"application/x-shockwave-flash\"> </embed>");
}
function setTheSize(width, height) {
rootMc.setSize(width, height);
}
function addListener(event, callback) {
if (event == "onStateChange") {
if (mediaPlayer != undefined) {
mediaPlayer.notifyOnTransition(com.google.utils.DelegateEx.create(this, notifyTransition));
}
fnStateChange[fnStateChange.length] = callback;
} else if (event == "onError") {
if (mediaPlayer != undefined) {
mediaPlayer.notifyOnError(com.google.utils.DelegateEx.create(this, notifyError));
}
fnError[fnError.length] = callback;
}
}
function playerReady() {
flash.external.ExternalInterface.call("onPlayerReady", playerApiId);
}
function notifyTransition(state) {
var _local3 = mpStateToFlashApiState(state);
updateTotalBytes();
var _local4 = 0;
for ( ; _local4 < fnStateChange.length ; _local4++) {
flash.external.ExternalInterface.call(fnStateChange[_local4], _local3);
}
}
function notifyError() {
var _local2 = 0;
for ( ; _local2 < fnError.length ; _local2++) {
flash.external.ExternalInterface.call(fnError[_local2], 100);
}
}
function updateTotalBytes() {
if ((totalBytes == undefined) || (mediaPlayer.segmentLength > totalBytes)) {
totalBytes = mediaPlayer.segmentLength;
}
}
function setMediaPlayer(mp) {
mediaPlayer = mp;
if (fnStateChange != undefined) {
mediaPlayer.notifyOnTransition(this);
}
if (fnError != undefined) {
mediaPlayer.notifyOnError(this);
}
}
static var STATE_UNSTARTED = -1;
static var STATE_COMPLETED = 0;
static var STATE_PLAYING = 1;
static var STATE_PAUSED = 2;
static var STATE_BUFFERING = 3;
static var STATE_CUED = 5;
static var STATE_VGC_SCRUBBING = 6;
static var STATE_VGC_ERROR = 7;
static var STATE_VGC_UNKNOWN = 8;
var fnStateChange = [];
var fnError = [];
}
Symbol 20541 MovieClip [__Packages.com.google.utils.Url] Frame 0
class com.google.utils.Url
{
var protocol, host, port, domain, file, path, params, paramsMap;
function Url (spec) {
parseAndInit(spec);
}
static function debugDescribeParams(params) {
var _local3 = "";
for (var param in params) {
if (_local3 != "") {
_local3 = _local3 + " ";
}
_local3 = _local3 + (((param + "=>{") + params[param].join(",")) + "}");
}
return(_local3);
}
static function diffUrl(url, goldenUrl) {
var _local4 = new Array();
if (url.getProtocol() != goldenUrl.getProtocol()) {
_local4.push((("Protocol: " + url.getProtocol()) + "!=") + goldenUrl.getProtocol());
}
if (url.getHost() != goldenUrl.getHost()) {
_local4.push((("Host: " + url.getHost()) + "!=") + goldenUrl.getHost());
}
if (url.getPort() != goldenUrl.getPort()) {
_local4.push((("Port: " + url.getPort()) + "!=") + goldenUrl.getPort());
}
if (url.getPath() != goldenUrl.getPath()) {
_local4.push((("Path: " + url.getPath()) + "!=") + goldenUrl.getPath());
}
var _local5 = url.getParamsMap();
var _local6 = goldenUrl.getParamsMap();
for (var param in _local5) {
if (_local6[param] == undefined) {
var _local7 = _local5[param].join("&");
_local4.push(((("Unexpected param: " + param) + "=>{") + _local7) + "}");
}
}
for (var param in _local6) {
var _local8 = _local6[param].join("&");
if (_local5[param] == undefined) {
_local4.push(((("missing param: " + param) + "=>{") + _local8) + "}");
} else {
var _local9 = _local5[param].join("&");
if (_local9 != _local8) {
_local4.push((((("Inconsistent values for param: " + param) + "=>") + _local9) + "!=") + _local8);
}
}
}
return(_local4.join(" "));
}
static function isEquivalent(url1, url2) {
return(diffUrl(url1, url2) == "");
}
function parseAndInit(spec) {
protocol = findProtocol(spec);
var _local3 = ((protocol == null) ? 0 : (protocol.length + 3));
var _local4 = spec.indexOf("/", _local3);
var _local5 = spec.indexOf("?", _local4);
_local4 = ((_local4 < 0) ? (spec.length) : (_local4));
_local5 = ((_local5 < 0) ? (spec.length) : (_local5));
var _local6 = spec.substring(_local3, _local4).split(":", 2);
host = _local6[0];
port = ((_local6.length > 1) ? (_local6[1]) : null);
var _local7 = host.split(".");
if (_local7.length > 1) {
domain = _local7.slice(_local7.length - 2).join(".");
} else {
domain = null;
}
file = spec.substring(_local4);
path = spec.substring(_local4, _local5);
if (_local5 < spec.length) {
params = spec.substring(_local5 + 1);
} else {
params = "";
}
paramsMap = {};
var _local8 = params.split("&");
var _local9 = 0;
for ( ; _local9 < _local8.length ; _local9++) {
var _local10 = _local8[_local9].split("=", 2);
if (_local10.length == 1) {
_local10.push("");
}
if (paramsMap[_local10[0]] == undefined) {
paramsMap[_local10[0]] = new Array();
}
paramsMap[_local10[0]].push(_local10[1]);
}
}
function findProtocol(spec) {
var _local3 = spec.split("://", 2);
return(((_local3.length > 1) ? (_local3[0]) : null));
}
function getProtocol() {
return(protocol);
}
function getHost() {
return(host);
}
function getDomain() {
return(domain);
}
function getPort() {
return(port);
}
function getFile() {
return(file);
}
function getPath() {
return(path);
}
function getParams() {
return(params);
}
function getParamsMap() {
return(paramsMap);
}
function debugDescribeUrl() {
return((((((((("protocol:" + protocol) + " host:") + host) + " port:") + port) + " path: ") + path) + " params:") + debugDescribeParams(getParamsMap()));
}
}
Symbol 20542 MovieClip [__Packages.com.google.video.ui.ScrollButton] Frame 0
class com.google.video.ui.ScrollButton extends com.google.video.ui.TransparentButton
{
var direction_, redraw, lineStyle, beginFill, endFill, state;
function ScrollButton () {
super();
direction_ = NORTH;
redraw();
}
function drawButtonContents() {
lineStyle(2, 13421772, 100);
beginFill(13421772, 100);
if (direction_ == NORTH) {
com.google.ui.common.Drawing.drawTriangle(this, 4, HEIGHT_NS - 4, WIDTH_NS / 2, 4, WIDTH_NS - 4, HEIGHT_NS - 4, 2);
} else if (direction_ == SOUTH) {
com.google.ui.common.Drawing.drawTriangle(this, 4, 4, WIDTH_NS / 2, HEIGHT_NS - 4, WIDTH_NS - 4, 4, 2);
} else if (direction_ == EAST) {
com.google.ui.common.Drawing.drawTriangle(this, WIDTH_EW - 4, 4, 4, HEIGHT_EW / 2, WIDTH_EW - 4, HEIGHT_EW - 4, 2);
} else if (direction_ == WEST) {
com.google.ui.common.Drawing.drawTriangle(this, 4, 4, WIDTH_EW - 4, HEIGHT_EW / 2, 4, HEIGHT_EW - 4, 2);
}
endFill();
}
function drawButtonContainer() {
var _local2 = 0;
var _local3 = 0;
var _local4 = WIDTH_NS;
var _local5 = HEIGHT_NS;
if ((direction_ == EAST) || (direction_ == WEST)) {
_local4 = WIDTH_EW;
_local5 = HEIGHT_EW;
}
lineStyle(0, 13421772, 0);
if (state == com.google.video.ui.SimpleButton.UP) {
beginFill(0, 10);
com.google.ui.common.Drawing.drawRectangle(this, _local2, _local3, _local4, _local5, 3);
endFill();
} else if (state == com.google.video.ui.SimpleButton.OVER) {
beginFill(4473924, 100);
com.google.ui.common.Drawing.drawRectangle(this, _local2, _local3, _local4, _local5, 3);
endFill();
} else if (state == com.google.video.ui.SimpleButton.DOWN) {
beginFill(2236962, 100);
com.google.ui.common.Drawing.drawRectangle(this, _local2, _local3, _local4, _local5, 3);
endFill();
}
}
function get direction() {
return(direction_);
}
function set direction(val) {
direction_ = val;
redraw();
//return(direction);
}
static var classPath = com.google.video.ui.ScrollButton;
static var linkageName = "__Packages.com.google.video.ui.ScrollButton";
static var forceLinkage = Object.registerClass(linkageName, Function(classPath));
static var NORTH = 0;
static var SOUTH = 1;
static var EAST = 2;
static var WEST = 2;
static var WIDTH_NS = 64;
static var HEIGHT_NS = 16;
static var WIDTH_EW = 20;
static var HEIGHT_EW = 20;
}
Symbol 20543 MovieClip [__Packages.com.google.ui.common.FunctionLinearInterpolator] Frame 0
class com.google.ui.common.FunctionLinearInterpolator
{
function FunctionLinearInterpolator () {
}
static function interpolate(getFunc, setFunc, targetValue, duration, callback, interval) {
if (interval == undefined) {
interval = DEFAULT_INTERVAL;
}
var _local8 = createTimerCallback(getFunc, setFunc, targetValue, duration, callback);
var _local9 = _global.setInterval(_local8, interval);
_local8.timerId = _local9;
}
static function createTimerCallback(getFunc, setFunc, targetValue, duration, callback) {
var originalValue = getFunc();
var totalDelta = (targetValue - originalValue);
var startTime = getTimer();
var targetTime = (startTime + duration);
var _local4 = function () {
var _local2 = Math.min(getTimer(), targetTime);
setFunc(originalValue + (totalDelta * ((_local2 - startTime) / duration)));
if ((_local2 == targetTime) && (arguments.callee.timerId != undefined)) {
_global.clearInterval(arguments.callee.timerId);
if (callback != undefined) {
callback();
}
}
};
return(_local4);
}
static var DEFAULT_INTERVAL = 50;
}
Symbol 20544 MovieClip [__Packages.mx.events.EventDispatcher] Frame 0
class mx.events.EventDispatcher
{
function EventDispatcher () {
}
static function _removeEventListener(queue, event, handler) {
if (queue != undefined) {
var _local5 = queue.length;
var _local6 = 0;
for ( ; _local6 < _local5 ; _local6++) {
var _local7 = queue[_local6];
if (_local7 == handler) {
queue.splice(_local6, 1);
return(undefined);
}
}
}
}
static function initialize(object) {
if (_fEventDispatcher == undefined) {
_fEventDispatcher = new mx.events.EventDispatcher();
}
object.addEventListener = _fEventDispatcher.addEventListener;
object.removeEventListener = _fEventDispatcher.removeEventListener;
object.dispatchEvent = _fEventDispatcher.dispatchEvent;
object.dispatchQueue = _fEventDispatcher.dispatchQueue;
}
function dispatchQueue(queueObj, eventObj) {
var _local4 = "__q_" + eventObj.type;
var _local5 = queueObj[_local4];
if (_local5 != undefined) {
for (var _local6 in _local5) {
var _local7 = _local5[_local6];
var _local8 = typeof(_local7);
if ((_local8 == "object") || (_local8 == "movieclip")) {
if (_local7.handleEvent != undefined) {
_local7.handleEvent(eventObj);
}
if (_local7[eventObj.type] != undefined) {
if (exceptions[eventObj.type] == undefined) {
_local7[eventObj.type](eventObj);
}
}
} else {
_local7.apply(queueObj, [eventObj]);
}
}
}
}
function dispatchEvent(eventObj) {
if (eventObj.target == undefined) {
eventObj.target = this;
}
this[eventObj.type + "Handler"](eventObj);
dispatchQueue(this, eventObj);
}
function addEventListener(event, handler) {
var _local4 = "__q_" + event;
if (this[_local4] == undefined) {
this[_local4] = new Array();
}
_global.ASSetPropFlags(this, _local4, 1);
_removeEventListener(this[_local4], event, handler);
this[_local4].push(handler);
}
function removeEventListener(event, handler) {
var _local4 = "__q_" + event;
_removeEventListener(this[_local4], event, handler);
}
static var _fEventDispatcher = undefined;
static var exceptions = {move:1, draw:1, load:1};
}
Symbol 20545 MovieClip [__Packages.com.google.video.ui.PlaylistButton] Frame 0
class com.google.video.ui.PlaylistButton extends com.google.video.ui.TransparentButton
{
var direction_, redraw, __get__direction, lineStyle, beginFill, endFill, state;
function PlaylistButton () {
super();
direction_ = LEFT;
redraw();
}
function set direction(direction) {
direction_ = direction;
redraw();
//return(__get__direction());
}
function drawButtonContents() {
lineStyle(0, 13421772, 0);
beginFill(16777215, 60);
if (direction_ == LEFT) {
com.google.ui.common.Drawing.drawTriangle(this, 13, 3, 1, 9, 13, 15, 1, 16777215, 60);
} else {
com.google.ui.common.Drawing.drawTriangle(this, 3, 3, 15, 9, 3, 15, 1, 16777215, 60);
}
endFill();
}
function drawButtonContainer() {
var _local2 = 0;
var _local3 = 2;
var _local4 = 16;
var _local5 = 14;
lineStyle(0, 13421772, 0);
if (state == com.google.video.ui.SimpleButton.UP) {
beginFill(0, 10);
} else if (state == com.google.video.ui.SimpleButton.OVER) {
beginFill(4473924, 100);
} else if (state == com.google.video.ui.SimpleButton.DOWN) {
beginFill(2236962, 100);
}
com.google.ui.common.Drawing.drawRectangle(this, _local2, _local3, _local4, _local5, 3);
endFill();
}
static var classPath = com.google.video.ui.PlaylistButton;
static var linkageName = "__Packages.com.google.video.ui.PlaylistButton";
static var forceLinkage = Object.registerClass(linkageName, classPath);
static var LEFT = 0;
static var RIGHT = 1;
static var BUTTON_WIDTH = 18;
}
Symbol 20546 MovieClip [__Packages.com.google.video.ui.TextButton] Frame 0
class com.google.video.ui.TextButton extends com.google.video.ui.TransparentButton
{
var text_, attachMovie, getNextHighestDepth, highlight_, redraw, lineStyle, state, beginFill, endFill, __get__text, useHandCursor, __get__highlight;
function TextButton () {
super();
text_ = com.google.ui.common.StylishText(attachMovie(com.google.ui.common.StylishText.linkageName, "text_", getNextHighestDepth(), {size:13, color:16777215, style:com.google.ui.common.StylishText.BOLD}));
text_._x = 8;
highlight_ = false;
redraw();
}
function get width() {
return(text_.width + 20);
}
function drawButtonContainer() {
lineStyle(1, 16777215, 50);
if (highlight_ || (state == com.google.video.ui.SimpleButton.UP)) {
if (highlight_) {
beginFill(3368601, 80);
} else {
beginFill(3368601, 40);
}
} else if (state == com.google.video.ui.SimpleButton.OVER) {
beginFill(6724044, 40);
} else {
beginFill(4487082, 40);
}
com.google.ui.common.Drawing.drawRectangle(this, 0, 0, width, 18, 0);
endFill();
}
function set text(newText) {
text_.text = newText;
redraw();
//return(__get__text());
}
function set highlight(val) {
highlight_ = val;
useHandCursor = !highlight_;
redraw();
//return(__get__highlight());
}
static var classPath = com.google.video.ui.TextButton;
static var linkageName = "__Packages.com.google.video.ui.TextButton";
static var forceLinkage = Object.registerClass(linkageName, classPath);
}
Symbol 20547 MovieClip [__Packages.com.google.media.MediaCache] Frame 0
class com.google.media.MediaCache
{
var cache_;
function MediaCache () {
cache_ = new Object();
}
function put(name, media) {
cache_[name] = media;
}
function get(name) {
return(cache_[name]);
}
function contains(name) {
return(get(name) != undefined);
}
function remove(name) {
cache_[name] = undefined;
}
}
Symbol 20548 MovieClip [__Packages.com.google.video.ui.BufferingWidget] Frame 0
class com.google.video.ui.BufferingWidget extends MovieClip
{
var buffering_, advanceCount_, motionCounter_, widgets_, clear, __get__buffering, lineStyle, beginFill, endFill;
function BufferingWidget () {
super();
buffering_ = false;
advanceCount_ = ADVANCE_FRAMES;
motionCounter_ = 0;
widgets_ = new Array();
var _local3 = 0;
for ( ; _local3 < NUM_SEGMENTS ; _local3++) {
widgets_.push(0);
}
widgets_[0] = INTENSITY;
clear();
}
function onEnterFrame() {
redraw();
}
function set buffering(val) {
buffering_ = val;
if (!buffering_) {
clear();
}
//return(__get__buffering());
}
function redraw() {
if (buffering_) {
clear();
lineStyle(0, 0, 0);
var _local2 = 0;
for ( ; _local2 < NUM_SEGMENTS ; _local2++) {
beginFill(16777215, widgets_[_local2]);
com.google.ui.common.Drawing.drawRectangle(this, 8 + (_local2 * 8), 4, 4, 12, 4);
endFill();
widgets_[_local2] = widgets_[_local2] - 3;
}
advanceCount_--;
if (advanceCount_ < 0) {
motionCounter_ = (motionCounter_ + 1) % ((NUM_SEGMENTS * 2) - 2);
var _local3 = motionCounter_ % NUM_SEGMENTS;
if (motionCounter_ >= NUM_SEGMENTS) {
_local3 = (NUM_SEGMENTS - _local3) - 2;
}
widgets_[_local3] = INTENSITY;
advanceCount_ = ADVANCE_FRAMES;
}
}
}
static var classPath = com.google.video.ui.BufferingWidget;
static var linkageName = "__Packages.com.google.video.ui.BufferingWidget";
static var forceLinkage = Object.registerClass(linkageName, Function(classPath));
static var INTENSITY = 64;
static var NUM_SEGMENTS = 5;
static var ADVANCE_FRAMES = 2;
}
Symbol 20549 MovieClip [__Packages.com.google.media.IStreamingMediaSource] Frame 0
class com.google.media.IStreamingMediaSource
{
function IStreamingMediaSource () {
}
}
Symbol 20550 MovieClip [__Packages.com.google.video.apps.MediaState] Frame 0
class com.google.video.apps.MediaState
{
var isAd, guidParams, docid, initialTime, duration, videoUrl, audioUrl, thumbnailUrl, playPage, videoPublisherId, videoChannelId, showSpeedControl, videoPubHost;
function MediaState () {
isAd = false;
guidParams = new Object();
}
function fromArgs(mainClip, playPageBase) {
if (mainClip.docid != "") {
docid = mainClip.docid;
}
initialTime = mainClip.initialtime;
duration = 0;
if ((mainClip.videoUrl == undefined) && (mainClip.videourl != undefined)) {
mainClip.videoUrl = mainClip.videourl;
}
if ((mainClip.thumbnailurl == undefined) && (mainClip.thumbnailUrl != undefined)) {
mainClip.thumbnailurl = mainClip.thumbnailUrl;
}
if (com.google.webutil.url.Utils.isValidVideoUrl(mainClip.videoUrl)) {
videoUrl = mainClip.videoUrl;
}
if (com.google.webutil.url.Utils.isValidAudioUrl(mainClip.audioUrl)) {
audioUrl = mainClip.audioUrl;
}
if (com.google.webutil.url.Utils.isValidAbsoluteGoogleUrl(mainClip.thumbnailurl) || (com.google.webutil.url.Utils.isValidThumbnailUrl(mainClip.thumbnailurl))) {
thumbnailUrl = mainClip.thumbnailurl;
}
if (mainClip.clickUrl != undefined) {
var _local4 = new Array();
var _local5 = mainClip.clickUrl.split(",");
var _local6 = 0;
for ( ; _local6 < (_local5.length - 2) ; _local6 = _local6 + 3) {
_local4.push({start:_local5[_local6], end:_local5[_local6 + 1], url:_local5[_local6 + 2]});
}
}
var _local7 = "&hl=" + mainClip.hl;
if (docid != undefined) {
playPage = (playPageBase + docid) + _local7;
} else if (mainClip.playerId != undefined) {
playPage = (playPageBase + mainClip.playerId) + _local7;
}
if (mainClip.videopubid != "") {
videoPublisherId = mainClip.videopubid;
}
if ((mainClip.videochannelid != undefined) && (mainClip.videochannelid != "")) {
videoChannelId = mainClip.videochannelid.split("+");
}
if (mainClip.speedcontrol == 0) {
showSpeedControl = false;
} else {
showSpeedControl = true;
}
}
function fromMediaRssItem(mainClip, item, applyInitialTime) {
guidParams = getRequestArgs(item.guid);
docid = guidParams.docid;
videoPubHost = mainClip.pubhost;
isAd = item["gm:cpa_choice"] != undefined;
duration = 0;
var _local5 = item.mediagroup;
var _local6 = 0;
for ( ; _local6 < _local5.length ; _local6++) {
if (_local5[_local6].name == "media:content") {
if (_local5[_local6].type == "video/x-flv") {
videoUrl = _local5[_local6].url;
duration = _local5[_local6].duration;
} else if (_local5[_local6].type == "application/x-shockwave-flash") {
var _local7 = getRequestArgs(_local5[_local6].url);
if (_local7.speedcontrol == 0) {
showSpeedControl = false;
} else {
showSpeedControl = true;
}
}
}
if (_local5[_local6].name == "media:thumbnail") {
thumbnailUrl = _local5[_local6].url;
}
}
playPage = item.link;
if (item["gv:publisherId"] != "") {
videoPublisherId = item["gv:publisherId"];
}
if ((item["gv:channelId"] != undefined) && (item["gv:channelId"] != "")) {
videoChannelId = item["gv:channelId"].split("+");
}
if (applyInitialTime) {
initialTime = mainClip.initialtime;
}
}
static function getRequestArgs(url) {
var _local3 = url;
var _local4 = com.google.webutil.url.Utils.getUrlParameter(url, "q");
if ((url.indexOf("/url") != -1) && (_local4 != null)) {
_local3 = _global.unescape(_local4);
}
var _local5 = new Object();
var _local6 = _local3.split("?")[1].split("&");
var _local7 = 0;
for ( ; _local7 < _local6.length ; _local7++) {
var _local8 = _local6[_local7].split("=");
_local5[_local8[0]] = _local8[1];
}
return(_local5);
}
}
Symbol 20551 MovieClip [__Packages.com.google.video.ui.PlaylistItem] Frame 0
class com.google.video.ui.PlaylistItem extends com.google.video.ui.ListItem
{
var title_, attachMovie, getNextHighestDepth, metaData_, playlistSize_, nowPlaying_, state, lineStyle, beginFill, endFill, loadThumbnail;
function PlaylistItem () {
super();
title_ = com.google.ui.common.StylishText(attachMovie(com.google.ui.common.StylishText.linkageName, "title_", getNextHighestDepth(), {size:13, color:16777215, style:com.google.ui.common.StylishText.UNDERLINE}));
title_._x = com.google.video.ui.ListItem.TEXT_X;
title_._y = 2;
title_.maxWidth = 200;
metaData_ = com.google.ui.common.StylishText(attachMovie(com.google.ui.common.StylishText.linkageName, "metaData_", getNextHighestDepth(), {size:12, color:8947848}));
metaData_._x = com.google.video.ui.ListItem.TEXT_X;
metaData_._y = 20;
metaData_.maxWidth = 200;
playlistSize_ = com.google.ui.common.StylishText(attachMovie(com.google.ui.common.StylishText.linkageName, "playlistSize_", getNextHighestDepth(), {size:12, color:8947848}));
playlistSize_._x = com.google.video.ui.ListItem.TEXT_X;
playlistSize_._y = 34;
playlistSize_.maxWidth = 200;
nowPlaying_._x = ((300 - nowPlaying_.width) - 24) - 4;
nowPlaying_._y = 34;
}
function drawBackground() {
super.drawBackground();
if ((state == com.google.video.ui.SimpleButton.OVER) || (state == com.google.video.ui.SimpleButton.DOWN)) {
lineStyle(0, 0, 0);
beginFill(16777215, 80);
com.google.ui.common.Drawing.drawTriangle(this, 276 + 4, 12, 276 + 16, 28, 276 + 4, 44, 0);
endFill();
}
}
function initialize(itemData) {
loadThumbnail(itemData.thumbnailUrl);
title_.text = itemData.title;
if (itemData.description != undefined) {
metaData_.text = itemData.description;
}
playlistSize_.text = itemData.items.length + " videos";
}
static var classPath = com.google.video.ui.PlaylistItem;
static var linkageName = "__Packages.com.google.video.ui.PlaylistItem";
static var forceLinkage = Object.registerClass(linkageName, classPath);
}
Symbol 20552 MovieClip [__Packages.com.google.ui.common.BackedIconButton] Frame 0
class com.google.ui.common.BackedIconButton extends com.google.ui.common.UIComponent
{
var tabChildren, backgroundBox_, attachMovie, getNextHighestDepth, iconButton_, tabIndex_, _y, _x, __width, __height, dispatchEvent;
function BackedIconButton () {
super();
}
function init() {
mx.events.EventDispatcher.initialize(this);
super.init();
}
function createChildren() {
tabChildren = true;
if (backgroundBox_ == undefined) {
backgroundBox_ = attachMovie(com.google.ui.common.ColorLayer.linkageID, "backgroundBox_", getNextHighestDepth(), {_visible:true, _height:20, _width:20, _x:0, _y:0, layerColor:15592941, layerAlpha:100, radius:radius_});
backgroundBox_.tabChildren = true;
}
if (iconButton_ == undefined) {
iconButton_ = attachMovie(com.google.ui.common.IconButton.linkageName, "iconButton", getNextHighestDepth(), {_width:128, _height:23, _x:_x + padding_, _y:_y + padding_, baseName:"btn", label:label_, tabIndex:tabIndex_, labelFontSize:labelFontSize_});
iconButton_.tabChildren = true;
iconButton_.addEventListener("press", com.google.utils.DelegateEx.create(this, handlePress));
iconButton_.addEventListener("hold", com.google.utils.DelegateEx.create(this, handleHold));
iconButton_.addEventListener("release", com.google.utils.DelegateEx.create(this, handleRelease));
iconButton_.addEventListener("releaseOutside", com.google.utils.DelegateEx.create(this, handleReleaseOutside));
}
size();
}
function size() {
backgroundBox_._x = 0.5;
backgroundBox_._y = 0.5;
backgroundBox_.setSize(__width, __height - 1);
iconButton_._x = padding_;
iconButton_._y = padding_;
iconButton_.setSize(__width - (padding_ * 2), __height - (padding_ * 2));
}
function handlePress(evtObj) {
dispatchEvent({type:"press", target:this});
}
function handleHold(evtObj) {
dispatchEvent({type:"hold", target:this});
}
function handleRelease(evtObj) {
dispatchEvent({type:"release", target:this});
}
function handleReleaseOutside(evtObj) {
dispatchEvent({type:"releaseOutside", target:this});
}
function set radius(val) {
radius_ = val;
size();
//return(radius);
}
function get radius() {
return(radius_);
}
function set padding(val) {
padding_ = val;
size();
//return(padding);
}
function get padding() {
return(padding_);
}
function get label() {
return(label_);
}
function set label(val) {
label_ = val;
//return(label);
}
function get iconButton() {
return(iconButton_);
}
function set iconButton(val) {
iconButton_ = val;
//return(iconButton);
}
function set tabIndex(val) {
tabIndex_ = val;
//return(tabIndex);
}
function get tabIndex() {
return(tabIndex_);
}
function set labelFontSize(val) {
labelFontSize_ = val;
size();
//return(labelFontSize);
}
function get labelFontSize() {
return(labelFontSize_);
}
function setFocus() {
iconButton_.setFocus(this);
}
static var classPath = com.google.ui.common.BackedIconButton;
static var linkageID = "__Packages.com.google.ui.common.BackedIconButton";
static var forceLinkage = Object.registerClass(linkageID, classPath);
var padding_ = 3;
var label_ = "";
var radius_ = 0;
var labelFontSize_ = 14;
}
Symbol 20553 MovieClip [__Packages.com.google.video.apps.BaseVideoPlayback] Frame 0
class com.google.video.apps.BaseVideoPlayback
{
var clip_, bufferTime_, mediaPlayer_, mediaState_, width_, height_, errorMessageBox_, __get__autoplay;
function BaseVideoPlayback (clip) {
clip_ = clip;
clip_.setSize = com.google.utils.DelegateEx.create(this, setSize);
}
function run() {
if (!initializeApplication()) {
return(false);
}
if (getVersionInfo().majorVersion < MINIMUM_MAJOR_VERSION) {
insufficientVersionError();
return(false);
}
initializePlayer();
return(true);
}
function insufficientVersionError() {
applicationError(ERROR_UPGRADE_FLASH);
}
function initializeApplication() {
clip_.menu.hideBuiltInItems();
if ((clip_.initialwidth != undefined) && (clip_.initialheight != undefined)) {
setSize(clip_.initialwidth, clip_.initialheight);
} else {
Stage.scaleMode = "noScale";
Stage.align = "TL";
Stage.showMenu = false;
var _local2 = new Object();
_local2.onResize = com.google.utils.DelegateEx.create(this, HandleStageResize);
Stage.addListener(_local2);
clip_._x = 0;
clip_._y = 0;
setSize(Stage.width, Stage.height);
}
bufferTime_ = clip_.bufferTime;
HandleResize();
return(true);
}
function initializePlayer() {
if (mediaPlayer_ != undefined) {
delete mediaPlayer_;
}
mediaPlayer_ = clip_.attachMovie(com.google.ui.media.MediaPlayer.linkageName, "mediaPlayer_", clip_.getNextHighestDepth());
mediaPlayer_.addEventListener("donePlaying", com.google.utils.DelegateEx.create(this, onPlaybackComplete));
mediaPlayer_.addEventListener("clickVideo", com.google.utils.DelegateEx.create(this, onClickVideo));
mediaPlayer_.addEventListener("error", com.google.utils.DelegateEx.create(this, onVideoError));
mediaPlayer_.addEventListener("stateChange", com.google.utils.DelegateEx.create(this, onStateChange));
mediaPlayer_.playerMode = com.google.ui.media.MediaPlayer.PLAYER_MODE_NORMAL;
mediaPlayer_.bufferTime = 1;
mediaPlayer_.mediaType = com.google.ui.media.MediaPlayer.MEDIA_VIDEO;
HandleResize();
}
function initPlayerWithVars() {
}
function getVersionInfo() {
var _local2 = new Object();
var _local3 = getVersion();
_local3 = _local3.split(" ");
var _local4 = _local3[1].split(",");
_local2.majorVersion = _local4[0];
return(_local2);
}
function get mediaPlayer() {
return(mediaPlayer_);
}
function set mediaState(val) {
mediaState_ = val;
//return(mediaState);
}
function get mediaState() {
return(mediaState_);
}
function onPlaybackComplete() {
}
function onClickVideo() {
}
function onVideoError() {
mediaPlayer_.showMessage(ERROR_NO_VIDEO);
}
function onStateChange(evtObj) {
if (evtObj.newState == com.google.ui.media.MediaPlayer.STATE_PLAYING) {
mediaPlayer_.hideMessage();
}
}
function setSize(width, height) {
width_ = width;
height_ = height;
HandleResize();
}
function HandleStageResize() {
setSize(Stage.width, Stage.height);
}
function HandleResize() {
mediaPlayer_._x = 0;
mediaPlayer_._y = 0;
mediaPlayer_.setSize(width_, height_);
errorMessageBox_._x = 0;
errorMessageBox_._y = 0;
errorMessageBox_.setSize(width_, height_);
return(undefined);
}
function applicationError(messageText) {
if (errorMessageBox_ == undefined) {
errorMessageBox_ = clip_.attachMovie(com.google.ui.common.MessageBox.linkageName, "errorMessageBox_", clip_.getNextHighestDepth());
}
errorMessageBox_._visible = true;
errorMessageBox_.message = messageText;
HandleResize();
}
function set autoplay(val) {
clip_.autoplay = val;
//return(__get__autoplay());
}
var MINIMUM_MAJOR_VERSION = 7;
var ERROR_UPGRADE_FLASH = "Please upgrade to Flash Player 7 to watch this video.";
var ERROR_NO_VIDEO = "This video is currently not available.\nPlease try again later.";
}
Symbol 20554 MovieClip [__Packages.com.google.video.ui.MiniPlayPauseButton] Frame 0
class com.google.video.ui.MiniPlayPauseButton extends com.google.video.ui.TransparentButton
{
var showPlay_, hitAreaClip_, createEmptyMovieClip, getNextHighestDepth, hitArea, lineStyle, state, beginFill, endFill, clear, __get__showPlay;
function MiniPlayPauseButton () {
super();
showPlay_ = true;
hitAreaClip_ = createEmptyMovieClip("hitAreaClip_", getNextHighestDepth());
hitAreaClip_._visible = false;
hitAreaClip_.beginFill(16777215, 100);
com.google.ui.common.Drawing.drawRectangle(hitAreaClip_, 0, 0, 20, 20, 0);
hitAreaClip_.endFill();
hitArea = hitAreaClip_;
redraw();
}
function drawButtonContainer() {
var _local2 = 1;
var _local3 = 2;
var _local4 = 26;
var _local5 = 16;
lineStyle(0, 13421772, 0);
if (state == com.google.video.ui.SimpleButton.UP) {
beginFill(0, 10);
com.google.ui.common.Drawing.drawRectangle(this, _local2, _local3, _local4, _local5, 3);
endFill();
} else if (state == com.google.video.ui.SimpleButton.OVER) {
beginFill(4473924, 100);
com.google.ui.common.Drawing.drawRectangle(this, _local2, _local3, _local4, _local5, 3);
endFill();
} else if (state == com.google.video.ui.SimpleButton.DOWN) {
beginFill(2236962, 100);
com.google.ui.common.Drawing.drawRectangle(this, _local2, _local3, _local4, _local5, 3);
endFill();
}
}
function redraw() {
clear();
drawButtonContainer();
lineStyle(0, 0, 0);
if (showPlay_) {
beginFill(16777215, 100);
com.google.ui.common.Drawing.drawTriangle(this, 8, 4, 20, 10, 8, 16, 0);
} else {
beginFill(13421772, 100);
com.google.ui.common.Drawing.drawRectangle(this, 9, 4, 4, 12, 2);
com.google.ui.common.Drawing.drawRectangle(this, 15, 4, 4, 12, 2);
}
endFill();
}
function set showPlay(val) {
if (val != showPlay_) {
showPlay_ = val;
redraw();
}
//return(__get__showPlay());
}
static var classPath = com.google.video.ui.MiniPlayPauseButton;
static var linkageName = "__Packages.com.google.video.ui.MiniPlayPauseButton";
static var forceLinkage = Object.registerClass(linkageName, classPath);
}
Symbol 20555 MovieClip [__Packages.com.google.ui.common.Drawing] Frame 0
class com.google.ui.common.Drawing
{
function Drawing () {
}
static function distance(x1, y1, x2, y2) {
return(Math.sqrt(((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1))));
}
static function drawTriangle(target, x1, y1, x2, y2, x3, y3, roundness) {
if (roundness == 0) {
target.moveTo(x1, y1);
target.lineTo(x2, y2);
target.lineTo(x3, y3);
target.lineTo(x1, y1);
} else {
var _local10 = distance(x1, y1, x3, y3);
var _local11 = distance(x1, y1, x2, y2);
var _local12 = distance(x2, y2, x3, y3);
target.moveTo(x1 + ((roundness / _local10) * (x3 - x1)), y1 + ((roundness / _local10) * (y3 - y1)));
target.curveTo(x1, y1, x1 + ((roundness / _local11) * (x2 - x1)), y1 + ((roundness / _local11) * (y2 - y1)));
target.lineTo(x2 + ((roundness / _local11) * (x1 - x2)), y2 + ((roundness / _local11) * (y1 - y2)));
target.curveTo(x2, y2, x2 + ((roundness / _local12) * (x3 - x2)), y2 + ((roundness / _local12) * (y3 - y2)));
target.lineTo(x3 + ((roundness / _local12) * (x2 - x3)), y3 + ((roundness / _local12) * (y2 - y3)));
target.curveTo(x3, y3, x3 + ((roundness / _local10) * (x1 - x3)), y3 + ((roundness / _local10) * (y1 - y3)));
target.lineTo(x1 + ((roundness / _local10) * (x3 - x1)), y1 + ((roundness / _local10) * (y3 - y1)));
}
}
static function drawRectangle(target, x, y, width, height, roundness) {
if (roundness == 0) {
target.moveTo(x, y);
target.lineTo(x + width, y);
target.lineTo(x + width, y + height);
target.lineTo(x, y + height);
target.lineTo(x, y);
} else {
target.moveTo(x + roundness, y);
target.lineTo((x + width) - roundness, y);
target.curveTo(x + width, y, x + width, y + roundness);
target.lineTo(x + width, (y + height) - roundness);
target.curveTo(x + width, y + height, (x + width) - roundness, y + height);
target.lineTo(x + roundness, y + height);
target.curveTo(x, y + height, x, (y + height) - roundness);
target.lineTo(x, y + roundness);
target.curveTo(x, y, x + roundness, y);
}
}
static function drawPolygon(target, points) {
target.moveTo(points[0], points[1]);
var _local4 = 2;
for ( ; (_local4 + 1) < points.length ; _local4 = _local4 + 2) {
target.lineTo(points[_local4], points[_local4 + 1]);
}
target.lineTo(points[0], points[1]);
}
}
Symbol 20556 MovieClip [__Packages.com.google.youtube.event.UIEvent] Frame 0
class com.google.youtube.event.UIEvent
{
function UIEvent () {
}
static var RESIZE = "onResize";
static var SEEK = "onSeek";
static var CHANGE = "onChange";
static var CLOSE = "onClose";
static var START_RESIZE = "onStartResize";
static var SHOW = "onShow";
static var HIDE = "onHide";
}
Symbol 20557 MovieClip [__Packages.com.google.video.ui.ControlBar] Frame 0
class com.google.video.ui.ControlBar extends MovieClip
{
var simpleBackground_, createEmptyMovieClip, getNextHighestDepth, videoPlayback_, mediaPlayer_, width_, height_;
function ControlBar () {
super();
mx.events.EventDispatcher.initialize(this);
simpleBackground_ = createEmptyMovieClip("simpleBackground_", getNextHighestDepth());
}
function initialize(vp) {
videoPlayback_ = vp;
mediaPlayer_ = vp.mediaPlayer;
}
function setSize(width, height) {
width_ = width;
height_ = height;
simpleBackground_.clear();
simpleBackground_.lineStyle(0, 0, 0);
simpleBackground_.beginFill(0, 40);
com.google.ui.common.Drawing.drawRectangle(simpleBackground_, 0, height - 20, width, 20, 0);
simpleBackground_.endFill();
}
static var classPath = com.google.video.ui.ControlBar;
static var linkageName = "__Packages.com.google.video.ui.ControlBar";
static var forceLinkage = Object.registerClass(linkageName, Function(classPath));
}
Symbol 20558 MovieClip [__Packages.com.google.video.ui.SyndicatedControlBar] Frame 0
class com.google.video.ui.SyndicatedControlBar extends com.google.video.ui.ControlBar
{
var titleCardRotator_, attachMovie, getNextHighestDepth, miniPlayPauseButton_, scrubber_, muteButton_, mailButton_, prevButton_, skipButton_, playlistOpenButton_, playlistUIContainer_, createEmptyMovieClip, metadataBalloon_, balloonFader_, showMetadata_, showMetadataUntil_, playlistUI_, visibleFader_, shareCard_, shareFader_, bigHonkingPlayButton_, logoBackground_, googleLogo_, logoFader_, dispatchEvent, mediaPlayer_, simpleBackground_, __get__rotateTitleCard, __get__videoPubHost, __get__videoContentPackageInfo, playlists_;
function SyndicatedControlBar () {
super();
titleCardRotator_ = com.google.video.ui.TitleCardRotator(attachMovie(com.google.video.ui.TitleCardRotator.linkageName, "titleCardRotator_", getNextHighestDepth()));
titleCardRotator_.addEventListener("curIndexUpdated", com.google.utils.DelegateEx.create(this, onCurIndexUpdated));
titleCardRotator_.addEventListener("clicked", com.google.utils.DelegateEx.create(this, onPlayPauseClicked));
miniPlayPauseButton_ = com.google.video.ui.MiniPlayPauseButton(attachMovie(com.google.video.ui.MiniPlayPauseButton.linkageName, "miniPlayPauseButton_", getNextHighestDepth()));
miniPlayPauseButton_.addEventListener("clicked", com.google.utils.DelegateEx.create(this, onPlayPauseClicked));
scrubber_ = com.google.video.ui.Scrubber(attachMovie(com.google.video.ui.Scrubber.linkageName, "scrubber_", getNextHighestDepth()));
muteButton_ = com.google.video.ui.MuteButton(attachMovie(com.google.video.ui.MuteButton.linkageName, "muteButton_", getNextHighestDepth()));
muteButton_.addEventListener("clicked", com.google.utils.DelegateEx.create(this, onMuteClicked));
mailButton_ = com.google.video.ui.MailButton(attachMovie(com.google.video.ui.MailButton.linkageName, "mailButton_", getNextHighestDepth()));
mailButton_.addEventListener("clicked", com.google.utils.DelegateEx.create(this, onMailClicked));
prevButton_ = com.google.video.ui.SkipButton(attachMovie(com.google.video.ui.SkipButton.linkageName, "prevButton_", getNextHighestDepth(), {direction:com.google.video.ui.SkipButton.EAST}));
prevButton_.addEventListener("clicked", com.google.utils.DelegateEx.create(this, onPrevClicked));
skipButton_ = com.google.video.ui.SkipButton(attachMovie(com.google.video.ui.SkipButton.linkageName, "skipButton_", getNextHighestDepth(), {direction:com.google.video.ui.SkipButton.WEST}));
skipButton_.addEventListener("clicked", com.google.utils.DelegateEx.create(this, onSkipClicked));
playlistOpenButton_ = com.google.video.ui.PlaylistOpenButton(attachMovie(com.google.video.ui.PlaylistOpenButton.linkageName, "playlistOpenButton_", getNextHighestDepth()));
playlistOpenButton_.addEventListener("clicked", com.google.utils.DelegateEx.create(this, onOpen));
playlistUIContainer_ = createEmptyMovieClip("playlistUIContainer_", getNextHighestDepth());
playlistUIContainer_._x = 0;
playlistUIContainer_._y = 0;
var _local3 = playlistUIContainer_.createEmptyMovieClip("playlistClipRegion", playlistUIContainer_.getNextHighestDepth());
_local3.beginFill(0, 100);
com.google.ui.common.Drawing.drawRectangle(_local3, 0, 0, 300, 230, 0);
_local3.endFill();
playlistUIContainer_.setMask(_local3);
metadataBalloon_ = com.google.video.ui.MetadataBalloon(playlistUIContainer_.attachMovie(com.google.video.ui.MetadataBalloon.linkageName, "metadataBalloon_", playlistUIContainer_.getNextHighestDepth()));
metadataBalloon_.title = "Title text";
metadataBalloon_.provider = "Provider text";
metadataBalloon_._x = 14.5;
metadataBalloon_._y = 256.5;
var metadataBalloon = metadataBalloon_;
var _local4 = function () {
return(metadataBalloon._y);
};
var _local5 = function (val) {
metadataBalloon._y = val;
};
balloonFader_ = new com.google.ui.common.SmoothFader(_local4, _local5, 1);
showMetadata_ = false;
showMetadataUntil_ = 0;
playlistUI_ = com.google.video.ui.PlaylistUI(playlistUIContainer_.attachMovie(com.google.video.ui.PlaylistUI.linkageName, "playlistUI_clip", playlistUIContainer_.getNextHighestDepth()));
playlistUI_._y = 250;
playlistOpenButton_.direction = com.google.video.ui.PlaylistOpenButton.NORTH;
playlistUI_.addEventListener("videoItemClicked", com.google.utils.DelegateEx.create(this, onVideoItemClicked));
var playlistUI = playlistUI_;
var _local6 = function () {
return(playlistUI._y);
};
var _local7 = function (val) {
playlistUI._y = val;
};
visibleFader_ = new com.google.ui.common.SmoothFader(_local6, _local7, 4);
shareCard_ = com.google.video.ui.ShareCard(playlistUIContainer_.attachMovie(com.google.video.ui.ShareCard.linkageName, "shareCard_", playlistUIContainer_.getNextHighestDepth()));
shareCard_._y = 250;
shareCard_.addEventListener("closeClicked", com.google.utils.DelegateEx.create(this, onShareCloseClicked));
var shareCard = shareCard_;
var _local8 = function () {
return(shareCard._y);
};
var _local9 = function (val) {
shareCard._y = val;
};
shareFader_ = new com.google.ui.common.SmoothFader(_local8, _local9, 4);
bigHonkingPlayButton_ = com.google.video.ui.BigHonkingPlayButton(attachMovie(com.google.video.ui.BigHonkingPlayButton.linkageName, "bigHonkingPlayButton_", getNextHighestDepth()));
bigHonkingPlayButton_.addEventListener("clicked", com.google.utils.DelegateEx.create(this, onPlayPauseClicked));
logoBackground_ = createEmptyMovieClip("logoBackground_", getNextHighestDepth());
logoBackground_._alpha = 100;
googleLogo_ = logoBackground_.attachMovie("powered_by_google_sm_blackbg", "googleLogo_", logoBackground_.getNextHighestDepth());
var logoBackground = logoBackground_;
var _local10 = function () {
return(logoBackground._alpha);
};
var _local11 = function (val) {
logoBackground._alpha = val;
};
logoFader_ = new com.google.ui.common.SmoothFader(_local10, _local11, 10);
playlistOpenButton_._visible = false;
mailButton_._visible = false;
muteButton_._visible = false;
}
function onVideoItemClicked(evtObj) {
dispatchEvent({type:"videoItemClicked", itemPos:evtObj.itemPos});
onOpen(null);
}
function onOpen(evtObj) {
if (visibleFader_.target == 0) {
visibleFader_.target = 300;
playlistOpenButton_.direction = com.google.video.ui.PlaylistOpenButton.NORTH;
playlistUI_.onChannelClicked(null);
} else {
if (shareFader_.target == 0) {
onMailClicked(null);
}
visibleFader_.target = 0;
playlistOpenButton_.direction = com.google.video.ui.PlaylistOpenButton.SOUTH;
}
}
function initialize(vp) {
super.initialize(vp);
mediaPlayer_.addEventListener("stateChange", com.google.utils.DelegateEx.create(this, onPlayerStateChange));
mediaPlayer_.addEventListener("playProgressUpdated", com.google.utils.DelegateEx.create(this, onPlayProgressUpdated));
mediaPlayer_.installScrubber(scrubber_);
muteButton_.muted = (mediaPlayer_.mute = false);
var _local4 = com.google.utils.DelegateEx.create(this, onPlayPauseClicked);
logoBackground_.onPress = _local4;
}
function setSize(width, height) {
super.setSize(width, height);
titleCardRotator_._y = 17;
titleCardRotator_.setSize(width, height - 37);
miniPlayPauseButton_._x = 4;
miniPlayPauseButton_._y = height - 20;
prevButton_._x = 32;
prevButton_._y = height - 19;
scrubber_._x = prevButton_._x + 24;
scrubber_._y = height - 21;
skipButton_._x = scrubber_._x + 86;
skipButton_._y = height - 19;
playlistOpenButton_._x = skipButton_._x + 21;
playlistOpenButton_._y = height - 19;
mailButton_._x = muteButton_._x - 20;
mailButton_._y = height - 19;
muteButton_._x = (width - 16) - 8;
muteButton_._y = height - 19;
googleLogo_._y = height - 18;
googleLogo_._x = width - 110;
bigHonkingPlayButton_._x = (width / 2) - 40;
bigHonkingPlayButton_._y = (height / 2) - 20;
logoBackground_.clear();
logoBackground_.lineStyle(0, 0, 0);
logoBackground_.beginFill(0, 75);
com.google.ui.common.Drawing.drawRectangle(logoBackground_, 0, height - 20, width, 20, 0);
logoBackground_.endFill();
simpleBackground_.clear();
simpleBackground_.lineStyle(0, 0, 0);
simpleBackground_.beginFill(0, 100);
com.google.ui.common.Drawing.drawRectangle(simpleBackground_, 0, height - 20, width, 20, 0);
simpleBackground_.endFill();
}
function set rotateTitleCard(val) {
titleCardRotator_.hide = !val;
//return(__get__rotateTitleCard());
}
function set videoPubHost(val) {
shareCard_.videoPubHost = val;
//return(__get__videoPubHost());
}
function set videoContentPackageInfo(val) {
shareCard_.videoContentPackageInfo = val;
//return(__get__videoContentPackageInfo());
}
function onPlayPauseClicked(evtObj) {
if (logoFader_.target != 0) {
dispatchEvent({type:"videoItemClicked", itemPos:playlists_.curIndex});
} else {
mediaPlayer_.toggle();
}
}
function onMuteClicked(evtObj) {
muteButton_.muted = !muteButton_.muted;
mediaPlayer_.mute = muteButton_.muted;
}
function onMailClicked(evtObj) {
if (shareFader_.target == 0) {
shareFader_.target = 300;
} else {
if (visibleFader_.target == 0) {
onOpen(null);
}
shareFader_.target = 0;
}
}
function onSkipClicked(evtObj) {
showMetadataUntil_ = getTimer() + 3000;
dispatchEvent({type:"nextItem"});
}
function onPrevClicked(evtObj) {
showMetadataUntil_ = getTimer() + 3000;
dispatchEvent({type:"prevItem"});
}
function onPlayerStateChange(evtObj) {
if (logoFader_.target != 0) {
showMetadataUntil_ = getTimer() + 3000;
delete logoBackground_.onPress;
}
logoFader_.target = 0;
miniPlayPauseButton_._visible = true;
scrubber_._visible = true;
muteButton_._visible = true;
mailButton_._visible = true;
skipButton_._visible = true;
playlistOpenButton_._visible = true;
bigHonkingPlayButton_._visible = false;
titleCardRotator_.hide = true;
var _local3 = (miniPlayPauseButton_.showPlay = (evtObj.newState != com.google.ui.media.MediaPlayer.STATE_PLAYING) && (evtObj.newState != com.google.ui.media.MediaPlayer.STATE_BUFFERING));
if ((!_local3) && (showMetadata_)) {
showMetadataUntil_ = getTimer() + 3000;
}
showMetadata_ = _local3;
}
function onShareCloseClicked(evtObj) {
onMailClicked(null);
}
function onPlayProgressUpdated(evtObj) {
scrubber_.position = evtObj.newTime / mediaPlayer_.duration;
}
function loadFromPlaylists(playlists) {
playlists_ = playlists;
playlistUI_.loadFromPlaylists(playlists_);
titleCardRotator_.loadFromPlaylists(playlists_);
playlists_.addEventListener("curIndexUpdated", com.google.utils.DelegateEx.create(this, onCurIndexUpdated));
}
function onCurIndexUpdated(evtObj) {
metadataBalloon_.updateMetadata(playlists_);
shareCard_.updateMetadata(playlists_);
if (evtObj.showMetadata) {
showMetadata_ = true;
}
}
function onEnterFrame() {
if (showMetadata_ || (getTimer() < showMetadataUntil_)) {
balloonFader_.target = 188.5;
} else {
balloonFader_.target = 256.5;
}
}
static var classPath = com.google.video.ui.SyndicatedControlBar;
static var linkageName = "__Packages.com.google.video.ui.SyndicatedControlBar";
static var forceLinkage = Object.registerClass(linkageName, classPath);
}
Symbol 20559 MovieClip [__Packages.com.google.video.subtitle.SubtitleControl] Frame 0
class com.google.video.subtitle.SubtitleControl extends com.google.xml.AbstractXmlFetcher
{
var mode_, loaded_, paused_, trackList_, currTrackIndex_, currTime_, currFrame_, indexToSwitchTo_, shadowedText_, trackMenu_, overlayOnVideo_, updateTimer_, localSettings_, docid_, url_, mediaPlayer_, controlBar_, dispatchEvent, idHashList_, init, fetch;
function SubtitleControl (mediaplayer) {
super();
mode_ = MODE_OFF;
loaded_ = false;
paused_ = false;
trackList_ = new Array();
currTrackIndex_ = -1;
currTime_ = -1;
currFrame_ = null;
indexToSwitchTo_ = -1;
shadowedText_ = null;
trackMenu_ = null;
overlayOnVideo_ = false;
updateTimer_ = null;
localSettings_ = null;
docid_ = null;
url_ = null;
mediaPlayer_ = mediaplayer;
controlBar_ = mediaPlayer_.controlBar;
mediaPlayer_.subtitleControl = this;
initDisplayArea();
controlBar_.addEventListener("subtitleControlEvent", com.google.utils.DelegateEx.create(this, onSubtitleControlEvent));
mx.events.EventDispatcher.initialize(this);
}
function initSubtitle(docid, url, mode) {
docid_ = docid;
url_ = url;
subtitleEnabled = false;
localSettings_ = SharedObject.getLocal("subtitleSettings");
if (mode == null) {
if ((localSettings_.data.subtitleOn == undefined) || (localSettings_.data.subtitleOn == null)) {
mode = MODE_ON;
} else if (localSettings_.data.subtitleOn) {
mode = MODE_ON;
} else {
mode = MODE_OFF;
}
}
mode_ = mode;
if ((url == null) || (url == "")) {
} else {
loadListFromUrl(url + REQUEST_TRACK_LIST);
}
}
function initDisplayArea() {
var _local2 = 0;
var _local3 = DEFAULT_HEIGHT - DISPLAY_AREA_HEIGHT;
var _local4 = DEFAULT_WIDTH;
var _local5 = DISPLAY_AREA_HEIGHT;
shadowedText_ = new com.google.ui.common.ShadowedText(mediaPlayer_, _local2, _local3, _local4, _local5, mediaPlayer_.subtitleLayerDepth);
}
function pause() {
if (subtitleEnabled && (!paused)) {
paused_ = true;
controlBar_.subtitleButtonEnabled = false;
}
}
function resume() {
if (paused) {
paused_ = false;
controlBar_.subtitleButtonEnabled = true;
}
}
function get paused() {
return(paused_);
}
function get docid() {
return(docid_);
}
function get url() {
return(url_);
}
function get subtitleEnabled() {
return(controlBar_.subtitleButtonEnabled);
}
function set subtitleEnabled(value) {
if (!value) {
subtitleOn = false;
}
controlBar_.subtitleButtonEnabled = value;
resize();
if (mediaPlayer_.playerMode == com.google.ui.media.MediaPlayer.PLAYER_MODE_NORMAL) {
var _local3 = {target:this, type:"subtitleUpdate", subtitleEnabled:subtitleEnabled, subtitleOn:subtitleOn};
dispatchEvent(_local3);
}
//return(subtitleEnabled);
}
function get subtitleOn() {
return(subtitleEnabled && (controlBar_.subtitleButtonOn));
}
function set subtitleOn(value) {
if (!subtitleEnabled) {
return;
}
controlBar_.subtitleButtonOn = value;
shadowedText_.visible = value;
resize();
if (mediaPlayer_.playerMode == com.google.ui.media.MediaPlayer.PLAYER_MODE_NORMAL) {
var _local3 = {target:this, type:"subtitleUpdate", subtitleEnabled:subtitleEnabled, subtitleOn:subtitleOn};
dispatchEvent(_local3);
}
enableTimer(value);
if (mediaPlayer_.hasBeenPlayed) {
localSettings_.data.subtitleOn = value;
}
if (value && (currTrackIndex_ < 0)) {
loadAndSwitchToIndex(0);
}
//return(subtitleOn);
}
function switchSubtitleOnOff() {
subtitleOn = !controlBar_.subtitleButtonOn;
}
function toggleBackground() {
shadowedText_.toggleBackground();
updateTrackMenu();
}
function resize() {
if (!subtitleEnabled) {
return(undefined);
}
var _local2 = mediaPlayer_.width;
var _local3 = mediaPlayer_.height - mediaPlayer_.controlBar.height;
updateTrackMenu();
var _local4 = (100 * _local2) / DEFAULT_WIDTH;
var _local5 = (100 * _local3) / DEFAULT_HEIGHT;
if (_local5 > _local4) {
_local5 = _local4;
}
var _local6 = _local2;
var _local7 = (_local5 / 100) * DISPLAY_AREA_HEIGHT;
var _local8 = mediaPlayer_.videoDisplay;
var _local9 = _local8._height;
var _local10 = (_local3 - _local9) * 0.5;
if (!subtitleOn) {
overlayOnVideo_ = false;
var _local11 = _local10;
var _local12 = _local11 + _local9;
} else if (_local10 > _local7) {
overlayOnVideo_ = false;
var _local11 = _local10;
var _local12 = _local11 + _local9;
} else if ((_local10 * 2) > _local7) {
overlayOnVideo_ = false;
var _local11 = (_local10 * 2) - _local7;
var _local12 = _local11 + _local9;
} else {
overlayOnVideo_ = true;
var _local11 = _local10;
var _local12 = _local3 - _local7;
}
_local8._y = _local11;
var _local13 = _local12;
shadowedText_.repositionAndScale(0, _local13, _local4, _local5);
shadowedText_.valignment = (overlayOnVideo_ ? (com.google.ui.common.ShadowedText.VALIGN_BOTTOM) : (com.google.ui.common.ShadowedText.VALIGN_TOP));
}
function onSubtitleControlEvent(evtObj) {
switch (evtObj.command) {
case "subtitleSwitch" :
switchSubtitleOnOff();
break;
case "subtitlePick" :
toggleTrackMenu();
}
}
function initializeTrackMenu() {
if (trackMenu_ != null) {
delete trackMenu_;
}
trackMenu_ = new com.google.ui.common.popupmenu.PopupMenu(mediaPlayer_, mediaPlayer_.subtitleTrackMenuDepth);
var _local3 = 0;
for ( ; _local3 < trackList_.length ; _local3++) {
var _local2 = trackList_[_local3];
trackMenu_.addItem(_local2.id, _local2.getDisplayString());
}
trackMenu_.addSeparator();
trackMenu_.addItem(MENU_ITEM_SHOW_CAPTIONS, controlBar_.subtitleMenuStringShowCaptions);
trackMenu_.addItem(MENU_ITEM_SHOW_BKGROUND, controlBar_.subtitleMenuStringShowBkground);
currTrackIndex_ = -1;
updateTrackMenu();
trackMenu_.addEventListener("select", com.google.utils.DelegateEx.create(this, onTrackMenuItem));
controlBar_.initSubtitleListButtonTooltip();
controlBar_.subtitleListButtonEnabled = trackList_.length > 1;
}
function toggleTrackMenu() {
if (trackMenu_ == null) {
return(undefined);
}
controlBar_.hideSubtitleListButtonTooltip();
if (trackMenu_.active()) {
trackMenu_.hide();
} else {
trackMenu_.show(10000);
}
}
function onTrackMenuItem(evtObj) {
if (evtObj.item == MENU_ITEM_SHOW_CAPTIONS) {
switchSubtitleOnOff();
} else if (evtObj.item == MENU_ITEM_SHOW_BKGROUND) {
toggleBackground();
} else {
currTrackIndex_ = idHashList_[evtObj.item];
loadAndSwitchToIndex(currTrackIndex_);
}
}
function updateTrackMenu() {
if (trackMenu_ == null) {
return(undefined);
}
var _local2 = 0;
for ( ; _local2 < trackList_.length ; _local2++) {
trackMenu_.checkItem(trackList_[_local2].id, ((currTrackIndex_ == _local2) ? (MENU_ICON_ITEM_PICKED) : null));
}
if (subtitleOn) {
trackMenu_.checkItem(MENU_ITEM_SHOW_CAPTIONS, MENU_ICON_ITEM_CHECKED);
trackMenu_.showItem(MENU_ITEM_SHOW_BKGROUND);
trackMenu_.checkItem(MENU_ITEM_SHOW_BKGROUND, (shadowedText_.backgroundOn ? (MENU_ICON_ITEM_CHECKED) : null));
} else {
trackMenu_.checkItem(MENU_ITEM_SHOW_CAPTIONS, null);
trackMenu_.hideItem(MENU_ITEM_SHOW_BKGROUND);
}
resizeTrackMenu();
}
function resizeTrackMenu() {
if (trackMenu_ == null) {
return(undefined);
}
trackMenu_.size();
var _local2 = trackMenu_.getWidth();
var _local3 = trackMenu_.getHeight();
var _local4 = controlBar_.subtitleListButtonRight - _local2;
var _local5 = controlBar_._y - _local3;
trackMenu_.moveTo(_local4, _local5);
}
function enableTimer(value) {
if (value) {
updateSubtitle(true);
updateTimer_ = _global.setInterval(this, "updateSubtitle", UPDATE_INTERVAL * 1000, false);
} else if (updateTimer_ != null) {
_global.clearInterval(updateTimer_);
updateTimer_ = null;
}
}
function updateSubtitle(forcedUpdate) {
if ((mediaPlayer_.videoDisplay._height <= 0) || (mediaPlayer_.videoDisplay._width <= 0)) {
return(undefined);
}
if (paused) {
setSubtitleText(null);
return(undefined);
}
var _local3 = mediaPlayer_.time;
if ((_local3 != undefined) && ((_local3 != currTime_) || (forcedUpdate))) {
currTime_ = _local3;
var _local4 = null;
var _local5 = trackList_[currTrackIndex_];
if ((_local5 != null) && (_local5.loaded)) {
_local4 = _local5.getCurrentFrame(_local3);
}
if ((_local4 != currFrame_) || (forcedUpdate)) {
setSubtitleText(_local4);
currFrame_ = _local4;
}
}
}
function setSubtitleText(frame) {
var _local3 = "";
if (frame != null) {
var _local4 = frame.content;
var _local5 = 0;
var _local6 = 0;
for ( ; _local6 < _local4.length ; _local6++) {
if ((_local4[_local6] != null) && (_local4[_local6].length > 0)) {
if (_local3 != "") {
_local3 = _local3 + newline;
}
_local3 = _local3 + _local4[_local6];
_local5++;
}
}
}
shadowedText_.text = _local3;
}
function loadListFromUrl(url) {
init(url);
fetch();
}
function parseRootNode(rootNode) {
loaded_ = false;
subtitleEnabled = false;
if ((rootNode == null) || (rootNode.nodeName != "transcript_list")) {
return(false);
}
if (trackList_ != null) {
delete trackList_;
}
trackList_ = new Array();
idHashList_ = new Array();
var _local11 = 0;
var _local10 = 0;
for ( ; _local10 < rootNode.childNodes.length ; _local10++) {
var _local4 = rootNode.childNodes[_local10];
for ( ; (_local4.nodeName == null) || (_local4.nodeName != "track") ; _local10++) {
}
var _local5 = com.google.utils.StringUtils.trim(_local4.attributes.name);
var _local6 = com.google.utils.StringUtils.trim(_local4.attributes.lang_code);
if ((_local5 != null) && (_local6 != null)) {
var _local7 = com.google.utils.StringUtils.trim(_local4.attributes.lang_original);
var _local8 = com.google.utils.StringUtils.trim(_local4.attributes.lang_translated);
var _local9 = com.google.utils.StringUtils.trim(_local4.attributes.lang_default) == "true";
var _local3 = new com.google.video.subtitle.SubtitleSet();
_local3.setNameAndLanguage(_local5, _local6, _local7, _local8, _local9);
idHashList_[_local3.id] = trackList_.push(_local3) - 1;
} else {
_local11++;
}
}
if (trackList_.length > 0) {
loaded_ = true;
initializeTrackMenu();
subtitleEnabled = true;
subtitleOn = mode_ == MODE_ON;
if (!subtitleOn) {
currTrackIndex_ = -1;
}
}
return(loaded_);
}
function loadAndSwitchToIndex(index) {
if (trackList_.length <= 0) {
return(undefined);
}
indexToSwitchTo_ = index;
var _local3 = trackList_[index];
if (_local3 != null) {
if (!_local3.loaded) {
var _local4 = (((url_ + REQUEST_TRANSCRIPT_NAME) + _global.escape(_local3.name)) + REQUEST_TRANSCRIPT_LANG) + _global.escape(_local3.langCode);
_local3.addEventListener("xmlParsed", com.google.utils.DelegateEx.create(this, onSubtitleSetLoad));
_local3.loadFromUrl(_local4);
} else {
switchToTrack(_local3);
}
}
}
function onSubtitleSetLoad(evtObj) {
var _local3 = evtObj.target;
if (evtObj.success && (_local3.loaded)) {
switchToTrack(_local3);
} else if (trackList_.length <= 0) {
subtitleEnabled = false;
}
}
function switchToTrack(track) {
if ((track != null) && (track.loaded)) {
var _local3 = idHashList_[track.id];
if ((_local3 != null) && (_local3 == indexToSwitchTo_)) {
currTrackIndex_ = _local3;
subtitleOn = true;
}
}
}
static var MENU_ITEM_SHOW_CAPTIONS = "ShowCaps";
static var MENU_ITEM_SHOW_BKGROUND = "ShowBG";
static var MENU_ICON_ITEM_CHECKED = "menu_check";
static var MENU_ICON_ITEM_PICKED = "menu_check";
static var REQUEST_TRACK_LIST = "&type=list";
static var REQUEST_TRANSCRIPT_NAME = "&type=track&name=";
static var REQUEST_TRANSCRIPT_LANG = "&lang=";
static var DEFAULT_WIDTH = 400;
static var DEFAULT_HEIGHT = 300;
static var DISPLAY_AREA_HEIGHT = 60;
static var MODE_OFF = 0;
static var MODE_ON = 1;
static var UPDATE_INTERVAL = 0.02;
static var TIME_WINDOW_PRE = 0.01;
static var TIME_WINDOW_POST = 0.01;
static var TIME_MIN_INTERVAL = 0.01;
static var TIME_MAX_INTERVAL = 3;
static var TEXT_MAX_CHAR_LENGTH = 48;
static var TEXT_MAX_NUM_OF_LINES = 3;
}
Symbol 20560 MovieClip [__Packages.com.google.youtube.event.GenericButtonEvent] Frame 0
class com.google.youtube.event.GenericButtonEvent extends com.google.youtube.event.UIEvent
{
function GenericButtonEvent () {
super();
}
static var FOCUS = "onFocus";
static var KILL_FOCUS = "onKillFocus";
static var ACTIVATE = "onActivate";
static var DEACTIVATE = "onDeactivate";
static var PRESS = "onPress";
static var RELEASE = "onRelease";
static var ROLL_OVER = "onRollOver";
static var ROLL_OUT = "onRollOut";
static var PLAY = "onPlay";
static var PAUSE = "onPause";
static var RECORD = "onRecord";
}
Symbol 20561 MovieClip [__Packages.com.google.video.ui.PlaylistUI] Frame 0
class com.google.video.ui.PlaylistUI extends MovieClip
{
var createEmptyMovieClip, getNextHighestDepth, setMask, tray_, playlistCard_, videolistCard_, visibleFader_, backButton_, attachMovie, channelButton_, playlistButton_, playlistButtonFader_, playlists_, dispatchEvent;
function PlaylistUI () {
super();
mx.events.EventDispatcher.initialize(this);
var _local3 = createEmptyMovieClip("playlistClipRegion", getNextHighestDepth());
_local3.beginFill(0, 100);
com.google.ui.common.Drawing.drawRectangle(_local3, 0, 0, 300, 230, 0);
_local3.endFill();
setMask(_local3);
var _local4 = createEmptyMovieClip("background_", getNextHighestDepth());
var _local5 = {a:0, b:300, c:0, d:-300, e:0, f:0, g:0, h:0, i:1};
_local4.beginGradientFill("linear", [2236962, 2236962, 0], [100, 100, 90], [0, 128, 255], _local5);
com.google.ui.common.Drawing.drawRectangle(_local4, 0, 0, 600, 250, 0);
_local4.endFill();
_local4.onPress = function () {
};
_local4.useHandCursor = false;
tray_ = createEmptyMovieClip("tray_", getNextHighestDepth());
tray_._x = 0;
tray_._y = 0;
playlistCard_ = com.google.video.ui.PlaylistCard(tray_.attachMovie(com.google.video.ui.PlaylistCard.linkageName, "playlistCard_clip", tray_.getNextHighestDepth()));
playlistCard_.addEventListener("playlistItemClicked", com.google.utils.DelegateEx.create(this, onPlaylistItemClicked));
videolistCard_ = com.google.video.ui.VideolistCard(tray_.attachMovie(com.google.video.ui.VideolistCard.linkageName, "videolistCard_clip", tray_.getNextHighestDepth()));
videolistCard_.addEventListener("videoItemClicked", com.google.utils.DelegateEx.create(this, onVideoItemClicked));
videolistCard_._x = 300;
var tray = tray_;
var _local6 = function () {
return(tray._x);
};
var _local7 = function (val) {
tray._x = val;
};
visibleFader_ = new com.google.ui.common.SmoothFader(_local6, _local7, 4);
backButton_ = com.google.video.ui.BackButton(attachMovie(com.google.video.ui.BackButton.linkageName, "backButton_", getNextHighestDepth()));
backButton_._x = -1;
backButton_._y = -1;
backButton_.addEventListener("clicked", com.google.utils.DelegateEx.create(this, onChannelClicked));
channelButton_ = com.google.video.ui.TextButton(attachMovie(com.google.video.ui.TextButton.linkageName, "channelButton_", getNextHighestDepth()));
channelButton_.text = "Playlists";
channelButton_.addEventListener("clicked", com.google.utils.DelegateEx.create(this, onChannelClicked));
channelButton_._y = -1;
channelButton_._x = -1 + 22;
channelButton_.highlight = true;
var _local8 = createEmptyMovieClip("playlistButtonContainer_", getNextHighestDepth());
var _local9 = _local8.createEmptyMovieClip("playlistButtonClipRegion", _local8.getNextHighestDepth());
_local9.beginFill(0, 100);
com.google.ui.common.Drawing.drawRectangle(_local9, 0, 0, 300, 230, 0);
_local9.endFill();
_local8.setMask(_local9);
playlistButton_ = com.google.video.ui.TextButton(_local8.attachMovie(com.google.video.ui.TextButton.linkageName, "playlistButton_", _local8.getNextHighestDepth()));
playlistButton_.text = "Videos";
playlistButton_.addEventListener("clicked", com.google.utils.DelegateEx.create(this, onPlaylistButtonClicked));
_local8._y = -1;
_local8._x = channelButton_._x + channelButton_.width;
playlistButton_._x = -72;
var playlistButton = playlistButton_;
var _local10 = function () {
return(playlistButton._x);
};
var _local11 = function (val) {
playlistButton._x = val;
};
playlistButtonFader_ = new com.google.ui.common.SmoothFader(_local10, _local11, 4);
}
function onPlaylistItemClicked(evtObj) {
visibleFader_.target = -300;
videolistCard_.setPlaylist(evtObj.playlistName);
playlistButton_.highlight = true;
channelButton_.highlight = false;
backButton_.highlight = true;
playlistButtonFader_.target = 0;
}
function onChannelClicked(evtObj) {
if (visibleFader_.target != 0) {
visibleFader_.target = 0;
playlistButton_.highlight = false;
channelButton_.highlight = true;
backButton_.highlight = false;
playlistButtonFader_.target = -72;
}
}
function onPlaylistButtonClicked(evtObj) {
if (visibleFader_.target != -300) {
visibleFader_.target = -300;
videolistCard_.setPlaylist(playlists_.curPlaylistName);
playlistButton_.highlight = true;
channelButton_.highlight = false;
backButton_.highlight = true;
playlistButtonFader_.target = 0;
}
}
function onVideoItemClicked(evtObj) {
dispatchEvent({type:"videoItemClicked", itemPos:evtObj.itemPos});
}
function loadFromPlaylists(playlists) {
playlists_ = playlists;
playlistCard_.loadFromPlaylists(playlists_);
videolistCard_.loadFromPlaylists(playlists_);
}
static var classPath = com.google.video.ui.PlaylistUI;
static var linkageName = "__Packages.com.google.video.ui.PlaylistUI";
static var forceLinkage = Object.registerClass(linkageName, classPath);
}
Symbol 20562 MovieClip [__Packages.com.google.ui.common.InputBox] Frame 0
class com.google.ui.common.InputBox extends com.google.ui.common.UIComponent
{
var useHandCursor, createEmptyMovieClip, getNextHighestDepth, __height, __width, backgroundClip_, createTextField, textFieldClip_, textFormat_;
function InputBox () {
super();
}
function init() {
mx.events.EventDispatcher.initialize(this);
super.init();
useHandCursor = false;
}
function createChildren() {
if (backgroundColor_ != undefined) {
createEmptyMovieClip("backgroundClip_", getNextHighestDepth(), {_width:__width, _height:__height, _x:0, _y:0});
backgroundClip_._alpha = alpha_;
}
createTextField(TEXT_FIELD_NAME, getNextHighestDepth(), 0, 0, __width, __height);
textFieldClip_ = this[TEXT_FIELD_NAME];
textFormat_ = new TextFormat();
textFormat_.size = fontSize_;
textFormat_.font = fontName_;
textFormat_.color = fontColor_;
textFormat_.align = alignment_;
textFieldClip_.type = (readOnly_ ? "dynamic" : "input");
textFieldClip_.multiline = multiLine_;
if (tabIndex_ != undefined) {
textFieldClip_.tabEnabled = true;
textFieldClip_.tabIndex = tabIndex_;
}
textFieldClip_.setNewTextFormat(textFormat_);
textFieldClip_._visible = true;
textFieldClip_.text = message_;
size();
}
function size() {
textFieldClip_._width = __width;
textFieldClip_._height = __height;
if ((__width == 0) && (__height == 0)) {
return(undefined);
}
if (backgroundClip_ != undefined) {
backgroundClip_.clear();
backgroundClip_.beginFill(backgroundColor_, alpha_);
com.google.ui.common.Drawing.drawRectangle(backgroundClip_, 0, 0, __width, __height, 0);
backgroundClip_.endFill();
}
}
function setFocus() {
Selection.setFocus(textFieldClip_);
}
function set text(val) {
message_ = val;
textFieldClip_.text = val;
size();
//return(text);
}
function get text() {
if (textFieldClip_.text != undefined) {
return(textFieldClip_.text);
}
return(message_);
}
function set alignment(val) {
alignment_ = val;
size();
//return(alignment);
}
function get alignment() {
return(alignment_);
}
function set FontName(val) {
fontName_ = val;
size();
//return(FontName);
}
function get FontName() {
return(fontName_);
}
function set alpha(val) {
alpha_ = val;
backgroundClip_._alpha = val;
//return(alpha);
}
function get alpha() {
return(alpha_);
}
function set fontSize(val) {
fontSize_ = val;
size();
//return(fontSize);
}
function get fontSize() {
return(fontSize_);
}
function set tabIndex(val) {
tabIndex_ = val;
//return(tabIndex);
}
function get tabIndex() {
return(tabIndex_);
}
function set multiline(val) {
multiLine_ = val;
size();
//return(multiline);
}
function get multiline() {
return(multiLine_);
}
function set fontColor(val) {
fontColor_ = val;
textFormat_.color = fontColor_;
textFieldClip_.setNewTextFormat(textFormat_);
size();
//return(fontColor);
}
function get fontColor() {
return(fontColor_);
}
function set readOnly(val) {
readOnly_ = val;
size();
//return(readOnly);
}
function get readOnly() {
return(readOnly_);
}
function set backgroundColor(val) {
backgroundColor_ = val;
size();
//return(backgroundColor);
}
function get backgroundColor() {
return(backgroundColor_);
}
function get textField() {
return(textFieldClip_);
}
static var classPath = com.google.ui.common.InputBox;
static var linkageID = "__Packages.com.google.ui.common.InputBox";
static var forceLinkage = Object.registerClass(linkageID, classPath);
static var HORIZONTAL_MARGIN = 10;
static var VERTICAL_MARGIN = 30;
static var MINIMUM_FONT_SIZE = 4;
static var TEXT_FIELD_NAME = "InputBoxTextField";
var message_ = "";
var alignment_ = "left";
var alpha_ = 100;
var readOnly_ = true;
var fontSize_ = 24;
var tabIndex_ = 24;
var fontColor_ = 16777215;
var fontName_ = "Arial";
var multiLine_ = false;
var backgroundColor_ = 0;
}
Symbol 20563 MovieClip [__Packages.com.google.video.ui.Scrubber] Frame 0
class com.google.video.ui.Scrubber extends MovieClip
{
var width_, height_, position_, dragging_, thumb_, attachMovie, getNextHighestDepth, thumbFader_, onMouseMove, dispatchEvent, _xmouse, clear, lineStyle, beginFill, endFill, __get__position, __get__width;
function Scrubber () {
super();
mx.events.EventDispatcher.initialize(this);
width_ = 80;
height_ = 20;
position_ = 0;
dragging_ = false;
thumb_ = attachMovie(com.google.video.ui.Thumb.linkageName, "thumb_", getNextHighestDepth());
var thumb = thumb_;
var _local3 = function () {
return(thumb._x);
};
var _local4 = function (val) {
thumb._x = val;
};
thumbFader_ = new com.google.ui.common.SmoothFader(_local3, _local4, 1);
redraw();
}
function onPress() {
onMouseMove = onThumbDrag;
dragging_ = true;
dispatchEvent({type:"beginScrub", value:thumb_._x / width_, target:this});
onThumbDrag();
}
function onRelease() {
delete onMouseMove;
dragging_ = false;
dispatchEvent({type:"endScrub", value:thumb_._x / width_, target:this});
resetThumb();
}
function onReleaseOutside() {
onRelease();
}
function onThumbDrag() {
var _local2 = _xmouse;
if (_local2 < 0) {
_local2 = 0;
} else if (_local2 >= width_) {
_local2 = width_;
}
thumb_._x = _local2;
thumbFader_.target = _local2;
dispatchEvent({type:"scrub", value:thumb_._x / width_, target:this});
}
function redraw() {
clear();
lineStyle(1, 16777215, 100);
beginFill(3355443, 60);
com.google.ui.common.Drawing.drawRectangle(this, -4.5, 8.5, width_ + 8, height_ - 15, 2);
endFill();
}
function resetThumb() {
if (!dragging_) {
thumbFader_.target = Math.floor(position_ * width_);
}
}
function set position(val) {
position_ = val;
resetThumb();
//return(__get__position());
}
function set width(val) {
width_ = val;
redraw();
resetThumb();
//return(__get__width());
}
static var classPath = com.google.video.ui.Scrubber;
static var linkageName = "__Packages.com.google.video.ui.Scrubber";
static var forceLinkage = Object.registerClass(linkageName, classPath);
}
Symbol 20564 MovieClip [__Packages.com.google.youtube.AbstractBroadcaster] Frame 0
class com.google.youtube.AbstractBroadcaster implements com.google.youtube.IBroadcaster
{
function AbstractBroadcaster () {
com.google.chianti.event.EventBroadcaster.initialize(this);
}
function broadcast(evt) {
}
function disableBroadcast() {
}
function enableBroadcast() {
}
function registerEvent(type, obj) {
}
function registerEvents() {
}
function unregisterEvent(type, obj) {
}
function unregisterEvents() {
}
function unregisterAll() {
}
}
Symbol 20565 MovieClip [__Packages.com.google.youtube.util.MouseActivity] Frame 0
class com.google.youtube.util.MouseActivity extends com.google.youtube.AbstractBroadcaster
{
var lastXMouse, lastYMouse, broadcast, mouseState;
function MouseActivity (opt_monitorMouseButtonActivity) {
super();
motionInterval = _global.setInterval(this, "onCheckMotion", 20);
if (opt_monitorMouseButtonActivity) {
var _local4 = {onMouseDown:com.google.chianti.event.EventDelegate.create(this, onLeftMouseDown), onMouseUp:com.google.chianti.event.EventDelegate.create(this, onLeftMouseUp)};
Mouse.addListener(_local4);
}
}
function onCheckMotion() {
if ((_root._xmouse != lastXMouse) || (_root._ymouse != lastYMouse)) {
lastXMouse = _root._xmouse;
lastYMouse = _root._ymouse;
onMouseMove();
}
}
function setTimeout(milliseconds) {
timeout = milliseconds;
start();
}
function touch() {
onMouseMove();
}
function onMouseMove() {
broadcast({type:MOUSE_ACTIVE, target:this});
mouseState = MOUSE_ACTIVE;
start();
}
function onLeftMouseDown() {
blockInactiveBroadcast = true;
}
function onLeftMouseUp() {
blockInactiveBroadcast = false;
touch();
}
function clear() {
_global.clearInterval(timeoutInterval);
timeoutInterval = 0;
}
function start() {
clear();
timeoutInterval = _global.setInterval(this, "onInterval", timeout);
}
function onInterval() {
if ((!blockInactiveBroadcast) && (mouseState != MOUSE_INACTIVE)) {
clear();
mouseState = MOUSE_INACTIVE;
broadcast({type:MOUSE_INACTIVE, target:this});
}
}
static var MOUSE_ACTIVE = "active";
static var MOUSE_INACTIVE = "inactive";
var timeout = 2000;
var timeoutInterval = 0;
var motionInterval = 0;
var blockInactiveBroadcast = false;
}
Symbol 20566 MovieClip [__Packages.com.google.video.ui.MetadataBalloon] Frame 0
class com.google.video.ui.MetadataBalloon extends MovieClip
{
var titleArea_, attachMovie, getNextHighestDepth, providerArea_, playlistPos_, duration_, clear, lineStyle, beginFill, endFill;
function MetadataBalloon () {
super();
titleArea_ = com.google.ui.common.StylishText(attachMovie(com.google.ui.common.StylishText.linkageName, "titleArea_", getNextHighestDepth(), {color:16113331, size:12, style:com.google.ui.common.StylishText.BORDER}));
providerArea_ = com.google.ui.common.StylishText(attachMovie(com.google.ui.common.StylishText.linkageName, "providerArea_", getNextHighestDepth(), {color:16777215, size:10, style:com.google.ui.common.StylishText.NONE}));
playlistPos_ = com.google.ui.common.StylishText(attachMovie(com.google.ui.common.StylishText.linkageName, "playlistPos_", getNextHighestDepth(), {color:16777215, size:10, style:com.google.ui.common.StylishText.NONE}));
duration_ = com.google.ui.common.StylishText(attachMovie(com.google.ui.common.StylishText.linkageName, "duration_", getNextHighestDepth(), {color:16777215, size:10, style:com.google.ui.common.StylishText.NONE}));
titleArea_.maxWidth = 220;
}
function redraw() {
clear();
titleArea_._y = 2;
providerArea_._y = (titleArea_._y + titleArea_.height) + 2;
if (providerArea_._visible == false) {
playlistPos_._y = (titleArea_._y + titleArea_.height) + 2;
} else {
playlistPos_._y = (providerArea_._y + providerArea_.height) + 2;
}
duration_._y = playlistPos_._y;
titleArea_._x = 4;
providerArea_._x = 4;
playlistPos_._x = 4;
var _local2 = titleArea_.width;
if (providerArea_.width > _local2) {
_local2 = providerArea_.width;
}
if (_local2 < 147) {
_local2 = 147;
}
duration_._x = (_local2 - duration_.width) + 8;
lineStyle(1, 13421772, 40);
beginFill(0, 80);
com.google.ui.common.Drawing.drawRectangle(this, 0, 0, _local2 + 16, (playlistPos_._y + playlistPos_.height) + 8, 8);
endFill();
}
function updateMetadata(playlists) {
var _local3 = playlists.curItem;
var _local5 = 0;
var _local6 = _local3.mediagroup;
var _local7 = 0;
for ( ; _local7 < _local6.length ; _local7++) {
if ((_local6[_local7].name == "media:content") && ((_local6[_local7].type == "video/x-flv") && (_local6[_local7].duration != undefined))) {
_local5 = _local6[_local7].duration;
}
if (_local6[_local7].name == "media:thumbnail") {
var _local4 = _local6[_local7].url;
}
}
titleArea_.text = _local3.title;
providerArea_.maxWidth = titleArea_.width;
if (_local3.description != undefined) {
providerArea_.text = _local3.description;
providerArea_._visible = true;
} else if (_local3.author != undefined) {
providerArea_.text = _local3.author;
providerArea_._visible = true;
} else {
providerArea_._visible = false;
}
providerArea_._visible = false;
playlistPos_.text = (("Video " + (playlists.curIndex + 1)) + " of ") + playlists.allItems.length;
if (_local5 > 0) {
duration_.text = com.google.utils.StringUtils.FormatTime(_local5);
} else {
duration_.text = " ";
}
redraw();
}
static var classPath = com.google.video.ui.MetadataBalloon;
static var linkageName = "__Packages.com.google.video.ui.MetadataBalloon";
static var forceLinkage = Object.registerClass(linkageName, classPath);
}
Symbol 20567 MovieClip [__Packages.com.google.media.AudioSource] Frame 0
class com.google.media.AudioSource implements com.google.media.IStreamingMediaSource
{
var log_, output_, sound_, resumeTime_;
function AudioSource (target) {
log_ = new com.google.logs.Logger("AudSrc");
mx.events.EventDispatcher.initialize(this);
playState_ = com.google.media.VideoSource.ERROR;
output_ = target;
sound_ = new Sound(output_);
sound_.onSoundComplete = com.google.utils.DelegateEx.create(this, onSoundComplete);
sound_.onID3 = com.google.utils.DelegateEx.create(this, onID3);
resumeTime_ = 0;
}
function dispatchEvent() {
}
function addEventListener() {
}
function removeEventListener() {
}
function onSoundComplete() {
log_.log(7, "Sound complete.");
onPlayStateChange(com.google.media.VideoSource.PAUSED, false);
}
function onID3() {
log_.log(7, "ID3 available");
for (var attr in sound_.id3) {
log_.log(8, (("id3." + attr) + " = ") + sound_.id3[attr]);
}
}
function onStatus(infoObject) {
log_.log(7, ((("Status (" + infoObject.target.url) + " @ ") + infoObject.target.startTime) + ")");
log_.log(7, "Level: " + infoObject.level);
log_.log(7, "Code: " + infoObject.code);
if (infoObject.level == "error") {
log_.error(infoObject.code);
dispatchEvent({type:"error", target:this});
onPlayStateChange(com.google.media.VideoSource.ERROR, false);
}
infoObject.target = this;
dispatchEvent(infoObject);
if (infoObject.level == "status") {
if (infoObject.code == "NetStream.Play.Start") {
onPlayStateChange(com.google.media.VideoSource.PLAYING, false);
} else if (infoObject.code == "NetStream.Play.Stop") {
onPlayStateChange(com.google.media.VideoSource.PAUSED, false);
} else if (infoObject.code == "NetStream.Buffer.Empty") {
if (Math.ceil(getDuration()) != Math.ceil(getTime())) {
bufferEmptyEvents++;
}
dispatchEvent({type:"bufferEmptied", target:this});
}
}
}
function onMetaData(infoObject) {
log_.log(5, ((("VideoSource::onMetaData (" + infoObject.target.url) + " @ ") + infoObject.target.startTime) + ")");
log_.log(5, ("duration: " + infoObject.duration) + " secs");
log_.log(5, ("videodatarate: " + infoObject.videodatarate) + " Kbps");
log_.log(5, ("audiodatarate: " + infoObject.audiodatarate) + " Kbps");
log_.log(5, "creationdate: " + infoObject.creationdate);
log_.log(5, "xtradata: " + infoObject.xtradata);
infoObject.target = this;
dispatchEvent(infoObject);
}
function getBufferedRegion() {
var _local2 = sound_.getBytesLoaded() / sound_.getBytesTotal();
if (_global.isNaN(_local2)) {
_local2 = 0;
}
return({first:0, second:_local2});
}
function getPlayProgress() {
return(sound_.position / 1000);
}
function onPlayStateChange(newState, requested) {
if (playState_ != newState) {
log_.log(6, ((((("Play State change from " + playState_) + " to ") + newState) + "(req=") + requested) + ")");
playState_ = newState;
var _local4 = new Object();
_local4.type = "playStateChange";
_local4.target = this;
_local4.value = playState_;
_local4.requested = requested;
dispatchEvent(_local4);
}
}
function load(src, netStream) {
if (netStream) {
log_.log(1, "load: netstream specified: " + netStream);
return(undefined);
}
log_.log(6, "Loading " + src);
sound_.loadSound(src, true);
onPlayStateChange(com.google.media.VideoSource.PAUSED, true);
dispatchEvent({type:"loadProgressChange"});
}
function loadRange(srcUrl, startTime, endTime) {
load(srcUrl);
}
function pause() {
log_.log(6, "Pausing audio playback");
if (getPlayState() == com.google.media.VideoSource.PLAYING) {
resumeTime_ = sound_.position / 1000;
sound_.stop();
}
onPlayStateChange(com.google.media.VideoSource.PAUSED, true);
}
function resume() {
sound_.start(resumeTime_);
onPlayStateChange(com.google.media.VideoSource.PLAYING, true);
}
function destroy() {
log_.log(5, "Destroying audio source ");
delete sound_;
}
function seek(time, allowNewUrl) {
log_.log(6, "Seeking to time " + time);
switch (getPlayState()) {
case com.google.media.VideoSource.PLAYING :
sound_.start(time);
break;
case com.google.media.VideoSource.PAUSED :
resumeTime_ = time;
break;
case com.google.media.VideoSource.ERROR :
}
return(undefined);
}
function getPlayState() {
return(playState_);
}
function getTime() {
if (getPlayState() == com.google.media.VideoSource.PLAYING) {
return(sound_.position / 1000);
}
return(resumeTime_);
}
function getDuration() {
if ((sound_.duration == undefined) || (sound_.getBytesLoaded() == 0)) {
return(0);
}
var _local2 = sound_.getBytesLoaded() / sound_.getBytesTotal();
var _local3 = sound_.duration;
var _local4 = (_local3 / 1000) / _local2;
log_.log(9, ((((_local2 * 100) + "% = ") + (_local3 / 1000)) + "s => ") + _local4);
return(_local4);
}
function getCurrentUrl() {
return("HellIfIKnow.mp3");
}
function getBytesLoaded() {
return(sound_.getBytesLoaded());
}
function getSegmentLength() {
return(sound_.getBytesTotal());
}
function getBufferEmptyEvents() {
return(bufferEmptyEvents);
}
function getRemainingDownloadTime(maxContentTime) {
return(0);
}
function onInterval() {
}
function attachTo(target) {
}
function detach() {
}
var playState_ = com.google.media.VideoSource.ERROR;
var bufferEmptyEvents = 0;
}
Symbol 20568 MovieClip [__Packages.com.google.youtube.ui.SliderControl] Frame 0
class com.google.youtube.ui.SliderControl extends com.google.youtube.ui.CompoundButton
{
var minValue, maxValue, hitArea, handle, currentValue, broadcast, onEnterFrame, unhover, rollOver, rollOut, _ymouse, createEmptyMovieClip, includeMouseActivityOf, bg, getNextHighestDepth;
function SliderControl () {
super();
}
function setValues(min, max) {
minValue = min;
maxValue = max;
}
function setSize(newSize) {
height = newSize;
build();
enable();
hitArea.tabEnabled = false;
handle.tabEnabled = false;
}
function getValue() {
updateValue();
return(currentValue);
}
function setValue(newValue, opt_instantly) {
if (opt_instantly) {
handle._y = getOffsetForValue(newValue);
} else {
slideTo(newValue);
}
}
function updateValue() {
var _local2 = currentValue;
var _local3 = (height - handle._y) / height;
currentValue = Math.round((_local3 * (maxValue - minValue)) + minValue);
if (currentValue < (minValue + MIN_VALUE_SNAP)) {
currentValue = minValue;
}
if (_local2 != currentValue) {
broadcast({type:com.google.youtube.event.UIEvent.CHANGE, data:currentValue, target:this});
}
}
function onHandlePress() {
handle.startDrag(false, 0, 0, handle._x, height);
onEnterFrame = com.google.chianti.event.EventDelegate.create(this, updateValue);
}
function onHandleRelease() {
handle.stopDrag();
updateValue();
delete onEnterFrame;
broadcast({type:com.google.youtube.event.GenericButtonEvent.RELEASE, data:currentValue, target:this});
}
function onHandleReleaseOutside() {
onHandleRelease();
unhover();
}
function enable() {
handle.onRollOver = com.google.chianti.event.EventDelegate.create(this, rollOver);
handle.onRollOut = com.google.chianti.event.EventDelegate.create(this, rollOut);
handle.onPress = com.google.chianti.event.EventDelegate.create(this, onHandlePress);
handle.onRelease = com.google.chianti.event.EventDelegate.create(this, onHandleRelease);
handle.onReleaseOutside = com.google.chianti.event.EventDelegate.create(this, onHandleReleaseOutside);
}
function disable() {
handle.onRollOver = null;
handle.onRollOut = null;
handle.onPress = null;
handle.onRelease = null;
handle.onReleaseOutside = null;
}
function onBgRelease() {
var _local2 = (height - _ymouse) / height;
slideTo(Math.round(_local2 * (maxValue - minValue)) + minValue);
}
function slideTo(newValue) {
newValue = Math.min(maxValue, Math.max(minValue, newValue));
if (newValue == currentValue) {
return(undefined);
}
onEnterFrame = com.google.chianti.event.EventDelegate.create(this, updateValue);
var _local3 = {onComplete:com.google.chianti.event.EventDelegate.create(this, onHandleRelease)};
_local3._y = getOffsetForValue(newValue);
com.gs.TweenLite.to(handle, 0.2, _local3);
}
function getOffsetForValue(value) {
var _local3 = maxValue - minValue;
return(Math.round((1 - ((value - minValue) / _local3)) * height));
}
function getHandle() {
return(handle);
}
function build() {
super.build();
hitArea = createEmptyMovieClip("hitArea", 1);
includeMouseActivityOf(hitArea);
bg = createEmptyMovieClip("bg", 2);
var _local9 = (90 / 180) * Math.PI;
var _local10 = 0;
var _local3 = Math.ceil((HANDLE_HEIGHT / 2) - (5 / 2)) + 1;
var _local4 = 0;
var _local12 = HANDLE_HEIGHT;
var _local11 = HANDLE_WIDTH;
var _local14 = INNER_HANDLE_HEIGHT;
var _local13 = INNER_HANDLE_WIDTH;
var _local7 = _local12;
var _local8 = height;
var _local5 = (_local3 - (_local7 / 2)) + (5 / 2);
var _local6 = _local4;
var _local15 = {colors:[8421504, 11579568], fillType:"linear", alphas:[100, 100], ratios:[0, 255], matrix:{matrixType:"box", x:_local3, y:_local4, w:5, h:height, r:_local10}};
com.google.youtube.util.Drawing.drawRect(bg, _local3, _local4, 5, height, _local15);
com.google.youtube.util.Drawing.drawRect(hitArea, _local5, _local6, _local7, _local8, 16711680);
hitArea.onRelease = com.google.chianti.event.EventDelegate.create(this, onBgRelease);
hitArea._alpha = 0;
handle = createEmptyMovieClip("handle", getNextHighestDepth());
var _local16 = {colors:[16777215, 9737364], fillType:"linear", alphas:[100, 100], ratios:[0, 255], matrix:{matrixType:"box", x:0.5, y:0.5, w:_local12, h:_local11, r:_local9}};
var _local17 = {thickness:0, alpha:50, rgb:0};
var _local18 = {colors:[10921638, 3750201], fillType:"linear", alphas:[100, 100], ratios:[0, 205], matrix:{matrixType:"box", x:3.5, y:3.5, w:_local14, h:_local13, r:_local9}};
com.google.youtube.util.Drawing.drawRect(handle, 0.5, 0.5, _local12, _local11, _local16, _local17, [3, 3, 3, 3]);
com.google.youtube.util.Drawing.drawRect(handle, 3.5, 3.5, _local14, _local13, _local18, null, [2, 2, 2, 2]);
height = height - HANDLE_WIDTH;
}
static var LINK_NAME = "__Packages.com.google.youtube.ui.SliderControl";
static var FORCE_LINK = Object.registerClass(LINK_NAME, com.google.youtube.ui.SliderControl);
static var HANDLE_WIDTH = 9;
static var HANDLE_HEIGHT = 17;
static var INNER_HANDLE_WIDTH = 3;
static var INNER_HANDLE_HEIGHT = 11;
static var MIN_VALUE_SNAP = 5;
var height = 5;
}
Symbol 20569 MovieClip [__Packages.com.google.ui.media.MediaPlayer] Frame 0
class com.google.ui.media.MediaPlayer extends com.google.ui.common.UIComponent
{
var onPlayStateChangeListener_, onMetaDataListener_, onAspectRatioChangeListener_, errorListener_, onStatusListener_, onNewSegmentListener_, updateTimer_, __width, __height, mediaCache_, letterBox_, createEmptyMovieClip, videoDisplay_, attachMovie, messageBox_, mediaSource_, clipStart_, clipEnd_, thumbnailClip_, shareLayer_, dispatchEvent, flashApiNotifyTransition_, flashApiNotifyError_, controlBar_, orgSizeMode_, popupMenu_, showFullScreenButton_, miniButton_, preBufferTimer_, bufferingText_, createTextField, callToActionBigIcon_, callToActionBg_, callToActionIcon_, callToActionLink_, googleAttribTimer_, getURL, googleAttrib_, getNextHighestDepth, googleAttribMask_, onMouseMove, _xmouse, _ymouse, userSettings_, __get__storeUserSettings, controlBarMarkers_, __get__subtitleControl, __get__disableLogoMenu;
function MediaPlayer () {
super();
onPlayStateChangeListener_ = com.google.utils.DelegateEx.create(this, onPlayStateChange);
onMetaDataListener_ = com.google.utils.DelegateEx.create(this, onMetaData);
onAspectRatioChangeListener_ = com.google.utils.DelegateEx.create(this, onAspectRatioChange);
errorListener_ = com.google.utils.DelegateEx.create(this, function (evtObj) {
this.dispatchEvent(evtObj);
});
onStatusListener_ = com.google.utils.DelegateEx.create(this, onSourceStatus);
onNewSegmentListener_ = com.google.utils.DelegateEx.create(this, function (evtObj) {
this.dispatchEvent(evtObj);
});
var _local3 = new Object();
_local3.onFullScreen = com.google.utils.DelegateEx.create(this, onFullScreenModeChg);
Stage.addListener(_local3);
}
function init() {
mx.events.EventDispatcher.initialize(this);
super.init();
updateTimer_ = _global.setInterval(this, "onUpdateTimer", 100);
__width = 100;
__height = 100;
mediaCache_ = new com.google.media.MediaCache();
}
function createChildren() {
letterBox_ = createEmptyMovieClip("letterBox_", DEPTH_LETTERBOX);
letterBox_.beginFill(0);
com.google.ui.common.Drawing.drawRectangle(letterBox_, 0, 0, 100, 100, 0);
letterBox_.endFill();
videoDisplay_ = attachMovie("VideoDisplay", "videoDisplay_", DEPTH_VIDEODISPLAY);
initializeNormal();
initializeMini();
createBufferingMessage();
createCallToActionBox();
changeToPlayerMode(playerMode_);
var _local2 = com.google.utils.DelegateEx.create(this, onLetterboxPress);
letterBox_.onPress = _local2;
messageBox_.onPress = _local2;
if (playerMode != PLAYER_MODE_MINI) {
letterBox_.useHandCursor = false;
messageBox_.useHandCursor = false;
}
applyUserSettings();
size();
}
function loadMedia(playWhenBuffered) {
transitionTo("loadMedia()", STATE_PAUSED);
if (mediaSource_ != undefined) {
mediaSource_.destroy();
delete mediaSource_;
}
if ((currentUrl_ == undefined) || (currentUrl_ == "")) {
return(undefined);
}
if (mediaCache_.contains(currentUrl_)) {
mediaSource_ = mediaCache_.get(currentUrl_);
addMediaSourceEventListeners();
restartOnPlay_ = false;
seek(resumeTime_);
resumeTime_ = 0;
} else {
switch (currentMediaType_) {
case MEDIA_VIDEO :
mediaSource_ = new com.google.media.VideoSource();
videoDisplay_._visible = true;
break;
case MEDIA_AUDIO :
mediaSource_ = new com.google.media.AudioSource();
videoDisplay_._visible = false;
}
addMediaSourceEventListeners();
mediaSource_.loadRange(currentUrl_, clipStart_, clipEnd_);
}
if (currentMediaType_ == MEDIA_VIDEO) {
mediaSource_.attachTo(videoDisplay_.vid);
}
if (playWhenBuffered) {
transitionTo("loadMedia()", STATE_BUFFERING);
}
return(mediaSource_);
}
function addMediaSourceEventListeners() {
mediaSource_.addEventListener("playStateChange", onPlayStateChangeListener_);
mediaSource_.addEventListener("onMetaData", onMetaDataListener_);
mediaSource_.addEventListener("onAspectRatioChange", onAspectRatioChangeListener_);
mediaSource_.addEventListener("error", errorListener_);
mediaSource_.addEventListener("onStatus", onStatusListener_);
mediaSource_.addEventListener("onNewSegment", onNewSegmentListener_);
}
function loadThumbnail(sourceUrl) {
if (thumbnailClip_ != null) {
thumbnailClip_.destroy();
delete thumbnailClip_;
}
thumbnailClip_ = createEmptyMovieClip("thumbnailClip_", DEPTH_THUMBNAIL);
thumbnailRequested_ = true;
thumbnailLoaded_ = false;
var _local3 = new Object();
_local3.onLoadInit = com.google.utils.DelegateEx.create(this, onThumbnailLoadInit);
var _local4 = new MovieClipLoader();
_local4.addListener(_local3);
var _local5 = _local4.loadClip(sourceUrl, thumbnailClip_);
}
function play() {
var _local2 = Math.random();
if (mediaSource_ == undefined) {
loadMedia(true);
}
transitionTo("play() " + _local2, STATE_PLAYING);
}
function pause() {
transitionTo("pause()", STATE_PAUSED);
}
function toggle() {
if (currentState_ == STATE_PLAYING) {
pause();
} else if (mediaSource_ == undefined) {
loadMedia(true);
} else {
play();
}
}
function volumeUp() {
onVolumeUp();
}
function volumeDown() {
onVolumeDown();
}
function toggleMute() {
onMute();
}
function seek(time) {
if (time > mediaSource_.getDuration()) {
mediaSource_.seek(mediaSource_.getDuration(), com.google.media.VideoSource.PROHIBIT_NEW_URL);
onPlaybackComplete();
return(undefined);
}
mediaSource_.seek(time, com.google.media.VideoSource.ALLOW_NEW_URL);
restartOnPlay_ = false;
if ((currentState_ == STATE_PLAYING) || (currentState_ == STATE_BUFFERING)) {
mediaSource_.pause();
transitionTo("seek()", STATE_BUFFERING);
}
}
function detachMediaSource() {
resumeTime_ = time;
mediaSource_.detach();
videoDisplay_.vid.clear();
var _local2 = mediaSource_;
delete mediaSource_;
onUpdateTimer();
return(_local2);
}
function stopDownload() {
resumeTime_ = time;
mediaSource_.destroy();
delete mediaSource_;
videoDisplay_.vid.clear();
onUpdateTimer();
}
function showMessage(message) {
messageBox_.message = message;
messageBox_._visible = true;
}
function hideMessage() {
messageBox_._visible = false;
}
function showShareLayer(docid, sendLinkEnabled, embedEnabled) {
if ((docid != undefined) && (docid != "")) {
shareLayer_.docid = docid;
shareLayer_.sendLinkEnabled = sendLinkEnabled;
shareLayer_.embedEnabled = embedEnabled;
shareLayer_.showShareLayer();
}
}
function hideShareLayer() {
shareLayer_.hideShareLayer();
}
function get shareLayerVisible() {
return(shareLayer_._visible);
}
function onShareClick(evtObj) {
dispatchEvent({type:"shareClick", target:this});
}
function onBlogClick(evtObj) {
dispatchEvent({type:"blogClick", target:this});
}
function onReplayClick(evtObj) {
dispatchEvent({type:"replayClick", target:this});
}
function notifyOnTransition(notifyTransitionFunc) {
flashApiNotifyTransition_ = notifyTransitionFunc;
}
function notifyOnError(notifyErrorFunc) {
flashApiNotifyError_ = notifyErrorFunc;
}
function get playPage() {
return(playPage_);
}
function set playPage(val) {
playPage_ = val;
//return(playPage);
}
function get url() {
return(currentUrl_);
}
function set url(val) {
currentUrl_ = val;
//return(url);
}
function get clipStart() {
return(clipStart_);
}
function set clipStart(val) {
clipStart_ = val;
//return(clipStart);
}
function get clipEnd() {
return(clipEnd_);
}
function set clipEnd(val) {
clipEnd_ = val;
//return(clipEnd);
}
function get mediaType() {
return(currentMediaType_);
}
function set mediaType(val) {
currentMediaType_ = val;
setControlBarFullscreen();
setControlBarMenu();
//return(mediaType);
}
function get playerMode() {
return(playerMode_);
}
function set playerMode(val) {
changeToPlayerMode(val);
//return(playerMode);
}
function get playerVariant() {
return(playerVariant_);
}
function set playerVariant(val) {
playerVariant_ = val;
//return(playerVariant);
}
function get controlBarLayout() {
return(controlBarLayout_);
}
function set controlBarLayout(val) {
controlBarLayout_ = val;
controlBar_.layout = controlBarLayout_;
size();
//return(controlBarLayout);
}
function get resumeTime() {
return(resumeTime_);
}
function set resumeTime(val) {
resumeTime_ = val;
//return(resumeTime);
}
function get segmentLength() {
return(mediaSource_.getSegmentLength());
}
function get currentState() {
return(currentState_);
}
function setControlBarLinkUrl(visible_url, redirect_url) {
controlBar_.setLinkDisplayProperties(visible_url, redirect_url);
size();
}
function setAbgText(abgText) {
controlBar_.setAbgText(abgText);
}
function setAbgLinkUrl(redirect_url) {
controlBar_.setAbgLinkUrl(redirect_url);
}
function setTimeDisplayVisible(val) {
controlBar_.setTimeDisplayVisible(val);
}
function get controlBarPosition() {
return(controlBarPosition_);
}
function set controlBarPosition(val) {
controlBarPosition_ = val;
size();
//return(controlBarPosition);
}
function get time() {
return(mediaSource_.getTime());
}
function get duration() {
return(mediaSource_.getDuration());
}
function get bufferTime() {
return(bufferTime_);
}
function set bufferTime(val) {
bufferTime_ = val;
//return(bufferTime);
}
function get bytesLoaded() {
return(mediaSource_.getBytesLoaded());
}
function getBufferEmptyEvents() {
return(mediaSource_.getBufferEmptyEvents());
}
function get smoothing() {
return(smoothing_);
}
function set smoothing(val) {
smoothing_ = val;
videoDisplay_.vid.smoothing = smoothing_;
updateUserSetting("smoothing", smoothing_);
updateMenu();
//return(smoothing);
}
function get playing() {
var _local2 = (currentState_ == STATE_PLAYING) || ((currentState_ == STATE_BUFFERING) || ((currentState_ == STATE_FASTFORWARD) || ((currentState_ == STATE_REWIND) || (currentState_ == STATE_SCRUBBING))));
return(_local2);
}
function isStatePlaying() {
return(currentState_ == STATE_PLAYING);
}
function get volume() {
return(controlBar_.volume);
}
function set volume(val) {
controlBar_.volume = val;
updateUserSetting("volume", controlBar_.volume);
//return(volume);
}
function get mute() {
return(controlBar_.muted);
}
function set mute(val) {
controlBar_.muted = val;
//return(mute);
}
function showEmailPane(mediastate, width, height) {
if (width < 320) {
shareLayer_.setLayoutConstraints({spaceBetweenButtons_:10, inputFieldHeight_:22, inputFieldWidth_:180, boundingBoxPadding_:8, numMesgLines_:1, spaceBetweenTextFields_:4, buttonBackerPadding_:3, mainButtonWidth_:80, sendButtonWidth_:80, buttonHeight_:29, labelWidth_:80});
shareLayer_.setSize(width, height);
}
shareLayer_.docid = mediastate.docid;
shareLayer_.videoPubHost = mediastate.videoPubHost;
shareLayer_.skipToEmailPane = true;
shareLayer_.showShareLayer();
}
function get restartOnPlay() {
return(restartOnPlay_);
}
function set restartOnPlay(val) {
restartOnPlay_ = val;
//return(restartOnPlay);
}
function get sizeMode() {
return(sizeMode_);
}
function set sizeMode(val) {
sizeMode_ = val;
onSizeModeChange();
//return(sizeMode);
}
function get orgSizeMode() {
return(orgSizeMode_);
}
function set orgSizeMode(val) {
orgSizeMode_ = val;
//return(orgSizeMode);
}
function get useHandCursor() {
return(letterBox_.useHandCursor && (messageBox_.useHandCursor));
}
function set useHandCursor(val) {
letterBox_.useHandCursor = val;
messageBox_.useHandCursor = val;
//return(useHandCursor);
}
function get hasBeenPlayed() {
return(hasBeenPlayed_);
}
function get hlval() {
return(hlval_);
}
function set hlval(val) {
hlval_ = val;
//return(hlval);
}
function installScrubber(scrubber) {
scrubber.addEventListener("beginScrub", com.google.utils.DelegateEx.create(this, onBeginScrub));
scrubber.addEventListener("scrub", com.google.utils.DelegateEx.create(this, onScrub));
scrubber.addEventListener("endScrub", com.google.utils.DelegateEx.create(this, onEndScrub));
}
function initializePopupMenuText(messages) {
if (playerMode_ == PLAYER_MODE_EMBEDDED) {
if (messages[MENU_ITEM_GO_TO_GVC] != null) {
popupMenu_.setItemText(MENU_ITEM_GO_TO_GVC, messages[MENU_ITEM_GO_TO_GVC]);
}
if (showFullScreenButton_) {
if (messages[MENU_ITEM_FULLSCREEN] != null) {
popupMenu_.setItemText(MENU_ITEM_FULLSCREEN, messages[MENU_ITEM_FULLSCREEN]);
}
}
} else {
if (messages[MENU_ITEM_SMOOTH] != null) {
popupMenu_.setItemText(MENU_ITEM_SMOOTH, messages[MENU_ITEM_SMOOTH]);
}
if (messages[MENU_ITEM_ORIGINAL_SIZE] != null) {
popupMenu_.setItemText(MENU_ITEM_ORIGINAL_SIZE, messages[MENU_ITEM_ORIGINAL_SIZE]);
}
if (messages[MENU_ITEM_DOUBLE_SIZE] != null) {
popupMenu_.setItemText(MENU_ITEM_DOUBLE_SIZE, messages[MENU_ITEM_DOUBLE_SIZE]);
}
if (messages[MENU_ITEM_FIT_WINDOW] != null) {
popupMenu_.setItemText(MENU_ITEM_FIT_WINDOW, messages[MENU_ITEM_FIT_WINDOW]);
}
if (messages[MENU_ITEM_FULLSCREEN] != null) {
popupMenu_.setItemText(MENU_ITEM_FULLSCREEN, messages[MENU_ITEM_FULLSCREEN]);
}
}
popupMenu_.size();
size();
}
function initializePopupMenu() {
delete popupMenu_;
popupMenu_ = new com.google.ui.common.popupmenu.PopupMenu(this, DEPTH_POPUPMENU);
if (playerMode_ == PLAYER_MODE_EMBEDDED) {
popupMenu_.addItem(MENU_ITEM_GO_TO_GVC, MENU_ITEM_GO_TO_GVC_TEXT);
if (showFullScreenButton_) {
popupMenu_.addSeparator();
popupMenu_.addItem(MENU_ITEM_FULLSCREEN, MENU_ITEM_FULLSCREEN_TEXT);
}
} else {
popupMenu_.addItem(MENU_ITEM_SMOOTH, MENU_ITEM_SMOOTH_TEXT);
popupMenu_.addSeparator();
popupMenu_.addItem(MENU_ITEM_ORIGINAL_SIZE, MENU_ITEM_ORIGINAL_SIZE_TEXT);
popupMenu_.addItem(MENU_ITEM_DOUBLE_SIZE, MENU_ITEM_DOUBLE_SIZE_TEXT);
popupMenu_.addItem(MENU_ITEM_FIT_WINDOW, MENU_ITEM_FIT_WINDOW_TEXT);
popupMenu_.addItem(MENU_ITEM_FULLSCREEN, MENU_ITEM_FULLSCREEN_TEXT);
}
popupMenu_.size();
updateMenu();
popupMenu_.addEventListener("select", com.google.utils.DelegateEx.create(this, onMenuItem));
}
function initializeMini() {
if (miniButton_ == undefined) {
miniButton_ = attachMovie(com.google.ui.common.IconButton.linkageName, "miniButton_", DEPTH_MINIBUTTON, {baseName:"minibtn", _visible:false});
miniButton_.setSize(22, 21);
miniButton_.icon = (controlBar_.playing ? "icon_pause" : "icon_play");
miniButton_.addEventListener("release", com.google.utils.DelegateEx.create(this, onPause));
}
}
function initializeNormal() {
if (controlBar_ == undefined) {
controlBar_ = attachMovie(com.google.ui.media.ControlBar.linkageName, "controlBar_", DEPTH_CONTROLBAR);
controlBar_.addEventListener("release", com.google.utils.DelegateEx.create(this, onControlBarButtonRelease));
controlBar_.addEventListener("beginScrub", com.google.utils.DelegateEx.create(this, onBeginScrub));
controlBar_.addEventListener("scrub", com.google.utils.DelegateEx.create(this, onScrub));
controlBar_.addEventListener("endScrub", com.google.utils.DelegateEx.create(this, onEndScrub));
controlBar_.addEventListener("volumeChange", com.google.utils.DelegateEx.create(this, onVolumeChange));
controlBar_.addEventListener("press", com.google.utils.DelegateEx.create(this, onControlBarButtonPress));
setControlBarFullscreen();
setControlBarMenu();
controlBar_.layout = controlBarLayout_;
}
if (messageBox_ == undefined) {
messageBox_ = attachMovie(com.google.ui.common.MessageBox.linkageName, "messageBox_", DEPTH_MESSAGEBOX, {_visible:false, alpha:75});
}
if (shareLayer_ == undefined) {
shareLayer_ = attachMovie(com.google.ui.common.ShareLayer.linkageID, "shareLayer_", DEPTH_SHARELAYER, {_visible:false});
shareLayer_.addEventListener("shareClick", com.google.utils.DelegateEx.create(this, onShareClick));
shareLayer_.addEventListener("blogClick", com.google.utils.DelegateEx.create(this, onBlogClick));
shareLayer_.addEventListener("replayClick", com.google.utils.DelegateEx.create(this, onReplayClick));
}
initializePopupMenu();
}
function PercentToTime(percent) {
return(percent * mediaSource_.getDuration());
}
function TimeToPercent(time) {
if (mediaSource_.getDuration() == 0) {
return(0);
}
return(time / mediaSource_.getDuration());
}
function setControlBarFullscreen() {
if (currentMediaType_ == MEDIA_VIDEO) {
if ((playerMode_ == PLAYER_MODE_FULLSCREEN) || (isFlashFullScreen())) {
controlBar_.showFullscreen = com.google.ui.media.ControlBar.FULLSCREEN_MIN;
} else if ((playerMode_ == PLAYER_MODE_EMBEDDED) && (!showFullScreenButton_)) {
controlBar_.showFullscreen = com.google.ui.media.ControlBar.FULLSCREEN_NONE;
} else {
controlBar_.showFullscreen = com.google.ui.media.ControlBar.FULLSCREEN_MAX;
}
} else {
controlBar_.showFullscreen = com.google.ui.media.ControlBar.FULLSCREEN_NONE;
}
}
function setControlBarMenu() {
if ((playerVariant_ == PLAYER_VARIANT_NORMAL) && (currentMediaType_ == MEDIA_VIDEO)) {
if ((playerMode_ == PLAYER_MODE_EMBEDDED) && (disableLogoMenu_)) {
controlBar_.menuButtonType = com.google.ui.media.ControlBar.MENUBUTTON_LOGO_NO_MENU;
} else {
controlBar_.menuButtonType = com.google.ui.media.ControlBar.MENUBUTTON_LOGO;
}
} else {
controlBar_.menuButtonType = com.google.ui.media.ControlBar.MENUBUTTON_NONE;
}
}
function isFlashFullScreen() {
return(Stage.displayState == "fullScreen");
}
function onFullScreenModeChg(evtObj) {
if (!isFlashFullScreen()) {
if ((orgSizeMode_ != undefined) && (orgSizeMode_ != sizeMode_)) {
sizeMode = orgSizeMode_;
}
}
setControlBarFullscreen();
updateMenu();
}
function onPause(evtObj) {
toggle();
}
function onPlaybackComplete() {
transitionTo("onPlaybackComplete()", STATE_COMPLETED);
dispatchEvent({type:"donePlaying", target:this});
}
function onPlayStateChange(evtObj) {
var _local3 = Math.random();
var _local4 = evtObj.target;
if (!evtObj.requested) {
switch (_local4.getPlayState()) {
case com.google.media.VideoSource.PLAYING :
restartOnPlay_ = false;
break;
case com.google.media.VideoSource.PAUSED :
onPlaybackComplete();
break;
case com.google.media.VideoSource.ERROR :
transitionTo("onPlayStateChange()", STATE_ERROR);
}
}
}
function onMetaData(evtObj) {
adjustAspectRatio(evtObj.width, evtObj.height);
if (resumeTime_ != 0) {
seek(resumeTime_);
resumeTime_ = 0;
}
updateControlBarMarkers();
evtObj.target = this;
dispatchEvent(evtObj);
}
function onAspectRatioChange(evtObj) {
adjustAspectRatio(evtObj.width, evtObj.height);
dispatchEvent({type:"onAspectRatioChange", target:this});
}
function adjustAspectRatio(width, height) {
if ((videoWidth_ != width) || (videoHeight_ != height)) {
videoWidth_ = width;
videoHeight_ = height;
aspectRatio_ = videoWidth_ / videoHeight_;
size();
}
}
function hideBufferingMessage() {
if (preBufferTimer_ != undefined) {
_global.clearInterval(preBufferTimer_);
preBufferTimer_ = undefined;
}
bufferingText_._visible = false;
thumbnailClip_._visible = false;
thumbnailRequested_ = false;
thumbnailLoaded_ = false;
}
function onSourceStatus(evtObj) {
dispatchEvent(evtObj);
}
function onScrub(evtObj) {
if (mediaSource_ == undefined) {
controlBar_.playProgress = 0;
return(undefined);
}
var _local3 = PercentToTime(evtObj.value);
mediaSource_.seek(_local3, com.google.media.VideoSource.PROHIBIT_NEW_URL);
setPlayProgress(_local3);
}
function onBeginScrub(evtObj) {
if (mediaSource_ == undefined) {
return(undefined);
}
transitionTo("onBeginScrub()", STATE_SCRUBBING);
dispatchEvent({type:"beginScrub", target:this, seekPos:PercentToTime(evtObj.value)});
}
function onEndScrub(evtObj) {
if (mediaSource_ == undefined) {
return(undefined);
}
var _local3 = PercentToTime(evtObj.value);
_local3 = Math.min(_local3, mediaSource_.getDuration() - SKIP_DEAD_ZONE);
mediaSource_.seek(_local3, com.google.media.VideoSource.ALLOW_NEW_URL);
if (wasPlaying_) {
transitionTo("onEndScrub()", STATE_BUFFERING);
} else {
transitionTo("onEndScrub()", STATE_PAUSED);
}
dispatchEvent({type:"endScrub", target:this, seekPos:PercentToTime(evtObj.value)});
}
function onVolumeChange(evtObj) {
volume = evtObj.value;
}
function onUpdateTimer() {
if (mediaSource_ != undefined) {
if (!isScrubbing_) {
setPlayProgress(mediaSource_.getTime());
}
var _local2 = mediaSource_.getBufferedRegion();
controlBar_.bufferStart = _local2.first;
controlBar_.bufferEnd = _local2.second;
} else {
controlBar_.bufferStart = 0;
controlBar_.bufferEnd = 0;
controlBar_.playProgress = 0;
controlBar_.timeDisplay = "";
}
}
function createBufferingMessage() {
createTextField("bufferingText_", DEPTH_BUFFERING, 0, 0, 10, 10);
bufferingText_._visible = false;
bufferingText_.autoSize = "left";
bufferingText_.text = "Buffering...";
bufferingText_.background = true;
bufferingText_.backgroundColor = 0;
bufferingText_._x = 10;
bufferingText_._y = 10;
var _local2 = new TextFormat();
_local2.color = 16777215 /* 0xFFFFFF */;
_local2.font = "Verdana";
bufferingText_.setTextFormat(_local2);
bufferingText_.setNewTextFormat(_local2);
}
function setBufferingMessageText(newText) {
bufferingText_.text = newText;
}
function setEndingCallToActionVisibility(makeVisible) {
callToActionBigIcon_._visible = makeVisible;
callToActionBg_._visible = makeVisible;
if (makeVisible) {
callToActionBigIcon_._alpha = 10;
com.google.ui.common.Fader.fadeIn(callToActionBigIcon_, 20, undefined, 0.5);
callToActionBigIcon_._x = Math.round((letterBox_._width / 2) - (callToActionBigIcon_._width / 2));
callToActionBigIcon_._y = Math.round((letterBox_._height / 2) - (callToActionBigIcon_.height / 2));
callToActionBg_._width = videoDisplay_._width;
callToActionBg_._height = videoDisplay_._height;
callToActionBg_._x = videoDisplay_._x;
callToActionBg_._y = videoDisplay_._y;
}
}
function setMouseCallToActionNotVisible() {
callToActionIcon_._visible = false;
callToActionLink_._visible = false;
}
function setMouseCallToActionVisibleLocation(x, y) {
callToActionIcon_._visible = true;
callToActionLink_._visible = true;
callToActionIcon_._x = Math.round(x);
callToActionIcon_._y = Math.round(y) - 3;
}
function fadeVideoIn(duration, callback) {
com.google.ui.common.Fader.fadeIn(videoDisplay_, duration, callback);
}
function fadeVideoOut(duration, callback) {
com.google.ui.common.Fader.fadeOut(videoDisplay_, duration, callback);
}
function setCallToActionProperties(visibleUrl, url, target, asFunctionString) {
callToActionIcon_.textClip_.text = visibleUrl;
callToActionBigIcon_.textClip_.text = visibleUrl;
var _local4 = callToActionBigIcon_.textClip_.getTextFormat();
_local4.url = asFunctionString;
_local4.color = 0;
_local4.font = "Arial";
_local4.bold = true;
_local4.size = 12;
callToActionIcon_.textClip_.setTextFormat(_local4);
callToActionBigIcon_.textClip_.setTextFormat(_local4);
var self = this;
callToActionLink_.onRelease = function () {
if (self.isStatePlaying()) {
self.pause();
}
getURL (url, target);
};
callToActionIcon_.onRelease = callToActionLink_.onRelease;
callToActionBigIcon_.addEventListener("release", com.google.utils.DelegateEx.create(this, callToActionLink_.onRelease));
callToActionIcon_.setSize(callToActionIcon_.textClip_._width + 6, callToActionIcon_.height);
callToActionBigIcon_.setSize(callToActionBigIcon_.textClip_._width + 12, callToActionBigIcon_.height);
with (callToActionBg_) {
beginFill(0);
moveTo(0, 0);
lineTo(letterBox_._width, 0);
lineTo(letterBox_._width, letterBox_._height);
lineTo(0, letterBox_._height);
lineTo(0, 0);
}
with (callToActionLink_) {
beginFill(0);
moveTo(0, 0);
lineTo(letterBox_._width, 0);
lineTo(letterBox_._width, letterBox_._height);
lineTo(0, letterBox_._height);
lineTo(0, 0);
}
}
function createCallToActionBox() {
callToActionBg_ = createEmptyMovieClip("callToActionBg_", DEPTH_CALL_TO_ACTION_BG);
callToActionBg_._visible = false;
callToActionBg_._alpha = 40;
callToActionIcon_ = attachMovie(com.google.ui.common.IconButton.linkageName, "callToActionIcon_", DEPTH_CALL_TO_ACTION_ICON, {baseName:"adbtn"});
callToActionIcon_.setSize(60, 23);
callToActionIcon_._alpha = 65;
callToActionIcon_._visible = false;
callToActionLink_ = createEmptyMovieClip("callToActionLink_", DEPTH_CALL_TO_ACTION_LINK);
callToActionLink_._visible = false;
callToActionLink_._alpha = 0;
callToActionIcon_.createTextField("textClip_", callToActionIcon_.getNextHighestDepth(), 2, 1, 0, 0);
callToActionIcon_.textClip_.autoSize = true;
callToActionIcon_.textClip_.background = false;
callToActionBigIcon_ = attachMovie(com.google.ui.common.IconButton.linkageName, "callToActionBigIcon_", DEPTH_CALL_TO_ACTION_BIGICON, {baseName:"big_adbtn"});
callToActionBigIcon_.setSize(60, 36);
callToActionBigIcon_._visible = false;
callToActionBigIcon_.createTextField("textClip_", callToActionBigIcon_.getNextHighestDepth(), 5, (callToActionBigIcon_.height / 4) - 1, 0, 0);
callToActionBigIcon_.textClip_.autoSize = true;
callToActionBigIcon_.textClip_.background = false;
}
function transitionTo(caller, newState) {
var _local4 = true;
if (currentState_ == newState) {
return(_local4);
}
if (currentState_ != newState) {
switch (currentState_) {
case STATE_PAUSED :
case STATE_COMPLETED :
wasPlaying_ = false;
shareLayer_.hideShareLayer();
break;
case STATE_BUFFERING :
wasPlaying_ = true;
hideBufferingMessage();
break;
case STATE_PLAYING :
wasPlaying_ = true;
break;
case STATE_SCRUBBING :
isScrubbing_ = false;
break;
case STATE_ERROR :
hideMessage();
}
}
if (!_local4) {
return(false);
}
if (currentState_ != newState) {
switch (newState) {
case STATE_COMPLETED :
controlBar_.playing = false;
miniButton_.icon = "icon_play";
restartOnPlay_ = true;
break;
case STATE_PAUSED :
mediaSource_.pause();
controlBar_.playing = false;
miniButton_.icon = "icon_play";
break;
case STATE_BUFFERING :
if (preBufferTimer_ != undefined) {
} else {
preBufferTimer_ = _global.setInterval(this, "checkForPrebuffer", 100);
}
break;
case STATE_PLAYING :
if (restartOnPlay_) {
mediaSource_.seek(0, com.google.media.VideoSource.ALLOW_NEW_URL);
}
mediaSource_.resume();
controlBar_.playing = true;
miniButton_.icon = "icon_pause";
restartOnPlay_ = false;
hideBufferingMessage();
hasBeenPlayed_ = true;
if ((!slideGoogleAttrib_) && (googleAttribTimer_ == undefined)) {
googleAttribTimer_ = _global.setInterval(this, "onGoogleAttribTimer", 3000);
}
break;
case STATE_SCRUBBING :
isScrubbing_ = true;
wasPlaying_ = mediaSource_.getPlayState() != com.google.media.VideoSource.PAUSED;
if (wasPlaying_) {
mediaSource_.pause();
}
restartOnPlay_ = false;
shareLayer_.hideShareLayer();
break;
case STATE_ERROR :
hideBufferingMessage();
mediaSource_.destroy();
videoDisplay_.vid.clear();
if (!flashApiNotifyError_) {
break;
}
flashApiNotifyError_.notifyError(newState);
}
}
dispatchEvent({type:"stateChange", target:this, oldState:currentState_, newState:newState});
if (flashApiNotifyTransition_) {
flashApiNotifyTransition_.notifyTransition(newState);
}
currentState_ = newState;
return(_local4);
}
function onFullScreen(evtObj) {
dispatchEvent({type:"fullscreen", target:this});
}
function onControlBarButtonRelease(evtObj) {
switch (evtObj.command) {
case "play" :
onPause(evtObj);
break;
case "fullscreen" :
if (!ENABLE_FULLSCREEN) {
break;
}
onFullScreen(evtObj);
}
}
function onControlBarButtonPress(evtObj) {
if (!(evtObj.command === "menu")) {
} else {
onOpenMenu();
}
}
function onOpenMenu() {
if (popupMenu_.active()) {
popupMenu_.hide();
} else {
popupMenu_.show(MENU_TIMEOUT);
}
}
function onMenuItem(evtObj) {
switch (evtObj.item) {
case MENU_ITEM_SMOOTH :
smoothing = !smoothing;
break;
case MENU_ITEM_FIT_WINDOW :
sizeMode = (orgSizeMode_ = SIZE_FIT);
if (isFlashFullScreen() || (playerMode_ == PLAYER_MODE_FULLSCREEN)) {
onFullScreen();
}
break;
case MENU_ITEM_ORIGINAL_SIZE :
sizeMode = (orgSizeMode_ = SIZE_ORIGINAL);
if (isFlashFullScreen() || (playerMode_ == PLAYER_MODE_FULLSCREEN)) {
onFullScreen();
}
break;
case MENU_ITEM_DOUBLE_SIZE :
sizeMode = (orgSizeMode_ = SIZE_DOUBLE);
if (isFlashFullScreen() || (playerMode_ == PLAYER_MODE_FULLSCREEN)) {
onFullScreen();
}
break;
case MENU_ITEM_FULLSCREEN :
if (!(isFlashFullScreen() || (playerMode_ == PLAYER_MODE_FULLSCREEN))) {
onFullScreen();
}
break;
case MENU_ITEM_GO_TO_GVC :
getURL(playPage_, "_top");
}
}
function size() {
var _local2 = 0;
var _local3 = 0;
var _local4 = __width;
var _local5 = __height;
if (playerMode_ == PLAYER_MODE_SIMPLE) {
_local2 = 0;
if ((_local5 - ((_local4 / 4) * 3)) >= 20) {
_local5 = _local5 - 20;
}
} else if (playerMode_ == PLAYER_MODE_SYNDICATED) {
if (_local5 < 280) {
_local2 = 12;
_local5 = _local5 - 25;
} else {
_local2 = 20;
_local5 = _local5 - 40;
}
} else if (playerMode_ != PLAYER_MODE_MINI) {
controlBar_._x = 0;
controlBar_.setSize(__width, controlBar_.height);
switch (controlBarPosition_) {
case "top" :
controlBar_._visible = true;
controlBar_._y = 0;
_local2 = controlBar_.height;
_local5 = _local5 - controlBar_.height;
break;
case "bottom" :
controlBar_._visible = true;
controlBar_._y = __height - controlBar_.height;
_local2 = 0;
_local5 = _local5 - controlBar_.height;
break;
case "none" :
controlBar_._visible = false;
_local2 = 0;
}
} else {
miniButton_._x = MINI_BUTTON_LEFT;
miniButton_._y = (__height - miniButton_._height) - MINI_BUTTON_BOTTOM;
}
letterBox_._x = _local3;
letterBox_._y = _local2;
letterBox_._width = _local4;
letterBox_._height = _local5;
messageBox_._x = _local3;
messageBox_._y = _local2;
messageBox_.setSize(_local4, _local5);
shareLayer_._x = _local3;
shareLayer_._y = _local2;
shareLayer_.setSize(_local4, _local5 - controlBar_.height);
var _local6 = _global.Infinity;
var _local7 = _global.Infinity;
if ((playerMode_ != PLAYER_MODE_FULLSCREEN) && (!isFlashFullScreen())) {
switch (sizeMode_) {
case SIZE_ORIGINAL :
_local6 = videoWidth_;
_local7 = videoHeight_;
break;
case SIZE_DOUBLE :
_local6 = videoWidth_ * 2;
_local7 = videoHeight_ * 2;
}
}
if ((_local6 > _local4) || (_local7 > _local5)) {
if (_local4 > (aspectRatio_ * _local5)) {
_local7 = _local5;
_local6 = aspectRatio_ * _local5;
} else {
_local6 = _local4;
_local7 = _local4 / aspectRatio_;
}
}
var _local8 = _local6;
var _local9 = _local7;
var _local10 = _local3 + ((_local4 - _local8) / 2);
var _local11 = _local2 + ((_local5 - _local9) / 2);
videoDisplay_._x = _local10;
videoDisplay_._y = _local11;
videoDisplay_._width = _local8;
videoDisplay_._height = _local9;
if (controlBar_.subtitleButtonEnabled && (subtitleControl_ != null)) {
subtitleControl_.resize();
}
if (thumbnailLoaded_) {
thumbnailClip_._x = _local10;
thumbnailClip_._y = _local11;
thumbnailClip_._width = _local8;
thumbnailClip_._height = _local9;
}
var _local12 = popupMenu_.getWidth();
var _local13 = popupMenu_.getHeight();
var _local14 = (__width - _local12) - 3;
var _local15 = controlBar_._y - _local13;
popupMenu_.moveTo(_local14, _local15);
if (controlBarLayout_ == "skyLayout") {
if (googleAttrib_ == undefined) {
googleAttrib_ = attachMovie("player_by_google_tab", "googleAttrib_", getNextHighestDepth());
googleAttribMask_ = createEmptyMovieClip("googleAttribMask_", getNextHighestDepth());
googleAttribMask_.beginFill(0, 100);
com.google.ui.common.Drawing.drawRectangle(googleAttribMask_, 0, 0, googleAttrib_._width, googleAttrib_._height, 0);
googleAttribMask_.endFill();
googleAttrib_.setMask(googleAttribMask_);
}
if (!slideGoogleAttrib_) {
googleAttrib_._x = _local4 - googleAttrib_._width;
googleAttrib_._y = controlBar_._y - googleAttrib_._height;
googleAttribMask_._x = googleAttrib_._x;
googleAttribMask_._y = googleAttrib_._y;
}
}
}
function onVolumeUp() {
volume = Math.min(1, controlBar_.volume + 0.05);
}
function onVolumeDown() {
volume = Math.max(0, controlBar_.volume - 0.05);
}
function onMute() {
controlBar_.muted = !controlBar_.muted;
}
function changeToPlayerMode(newMode) {
var _local3 = function () {
this._parent.wasInLetterBox_ = false;
this._parent.onLetterboxMouseOut();
};
playerMode_ = newMode;
if (showFullScreenButton_) {
controlBar_._visible = true;
miniButton_._visible = false;
setControlBarFullscreen();
letterBox_.useHandCursor = false;
messageBox_.useHandCursor = false;
} else {
switch (playerMode_) {
case PLAYER_MODE_SIMPLE :
case PLAYER_MODE_SYNDICATED :
onMouseMove = doOnMouseMove;
letterBox_.onRollOut = _local3;
controlBar_._visible = false;
miniButton_._visible = false;
letterBox_.useHandCursor = true;
messageBox_.useHandCursor = true;
break;
case PLAYER_MODE_MINI :
controlBar_._visible = false;
miniButton_._visible = true;
letterBox_.useHandCursor = true;
messageBox_.useHandCursor = true;
break;
case PLAYER_MODE_EMBEDDED :
case PLAYER_MODE_NORMAL :
controlBar_._visible = true;
miniButton_._visible = false;
letterBox_.useHandCursor = false;
messageBox_.useHandCursor = false;
break;
case PLAYER_MODE_FULLSCREEN :
controlBar_._visible = true;
miniButton_._visible = false;
setControlBarFullscreen();
letterBox_.useHandCursor = false;
messageBox_.useHandCursor = false;
break;
case PLAYER_MODE_CLICKTOPLAY :
onMouseMove = doOnMouseMove;
controlBar_._visible = true;
miniButton_._visible = false;
letterBox_.useHandCursor = false;
messageBox_.useHandCursor = false;
controlBarLayout = "clickToPlayLayout";
}
}
setControlBarMenu();
initializePopupMenu();
size();
}
function setPlayProgress(newTime) {
if (lastPlayProgress_ == newTime) {
return(undefined);
}
if (_global.isNaN(newTime)) {
newTime = 0;
}
lastPlayProgress_ = newTime;
controlBar_.playProgress = TimeToPercent(newTime);
controlBar_.timeDisplay = (com.google.utils.StringUtils.FormatTime(newTime) + " / ") + com.google.utils.StringUtils.FormatTime(mediaSource_.getDuration());
dispatchEvent({type:"playProgressUpdated", target:this, newTime:newTime});
}
function checkForPrebuffer() {
var _local2 = 30;
if ((playerMode_ == PLAYER_MODE_SIMPLE) || (playerMode_ == PLAYER_MODE_SYNDICATED)) {
_local2 = 5;
}
var _local3 = mediaSource_.getRemainingDownloadTime(_local2);
if (_local3 <= Math.min(_local2, mediaSource_.getDuration())) {
transitionTo("checkForPrebuffer()", STATE_PLAYING);
} else {
controlBar_.playing = false;
miniButton_.icon = "icon_play";
if ((playerMode_ != PLAYER_MODE_SIMPLE) && (playerMode_ != PLAYER_MODE_SYNDICATED)) {
bufferingText_._visible = true;
}
}
}
function onLetterboxPress() {
var _local2 = getTimer();
if ((_local2 - lastClick) < 300) {
dispatchEvent({type:"doubleClickVideo", target:this});
lastClick = -_global.Infinity;
} else {
dispatchEvent({type:"clickVideo", target:this});
lastClick = _local2;
}
}
function inLetterBox(x, y) {
var _local4 = 10;
return((x > (letterBox_._x + _local4)) && ((y > (letterBox_._y + _local4)) && ((x < ((letterBox_._x + letterBox_._width) - _local4)) && (y < ((letterBox_._y + letterBox_._height) - _local4)))));
}
function doOnMouseMove() {
if (inLetterBox(_xmouse, _ymouse)) {
wasInLetterBox_ = true;
onLetterboxMouseMove();
} else if (wasInLetterBox_) {
wasInLetterBox_ = false;
onLetterboxMouseOut();
}
}
function onLetterboxMouseMove() {
dispatchEvent({type:"mouseOverVideo", target:this});
}
function onLetterboxMouseOut() {
dispatchEvent({type:"mouseOutVideo", target:this});
}
function updateMenu() {
if (playerMode_ == PLAYER_MODE_EMBEDDED) {
if (showFullScreenButton_) {
popupMenu_.checkItem(MENU_ITEM_FULLSCREEN, (isFlashFullScreen() ? "menu_check" : null));
}
return(undefined);
}
popupMenu_.checkItem(MENU_ITEM_SMOOTH, (smoothing ? "menu_check" : null));
if ((playerMode_ == PLAYER_MODE_FULLSCREEN) || (isFlashFullScreen())) {
var _local2 = MENU_ITEM_FULLSCREEN;
} else {
switch (sizeMode_) {
case SIZE_FIT :
var _local2 = MENU_ITEM_FIT_WINDOW;
break;
case SIZE_ORIGINAL :
_local2 = MENU_ITEM_ORIGINAL_SIZE;
break;
case SIZE_DOUBLE :
_local2 = MENU_ITEM_DOUBLE_SIZE;
}
}
popupMenu_.checkItem(MENU_ITEM_FIT_WINDOW, ((_local2 == MENU_ITEM_FIT_WINDOW) ? "menu_check" : null));
popupMenu_.checkItem(MENU_ITEM_ORIGINAL_SIZE, ((_local2 == MENU_ITEM_ORIGINAL_SIZE) ? "menu_check" : null));
popupMenu_.checkItem(MENU_ITEM_DOUBLE_SIZE, ((_local2 == MENU_ITEM_DOUBLE_SIZE) ? "menu_check" : null));
popupMenu_.checkItem(MENU_ITEM_FULLSCREEN, ((_local2 == MENU_ITEM_FULLSCREEN) ? "menu_check" : null));
}
function onSizeModeChange() {
updateUserSetting("sizeMode", sizeMode_);
updateMenu();
size();
dispatchEvent({type:"sizeModeChange", target:this, sizeMode:sizeMode_});
}
function applyUserSetting(name, defaultValue) {
if (userSettings_ == undefined) {
userSettings_ = SharedObject.getLocal("mediaPlayerUserSettings");
}
if (userSettings_.data[name] != undefined) {
this[name] = userSettings_.data[name];
} else {
this[name] = defaultValue;
}
}
function updateUserSetting(name, val) {
if (!storeUserSettings_) {
return(undefined);
}
if (userSettings_ == undefined) {
userSettings_ = SharedObject.getLocal("mediaPlayerUserSettings");
}
userSettings_.data[name] = val;
userSettings_.flush();
}
function applyUserSettings() {
applyUserSetting("volume", 1);
applyUserSetting("smoothing", false);
applyUserSetting("sizeMode", SIZE_FIT);
updateMenu();
}
function set storeUserSettings(val) {
storeUserSettings_ = val;
//return(__get__storeUserSettings());
}
function onThumbnailLoadInit(target) {
if (thumbnailRequested_) {
videoWidth_ = thumbnailClip_._width;
videoHeight_ = thumbnailClip_._height;
aspectRatio_ = videoWidth_ / videoHeight_;
thumbnailClip_._visible = true;
}
thumbnailLoaded_ = true;
thumbnailRequested_ = false;
size();
}
function get showFullScreenButton() {
return(showFullScreenButton_);
}
function set showFullScreenButton(val) {
showFullScreenButton_ = val;
//return(showFullScreenButton);
}
function setControlBarMarkers(markers) {
controlBarMarkers_ = markers;
updateControlBarMarkers();
}
function updateControlBarMarkers() {
if (controlBarMarkers_ == undefined) {
controlBar_.scrubControl.setMarkers(undefined);
return(undefined);
}
var _local2 = mediaSource_.getDuration();
if ((controlBarMarkers_ != undefined) && ((controlBarMarkers_.length > 0) && (_local2 > 0))) {
var _local3 = new Array();
var _local4 = 0;
for ( ; _local4 < controlBarMarkers_.length ; _local4++) {
_local3.push({pos:controlBarMarkers_[_local4].timestamp / _local2, color:MARKER_COLOR, width:MARKER_WIDTH});
}
controlBar_.scrubControl.setMarkers(_local3);
}
}
function onGoogleAttribTimer() {
if (isStatePlaying()) {
slideGoogleAttrib_ = true;
}
_global.clearInterval(googleAttribTimer_);
googleAttribTimer_ = undefined;
}
function isGoogleAttribDoneSliding() {
return((googleAttrib_ != undefined) && (googleAttrib_._y == controlBar_._y));
}
function onEnterFrame() {
if (slideGoogleAttrib_ && (!isGoogleAttribDoneSliding())) {
googleAttrib_._y = googleAttrib_._y + 0.5;
}
}
function get controlBar() {
return(controlBar_);
}
function get videoDisplay() {
return(videoDisplay_);
}
function get letterBox() {
return(letterBox_);
}
function get subtitleLayerDepth() {
return(DEPTH_SUBTITLE);
}
function get subtitleTrackMenuDepth() {
return(DEPTH_SUBTITLE_POPUPMENU);
}
function get tooltipsDepth() {
return(DEPTH_TOOLTIPS);
}
function get mediaCache() {
return(mediaCache_);
}
function get shareLayer() {
return(shareLayer_);
}
function set subtitleControl(sc) {
subtitleControl_ = sc;
shareLayer_.subtitleControl = sc;
//return(__get__subtitleControl());
}
function set disableLogoMenu(val) {
disableLogoMenu_ = val;
//return(__get__disableLogoMenu());
}
static var classPath = com.google.ui.media.MediaPlayer;
static var linkageName = "__Packages.com.google.ui.media.MediaPlayer";
static var forceLinkage = Object.registerClass(linkageName, classPath);
static var STATE_PAUSED = "paused";
static var STATE_BUFFERING = "buffering";
static var STATE_PLAYING = "playing";
static var STATE_SCRUBBING = "scrubbing";
static var STATE_FASTFORWARD = "fastforward";
static var STATE_REWIND = "rewind";
static var STATE_ERROR = "error";
static var STATE_COMPLETED = "completed";
static var MEDIA_VIDEO = "video";
static var MEDIA_AUDIO = "audio";
static var PLAYER_MODE_NORMAL = "normal";
static var PLAYER_MODE_MINI = "mini";
static var PLAYER_MODE_FULLSCREEN = "fullscreen";
static var PLAYER_MODE_EMBEDDED = "embedded";
static var PLAYER_MODE_CLICKTOPLAY = "clickToPlay";
static var PLAYER_MODE_SYNDICATED = "syndicated";
static var PLAYER_MODE_SIMPLE = "simple";
static var PLAYER_VARIANT_NORMAL = "normal";
static var PLAYER_VARIANT_VIXEN = "vixen";
static var DEPTH_CLIENT_OVERLAY = 40;
static var lastClick = -_global.Infinity;
static var SKIP_PERCENT = 0.05;
static var SKIP_MINIMUM = 5;
static var SKIP_DEAD_ZONE = 5;
static var MINI_BUTTON_LEFT = 6;
static var MINI_BUTTON_BOTTOM = 6;
static var FF_SPEED_MULTIPLIER = 6;
static var FF_SEEK_TIME_INTERVAL = 0.2;
static var FF_UPDATE_TIME_INTERVAL = 0.1;
static var ENABLE_FULLSCREEN = true;
static var FS_TIMEOUT_INITIAL = 10000;
static var FS_TIMEOUT = 1000;
static var DEPTH_LETTERBOX = 1;
static var DEPTH_VIDEODISPLAY = 2;
static var DEPTH_CONTROLBAR = 10;
static var DEPTH_THUMBNAIL = 11;
static var DEPTH_CALL_TO_ACTION_BG = 12;
static var DEPTH_CALL_TO_ACTION_ICON = 13;
static var DEPTH_CALL_TO_ACTION_LINK = 14;
static var DEPTH_CALL_TO_ACTION_BIGICON = 15;
static var DEPTH_MESSAGEBOX = 16;
static var DEPTH_MINIBUTTON = 17;
static var DEPTH_BUFFERING = 18;
static var DEPTH_SUBTITLE = 19;
static var DEPTH_SHARELAYER = 20;
static var DEPTH_POPUPMENU = 1000;
static var DEPTH_SUBTITLE_POPUPMENU = 1001;
static var DEPTH_TOOLTIPS = 1100;
static var MENU_TIMEOUT = 10000;
static var MENU_ITEM_SMOOTH = "SmoothVideo";
static var MENU_ITEM_SMOOTH_TEXT = "Smooth Video";
static var MENU_ITEM_FIT_WINDOW = "FitToWindow";
static var MENU_ITEM_FIT_WINDOW_TEXT = "Fit to Window";
static var MENU_ITEM_ORIGINAL_SIZE = "OriginalSize";
static var MENU_ITEM_ORIGINAL_SIZE_TEXT = "Original Size";
static var MENU_ITEM_DOUBLE_SIZE = "DoubleSize";
static var MENU_ITEM_DOUBLE_SIZE_TEXT = "Double Size";
static var MENU_ITEM_FULLSCREEN = "FullScreen";
static var MENU_ITEM_FULLSCREEN_TEXT = "Full Screen";
static var MENU_ITEM_GO_TO_GVC = "GoToGoogleVideo";
static var MENU_ITEM_GO_TO_GVC_TEXT = "Go to Google Video";
static var SIZE_ORIGINAL = "original";
static var SIZE_DOUBLE = "double";
static var SIZE_FIT = "fit";
static var MARKER_WIDTH = 5;
static var MARKER_COLOR = 255;
static var devMode_ = false;
var slideGoogleAttrib_ = false;
var playerMode_ = PLAYER_MODE_NORMAL;
var playerVariant_ = PLAYER_VARIANT_NORMAL;
var controlBarLayout_ = "oneLineLayout";
var controlBarPosition_ = "bottom";
var currentUrl_ = "";
var playPage_ = "http://video.google.com";
var currentMediaType_ = "";
var currentLayoutIndex_ = 1;
var bufferTime_ = 1;
var sizeMode_ = SIZE_FIT;
var smoothing_ = false;
var hlval_ = "";
var isScrubbing_ = false;
var wasPlaying_ = false;
var currentState_ = STATE_PAUSED;
var restartOnPlay_ = false;
var videoWidth_ = 0;
var videoHeight_ = 0;
var aspectRatio_ = 4 / 3;
var resumeTime_ = 0;
var thumbnailLoaded_ = false;
var thumbnailRequested_ = false;
var wasInLetterBox_ = false;
var storeUserSettings_ = true;
var hasBeenPlayed_ = false;
var lastPlayProgress_ = -1;
var subtitleControl_ = null;
var disableLogoMenu_ = false;
}
Symbol 20570 MovieClip [__Packages.com.google.ui.common.IconToggleButton] Frame 0
class com.google.ui.common.IconToggleButton extends com.google.ui.common.IconHalfButton
{
var dispatchEvent;
function IconToggleButton () {
super();
}
function toggleOff() {
if (currState_ == com.google.ui.common.IconButtonBase.UP) {
return(undefined);
}
currState_ = com.google.ui.common.IconButtonBase.UP;
super.setDisplayState(currState_);
}
function toggleOn() {
if (currState_ == com.google.ui.common.IconButtonBase.DOWN) {
return(undefined);
}
currState_ = com.google.ui.common.IconButtonBase.DOWN;
super.setDisplayState(currState_);
}
function toggleState() {
if (currState_ == com.google.ui.common.IconButtonBase.UP) {
toggleOn();
} else {
toggleOff();
}
}
function onPress() {
toggleState();
dispatchEvent({type:"press", target:this});
}
function onRelease() {
dispatchEvent({type:"release", target:this});
}
function onReleaseOutside() {
dispatchEvent({type:"releaseOutside", target:this});
}
function onRollOver() {
}
function onRollOut() {
}
function onDragOut() {
}
function onDragOver() {
}
function onHoldTimer() {
}
static var classPath = com.google.ui.common.IconToggleButton;
static var linkageName = "__Packages.com.google.ui.common.IconToggleButton";
static var forceLinkage = Object.registerClass(linkageName, classPath);
var currState_ = null;
}
Symbol 20571 MovieClip [__Packages.com.google.ui.common.popupmenu.PopupMenuTextItem] Frame 0
class com.google.ui.common.popupmenu.PopupMenuTextItem implements com.google.ui.common.popupmenu.IPopupMenuItem
{
var label_, textFormatNormal_, textFormatHighlight_, containerClip_, textField_;
function PopupMenuTextItem (label, textFormatNormal, textFormatHighlight) {
label_ = label;
textFormatNormal_ = textFormatNormal;
textFormatHighlight_ = textFormatHighlight;
}
function addToContainer(containerClip) {
containerClip_ = containerClip;
var _local3 = containerClip.getNextHighestDepth();
containerClip.createTextField("textField", _local3, 0, 0, 100, 100);
textField_ = containerClip.getInstanceAtDepth(_local3);
if (textFormatNormal_ != undefined) {
textField_.setNewTextFormat(textFormatNormal_);
}
textField_.selectable = false;
textField_.text = label_;
textField_._width = textField_.textWidth + HORIZONTAL_TEXT_PADDING;
textField_._height = textField_.textHeight + VERTICAL_TEXT_PADDING;
}
function isSelectable() {
return(true);
}
function getWidth() {
return(textField_.textWidth + HORIZONTAL_TEXT_PADDING);
}
function getHeight() {
return(textField_.textHeight + VERTICAL_TEXT_PADDING);
}
function toString() {
return(label_);
}
function setVisible(visible) {
textField_._visible = visible;
}
function rollOver() {
textField_.setTextFormat(textFormatHighlight_);
return(true);
}
function rollOut() {
textField_.setTextFormat(textFormatNormal_);
}
function moveTo(x, y) {
textField_._x = x;
textField_._y = y;
}
function setSize(width, height) {
}
function setText(newText) {
textField_.text = newText;
textField_._width = textField_.textWidth + HORIZONTAL_TEXT_PADDING;
textField_._height = textField_.textHeight + VERTICAL_TEXT_PADDING;
}
static var VERTICAL_TEXT_PADDING = 5;
static var HORIZONTAL_TEXT_PADDING = 5;
}
Symbol 20572 MovieClip [__Packages.com.google.ui.common.MessageBox] Frame 0
class com.google.ui.common.MessageBox extends com.google.ui.common.UIComponent
{
var log_, onPress, useHandCursor, createEmptyMovieClip, getNextHighestDepth, backgroundClip_, createTextField, textFormat_, textFieldClip_, __height, __width;
function MessageBox () {
super();
}
function init() {
log_ = new com.google.logs.Logger("Msg");
mx.events.EventDispatcher.initialize(this);
super.init();
onPress = function () {
};
useHandCursor = false;
}
function createChildren() {
log_.log(10, "MessageBox::createChildren");
var _local2 = "Arial";
var _local3 = 16777215 /* 0xFFFFFF */;
createEmptyMovieClip("backgroundClip_", getNextHighestDepth(), {_width:100, _height:100, _x:0, _y:0});
backgroundClip_.beginFill(0);
backgroundClip_.moveTo(0, 0);
backgroundClip_.lineTo(100, 0);
backgroundClip_.lineTo(100, 100);
backgroundClip_.lineTo(0, 100);
backgroundClip_.lineTo(0, 0);
backgroundClip_.endFill();
backgroundClip_._alpha = alpha_;
createTextField("textFieldClip_", getNextHighestDepth(), 0, 0, 100, 100);
textFormat_ = new TextFormat();
textFormat_.font = _local2;
textFormat_.size = fontSize_;
textFormat_.color = _local3;
textFormat_.align = "center";
textFieldClip_.selectable = false;
textFieldClip_.multiline = true;
textFieldClip_.setNewTextFormat(textFormat_);
textFieldClip_.autoSize = "center";
textFieldClip_.wordWrap = true;
log_.log(10, "Initial message: " + message_);
textFieldClip_.text = message_;
size();
}
function size() {
log_.log(10, (("MessageBox::size to " + __width) + " x ") + __height);
backgroundClip_._width = __width;
backgroundClip_._height = __height;
if ((__width == 0) && (__height == 0)) {
return(undefined);
}
var _local2 = Math.max(2 * HORIZONTAL_MARGIN, __width - (2 * HORIZONTAL_MARGIN));
var _local3 = Math.max(VERTICAL_MARGIN, __height - VERTICAL_MARGIN);
textFormat_.size = fontSize_;
do {
textFieldClip_.setTextFormat(textFormat_);
textFieldClip_._width = _local2;
log_.log(10, ((((("Text metrics @ availWidth = " + _local2) + ": ") + "width: ") + textFieldClip_.textWidth) + " height: ") + textFieldClip_.textHeight);
if (textFieldClip_.textHeight > _local3) {
textFormat_.size--;
log_.log(10, (((("Too tall (" + textFieldClip_.textHeight) + " > ") + _local3) + "): shrinking font to ") + textFormat_.size);
}
} while ((textFormat_.size > MINIMUM_FONT_SIZE) && (textFieldClip_.textHeight > _local3));
textFieldClip_.setTextFormat(textFormat_);
textFieldClip_._x = (__width - textFieldClip_.textWidth) / 2;
textFieldClip_._y = (_local3 - textFieldClip_.textHeight) / 2;
textFieldClip_._width = textFieldClip_.textWidth;
log_.log(10, (("positioned at " + textFieldClip_._x) + ", ") + textFieldClip_._y);
}
function set message(val) {
log_.log(5, ("MessageBox::message set to \"" + val) + "\"");
message_ = val;
textFieldClip_.text = val;
size();
//return(message);
}
function get message() {
return(message_);
}
function set alpha(val) {
log_.log(5, "MessageBox::alpha set to " + val);
alpha_ = val;
backgroundClip_._alpha = val;
//return(alpha);
}
function get alpha() {
return(alpha_);
}
function set fontSize(val) {
log_.log(5, "MessageBox::fontSize set to " + val);
fontSize_ = val;
size();
//return(fontSize);
}
function get fontSize() {
return(fontSize_);
}
static var classPath = com.google.ui.common.MessageBox;
static var linkageName = "__Packages.com.google.ui.common.MessageBox";
static var forceLinkage = Object.registerClass(linkageName, classPath);
static var HORIZONTAL_MARGIN = 10;
static var VERTICAL_MARGIN = 30;
static var MINIMUM_FONT_SIZE = 4;
var message_ = "";
var alpha_ = 100;
var fontSize_ = 24;
}
Symbol 20573 MovieClip [__Packages.com.google.video.ui.SimpleControlBar] Frame 0
class com.google.video.ui.SimpleControlBar extends com.google.video.ui.ControlBar
{
var disableGVLink_, googleVideoLogo_, attachMovie, getNextHighestDepth, timeDisplay_, playlistControl_, muteButton_, mediaPlayer_, videoPlayback_, width_, height_, dispatchEvent, __get__disableGVLink, __get__linkDestination, __get__playlistSize, __get__playlistPosition;
function SimpleControlBar () {
super();
var _local3 = (disableGVLink_ ? (com.google.ui.common.StylishText.NONE) : (com.google.ui.common.StylishText.UNDERLINE));
googleVideoLogo_ = com.google.ui.common.StylishText(attachMovie(com.google.ui.common.StylishText.linkageName, "googleVideoLogo_", getNextHighestDepth(), {color:16777215, style:_local3}));
googleVideoLogo_.text = "Google Video";
if (!disableGVLink_) {
googleVideoLogo_.linkDestination = "http://video.google.com/";
}
timeDisplay_ = com.google.ui.common.StylishText(attachMovie(com.google.ui.common.StylishText.linkageName, "timeDisplay_", getNextHighestDepth(), {color:16777215}));
timeDisplay_.text = "";
timeDisplay_._visible = false;
playlistControl_ = com.google.video.ui.PlaylistControl(attachMovie(com.google.video.ui.PlaylistControl.linkageName, "playlistControl_", getNextHighestDepth()));
playlistControl_.addEventListener("prevItem", com.google.utils.DelegateEx.create(this, onPrevItem));
playlistControl_.addEventListener("nextItem", com.google.utils.DelegateEx.create(this, onNextItem));
muteButton_ = com.google.video.ui.MuteButton(attachMovie(com.google.video.ui.MuteButton.linkageName, "muteButton_", getNextHighestDepth()));
muteButton_.addEventListener("clicked", com.google.utils.DelegateEx.create(this, onMuteClicked));
muteButton_._visible = false;
}
function initialize(vp) {
super.initialize(vp);
mediaPlayer_.addEventListener("stateChange", com.google.utils.DelegateEx.create(this, onPlayerStateChange));
mediaPlayer_.addEventListener("playProgressUpdated", com.google.utils.DelegateEx.create(this, onPlayProgressUpdated));
muteButton_.muted = (mediaPlayer_.mute = false);
}
function setSize(width, height) {
super.setSize(width, height);
playlistControl_.setSize(width, height);
googleVideoLogo_._x = (width - googleVideoLogo_.width) - 4;
googleVideoLogo_._y = (height - googleVideoLogo_.height) - 4;
timeDisplay_._x = 8;
timeDisplay_._y = (height - timeDisplay_.height) - 4;
if (width < 300) {
muteButton_._x = width - 29;
} else {
var _local5 = (width / 2) + (playlistControl_.width / 2);
muteButton_._x = (_local5 + ((googleVideoLogo_._x - _local5) / 2)) - 14;
}
muteButton_._y = height - 19;
}
function onMuteClicked(evtObj) {
muteButton_.muted = !muteButton_.muted;
mediaPlayer_.mute = muteButton_.muted;
}
function onMailClicked(evtObj) {
mediaPlayer_.showEmailPane(videoPlayback_.mediaState, width_, height_);
}
function onPlayerStateChange(evtObj) {
playlistControl_.visible = true;
muteButton_._visible = true;
if (width_ < 300) {
googleVideoLogo_._visible = false;
}
}
function onPrevItem(evtObj) {
dispatchEvent({type:"prevItem", target:this});
}
function onNextItem(evtObj) {
dispatchEvent({type:"nextItem", target:this});
}
function onPlayProgressUpdated(evtObj) {
var _local3 = mediaPlayer_.duration;
if (_local3 == 0) {
timeDisplay_._visible = false;
} else {
timeDisplay_._visible = true;
timeDisplay_.text = (com.google.utils.StringUtils.FormatTime(evtObj.newTime) + " / ") + com.google.utils.StringUtils.FormatTime(mediaPlayer_.duration);
timeDisplay_._y = (height_ - timeDisplay_.height) - 4;
}
}
function set disableGVLink(val) {
disableGVLink_ = val;
//return(__get__disableGVLink());
}
function set linkDestination(dest) {
if (!disableGVLink_) {
googleVideoLogo_.linkDestination = dest;
}
//return(__get__linkDestination());
}
function set playlistSize(size) {
playlistControl_.playlistSize = size;
//return(__get__playlistSize());
}
function set playlistPosition(pos) {
playlistControl_.position = pos;
//return(__get__playlistPosition());
}
static var classPath = com.google.video.ui.SimpleControlBar;
static var linkageName = "__Packages.com.google.video.ui.SimpleControlBar";
static var forceLinkage = Object.registerClass(linkageName, Function(classPath));
}
Symbol 20574 MovieClip [__Packages.com.google.video.ui.SkipButton] Frame 0
class com.google.video.ui.SkipButton extends com.google.video.ui.TransparentButton
{
var redraw, lineStyle, beginFill, endFill, state;
function SkipButton () {
super();
redraw();
}
function drawButtonContents() {
lineStyle(0, 13421772, 0);
if (direction == EAST) {
beginFill(13421772, 100);
com.google.ui.common.Drawing.drawTriangle(this, 13, 3, 7, 9, 13, 15, 1);
endFill();
beginFill(13421772, 100);
com.google.ui.common.Drawing.drawRectangle(this, 4, 4, 2, 10, 1);
endFill();
} else {
beginFill(13421772, 100);
com.google.ui.common.Drawing.drawTriangle(this, 4, 3, 10, 9, 4, 15, 1);
endFill();
beginFill(13421772, 100);
com.google.ui.common.Drawing.drawRectangle(this, 11, 4, 2, 10, 1);
endFill();
}
}
function drawButtonContainer() {
var _local2 = 0;
var _local3 = 2;
var _local4 = 17;
var _local5 = 14;
lineStyle(0, 13421772, 0);
if (state == com.google.video.ui.SimpleButton.UP) {
beginFill(0, 10);
com.google.ui.common.Drawing.drawRectangle(this, _local2, _local3, _local4, _local5, 3);
endFill();
} else if (state == com.google.video.ui.SimpleButton.OVER) {
beginFill(4473924, 100);
com.google.ui.common.Drawing.drawRectangle(this, _local2, _local3, _local4, _local5, 3);
endFill();
} else if (state == com.google.video.ui.SimpleButton.DOWN) {
beginFill(2236962, 100);
com.google.ui.common.Drawing.drawRectangle(this, _local2, _local3, _local4, _local5, 3);
endFill();
}
}
static var classPath = com.google.video.ui.SkipButton;
static var linkageName = "__Packages.com.google.video.ui.SkipButton";
static var forceLinkage = Object.registerClass(linkageName, Function(classPath));
static var EAST = 0;
static var WEST = 1;
var direction = EAST;
}
Symbol 20575 MovieClip [__Packages.com.google.video.apps.VideoPlayback] Frame 0
class com.google.video.apps.VideoPlayback extends com.google.video.apps.BaseVideoPlayback
{
var clip_, vgcHostPort, sourceIdParam, videoStats_, flashApi_, docidPosition_, playlistSize_, playerPrefEventSent_, playlists_, redirectUrl_, eventReporter_, mediaState_, mediaRss_, playerMode_, layout_, messages_, eovMessage_, session_id_val_, fullscreenConnectionId_, fullscreenConnection_, fullscreenStatus_, proxyId_, proxy_, adeventReporter_, adImpressionStats_, adConversionStats_, contentadSynd_, prevMediaRssIndex_, mediaPlayer_, playerStats_, metadataBar_, metadataCard_, playPauseButton_, bufferingWidget_, controlBar_, urlQueue_, width_, height_, playlistNext_, mediaPlayer, ERROR_NO_VIDEO, playlistStarted_, updateRSSIndexTimer_, playlistTimer_, playlistMediaStates_, verifiedhost_;
function VideoPlayback (clip) {
super(clip);
}
function initializeApplication() {
if (!super.initializeApplication()) {
return(false);
}
if (clip_.webhostport != undefined) {
com.google.webutil.url.Utils.setServerUrl(VGC_URL, clip_.webhostport);
} else {
com.google.webutil.url.Utils.setServerUrl(VGC_URL, com.google.webutil.url.Utils.getProtocolHostAndPort(clip_._url));
}
vgcHostPort = com.google.webutil.url.Utils.getServerUrl(VGC_URL);
if (clip_.sourceid != undefined) {
sourceIdParam = "&sourceid=" + clip_.sourceid;
} else {
sourceIdParam = "";
}
if ((clip_.videoUrl == undefined) && (clip_.videourl != undefined)) {
clip_.videoUrl = clip_.videourl;
}
if ((clip_.docid == undefined) && (clip_.docId != undefined)) {
clip_.docid = clip_.docId;
}
if ((clip_.timedTextUrl == undefined) && (clip_.timedtexturl != undefined)) {
clip_.timedTextUrl = clip_.timedtexturl;
}
if ((clip_.mediarss == undefined) && (clip_.mediaRss != undefined)) {
clip_.mediarss = clip_.mediaRss;
}
if ((clip_.autoplay == undefined) && (clip_.autoPlay != undefined)) {
clip_.autoplay = clip_.autoPlay;
}
if ((clip_.thumbnailurl == undefined) && (clip_.thumbnailUrl != undefined)) {
clip_.thumbnailurl = clip_.thumbnailUrl;
}
if ((clip_.initialtime == undefined) && (clip_.initialTime != undefined)) {
clip_.initialtime = clip_.initialTime;
}
if (clip_.redirecturl == undefined) {
clip_.redirecturl = vgcHostPort + VGC_REDIRECTURL_PATH;
}
if ((clip_.playerMode == undefined) && (clip_.playermode != undefined)) {
clip_.playerMode = clip_.playermode;
}
if ((clip_.proxyid == undefined) && (clip_.proxyId != undefined)) {
clip_.proxyid = clip_.proxyId;
}
if (clip_.avoidgeturl == undefined) {
if (clip_.avoidGetUrl != undefined) {
clip_.avoidgeturl = clip_.avoidGetUrl;
} else {
clip_.avoidgeturl = true;
}
}
var _local3 = ((clip_.playerMode == com.google.ui.media.MediaPlayer.PLAYER_MODE_NORMAL) ? "detailpage" : "embedded");
var _local4 = {};
_local4.el = _local3;
_local4.sourceid = clip_.sourceid;
_local4.q = clip_.q;
videoStats_ = new com.google.utils.VideoStats("http://video-stats.video.google.com/s", "vss", _local4);
if (clip_.enablejsapi == 1) {
flashApi_ = new com.google.video.apps.FlashApi();
flashApi_.initFlashApi(clip_);
}
docidPosition_ = 0;
playlistSize_ = 1;
playerPrefEventSent_ = false;
playlists_ = new com.google.video.apps.VideoPlaylists();
redirectUrl_ = new com.google.utils.UrlConstructor(clip_.redirecturl);
eventReporter_ = new com.google.utils.EventReporter(vgcHostPort + "/stats");
redirectUrl_.addGlobalParameters({frame:"stats"});
eventReporter_.addGlobalParameters({frame:"stats"});
if (clip_.videopubid != undefined) {
redirectUrl_.addGlobalParameters({pubid:clip_.videopubid});
eventReporter_.addGlobalParameters({pubid:clip_.videopubid});
}
if (com.google.utils.SecurityUtils.isSafeUrl(clip_.videoUrl) || (com.google.utils.SecurityUtils.isSafeUrl(clip_.audioUrl))) {
mediaState_ = new com.google.video.apps.MediaState();
mediaState_.fromArgs(clip_, vgcHostPort + VGC_PLAYPAGE_PATH);
} else if (com.google.utils.SecurityUtils.isSafeUrl(clip_.mediarss)) {
mediaRss_ = new com.google.xml.MediaRSS();
mediaRss_.init(clip_.mediarss);
} else if ((clip_.apptype != undefined) && ((clip_.videopubid != undefined) && ((clip_.videocreatorid != undefined) && ((clip_.videocpid != undefined) && (clip_.pubhost != undefined))))) {
var _local5 = com.google.webutil.url.Utils.getProtocolHostAndPort(clip_.pubhost);
var _local6 = ((((((((((((vgcHostPort + VGC_VIDEOSYNDFEED_PATH) + "apptype=") + clip_.apptype) + "&mode=") + clip_.mode) + "&videopubid=") + clip_.videopubid) + "&videocreatorid=") + clip_.videocreatorid) + "&videocpid=") + clip_.videocpid) + "&pubhost=") + _local5.substring(7, _local5.length);
mediaRss_ = new com.google.xml.MediaRSS();
mediaRss_.init(_local6);
redirectUrl_.addGlobalParameters({pubhost:_global.escape(clip_.pubhost)});
redirectUrl_.addGlobalParameters({apptype:clip_.apptype});
redirectUrl_.addGlobalParameters({videopubid:clip_.videopubid});
redirectUrl_.addGlobalParameters({videocreatorid:clip_.videocreatorid});
redirectUrl_.addGlobalParameters({videocpid:clip_.videocpid});
eventReporter_.addGlobalParameters({pubhost:_global.escape(clip_.pubhost)});
eventReporter_.addGlobalParameters({apptype:_global.escape(clip_.apptype)});
eventReporter_.addGlobalParameters({videopubid:_global.escape(clip_.videopubid)});
eventReporter_.addGlobalParameters({videocreatorid:_global.escape(clip_.videocreatorid)});
eventReporter_.addGlobalParameters({videocpid:_global.escape(clip_.videocpid)});
} else if (clip_.docid != undefined) {
mediaRss_ = new com.google.xml.MediaRSS();
var _local7 = clip_.docid.split(":");
if (_local7.length == 3) {
mediaRss_.init(((((((((vgcHostPort + VGC_VIDEOFEED_PATH) + _local7[0]) + sourceIdParam) + "&begin=") + _local7[1]) + "&len=") + _local7[2]) + "&hl=") + clip_.hl);
} else {
mediaRss_.init(((((vgcHostPort + VGC_VIDEOFEED_PATH) + clip_.docid) + sourceIdParam) + "&hl=") + clip_.hl);
}
}
playerMode_ = clip_.playerMode;
if ((playerMode_ != undefined) && (playerMode_.indexOf("sky") == 0)) {
layout_ = playerMode_;
playerMode_ = com.google.ui.media.MediaPlayer.PLAYER_MODE_EMBEDDED;
} else if ((playerMode_ == undefined) || ((playerMode_ != com.google.ui.media.MediaPlayer.PLAYER_MODE_NORMAL) && ((playerMode_ != com.google.ui.media.MediaPlayer.PLAYER_MODE_MINI) && ((playerMode_ != com.google.ui.media.MediaPlayer.PLAYER_MODE_FULLSCREEN) && ((playerMode_ != com.google.ui.media.MediaPlayer.PLAYER_MODE_EMBEDDED) && ((playerMode_ != com.google.ui.media.MediaPlayer.PLAYER_MODE_SYNDICATED) && (playerMode_ != com.google.ui.media.MediaPlayer.PLAYER_MODE_SIMPLE))))))) {
playerMode_ = com.google.ui.media.MediaPlayer.PLAYER_MODE_EMBEDDED;
}
eventReporter_.addGlobalParameters({mode:playerMode_});
if (playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_EMBEDDED) {
shareLayerEnabled_ = true;
sendLinkButtonEnabled_ = true;
}
if (clip_.showShareButtons) {
shareLayerEnabled_ = true;
sendLinkButtonEnabled_ = true;
}
if (clip_.showEmbedButton) {
embedButtonEnabled_ = true;
}
messages_ = new com.google.xml.XlbMessages();
if (com.google.utils.SecurityUtils.isSafeUrl(clip_.messagesUrl)) {
messages_.init(clip_.messagesUrl);
} else if ((clip_.hl != undefined) && (clip_.hl != "en")) {
messages_.init((vgcHostPort + VGC_FLASHUI_PATH) + clip_.hl);
}
eovMessage_ = clip_.eovMessage;
session_id_val_ = Math.random();
var _local8 = String(Math.floor(2147483647 * session_id_val_));
eventReporter_.addGlobalParameters({id:_local8});
redirectUrl_.addGlobalParameters({id:_local8});
if (!isNativeFlashFullScreen()) {
fullscreenConnectionId_ = clip_.fscid;
if (fullscreenConnectionId_ == undefined) {
fullscreenConnectionId_ = "fsc_" + _local8;
}
if ((playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_NORMAL) || (playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_FULLSCREEN)) {
fullscreenConnection_ = new com.google.comm.NamedConnection();
fullscreenStatus_ = new Object();
}
}
proxyId_ = clip_.docid;
if (proxyId_ == undefined) {
proxyId_ = "proxy_" + _local8;
}
if (clip_.proxyid != undefined) {
proxyId_ = clip_.proxyid;
}
initializeProxy(proxyId_);
if (playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_SYNDICATED) {
initializeSyndicatedPlayer();
requestHostLocation();
}
clip_.watch("seekTime", seekTimeWatcher, this);
clip_.watch("doPause", doPauseWatcher, this);
clip_.watch("doPlay", doPlayWatcher, this);
HandleResize();
if (flashApi_ != undefined) {
flashApi_.playerReady();
}
return(true);
}
function initializeProxy(proxyId) {
proxy_ = new com.google.comm.ProxyStub(proxyId);
proxy_.setHandler("play", com.google.utils.DelegateEx.create(this, function () {
this.mediaPlayer_.play();
}));
proxy_.setHandler("pause", com.google.utils.DelegateEx.create(this, function () {
this.mediaPlayer_.pause();
}));
proxy_.setHandler("seek", com.google.utils.DelegateEx.create(this, function (args) {
this.mediaPlayer_.seek(args.time);
this.lastSeekTime_ = args.time;
}));
proxy_.setHandler("stopDownload", com.google.utils.DelegateEx.create(this, function () {
this.mediaPlayer_.stopDownload();
}));
}
function initializeSyndicatedPlayer() {
if (clip_.adserver == undefined) {
clip_.adserver = "http://pagead2.googlesyndication.com";
}
System.security.loadPolicyFile(clip_.adserver + "/cpa/crossdomain.xml");
adeventReporter_ = new com.google.utils.EventReporter(clip_.adserver + "/pagead/conversion/");
adImpressionStats_ = new Object();
adConversionStats_ = new Object();
adeventReporter_.addGlobalParameters({label:"videoautoplayed"});
contentadSynd_ = new com.google.xml.ContentAdSynd();
}
function updateMediaRSSIndex() {
prevMediaRssIndex_ = playlists_.curIndex;
}
function isNativeFlashFullScreen() {
if ((Stage.displayState == undefined) || (clip_.fs != "true")) {
return(false);
}
return(true);
}
function initializePlayer() {
super.initializePlayer();
var mediaPlayer = mediaPlayer_;
videoStats_.getMediaTime = function () {
return(mediaPlayer.time);
};
videoStats_.getMediaDuration = function () {
return(mediaPlayer.duration);
};
videoStats_.getBytesDownloaded = function () {
return(mediaPlayer.bytesLoaded);
};
videoStats_.getBufferEmptyEvents = function () {
return(mediaPlayer.getBufferEmptyEvents());
};
if (clip_.nogvlm) {
mediaPlayer_.disableLogoMenu = true;
}
mediaPlayer_.showFullScreenButton = isNativeFlashFullScreen();
if ((playerMode_ != com.google.ui.media.MediaPlayer.PLAYER_MODE_NORMAL) && (playerMode_ != com.google.ui.media.MediaPlayer.PLAYER_MODE_FULLSCREEN)) {
mediaPlayer_.storeUserSettings = false;
}
if ((playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_SIMPLE) || (playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_SYNDICATED)) {
initSyndicatedUI();
} else if (playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_EMBEDDED) {
mediaPlayer_.sizeMode = com.google.ui.media.MediaPlayer.SIZE_FIT;
mediaPlayer_.smoothing = true;
}
com.google.ui.common.ToolTips.init(mediaPlayer_, mediaPlayer_.tooltipsDepth);
mediaPlayer_.addEventListener("fullscreen", com.google.utils.DelegateEx.create(this, onFullscreen));
mediaPlayer_.addEventListener("doubleClickVideo", com.google.utils.DelegateEx.create(this, onDoubleClickVideo));
mediaPlayer_.addEventListener("stateChange", com.google.utils.DelegateEx.create(this, onPlayerStateChange));
mediaPlayer_.addEventListener("beginScrub", com.google.utils.DelegateEx.create(this, onBeginScrub));
mediaPlayer_.addEventListener("endScrub", com.google.utils.DelegateEx.create(this, onEndScrub));
mediaPlayer_.addEventListener("sizeModeChange", com.google.utils.DelegateEx.create(this, onSizeModeChange));
mediaPlayer_.addEventListener("shareClick", com.google.utils.DelegateEx.create(this, onShareClick));
mediaPlayer_.addEventListener("blogClick", com.google.utils.DelegateEx.create(this, onBlogClick));
mediaPlayer_.addEventListener("replayClick", com.google.utils.DelegateEx.create(this, onReplayClick));
if (mediaRss_.xmlUrl_ != "") {
mediaRss_.addEventListener("xmlParsed", com.google.utils.DelegateEx.create(this, onRssParsed));
mediaRss_.fetch();
}
if (messages_.xmlUrl_ != "") {
messages_.addEventListener("xmlParsed", com.google.utils.DelegateEx.create(this, onMessagesParsed));
messages_.fetch();
}
contentadSynd_.addEventListener("xmlParsed", com.google.utils.DelegateEx.create(this, onContentAdParsed));
var _local3 = new Object();
_local3.onKeyDown = com.google.utils.DelegateEx.create(this, onKeyDown);
_local3.onKeyUp = com.google.utils.DelegateEx.create(this, onKeyUp);
Key.addListener(_local3);
if (playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_SYNDICATED) {
playerStats_ = new com.google.video.apps.VideoPlaybackStats(this);
var _local4 = clip_.statsduration;
if (_local4 == undefined) {
_local4 = ADCLICK_REPORT_TIME + ";5000;15000;30000;20%;40%;60%;80%;";
}
playerStats_.setReportTime(_local4.split(";"));
if ((clip_.nostats != "true") && (mediaPlayer_.playerMode != com.google.ui.media.MediaPlayer.PLAYER_MODE_EMBEDDED)) {
playerStats_.addEventListener("reportEvent", com.google.utils.DelegateEx.create(this, onReportStatsEvent));
}
}
mediaPlayer_.playerVariant = com.google.ui.media.MediaPlayer.PLAYER_VARIANT_NORMAL;
mediaPlayer_.playerMode = playerMode_;
if (layout_.indexOf("sky") == 0) {
mediaPlayer_.controlBarLayout = "skyLayout";
}
mediaPlayer_.stopDownload();
if ((mediaState_ != undefined) && ((mediaState_.videoUrl != undefined) || (mediaState_.audioUrl != undefined))) {
initPlayerWithVars();
}
initPlayerWithhl();
flashApi_.setMediaPlayer(mediaPlayer_);
}
function initSyndicatedUI() {
var _local2 = com.google.ui.media.MediaPlayer.DEPTH_CLIENT_OVERLAY;
metadataBar_ = com.google.video.ui.MetadataBar(mediaPlayer_.attachMovie(com.google.video.ui.MetadataBar.linkageName, "metadataBar_clip", _local2++));
metadataBar_.showMetadata = false;
if (playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_SIMPLE) {
metadataBar_._visible = false;
}
metadataCard_ = com.google.video.ui.MetadataCard(mediaPlayer_.attachMovie(com.google.video.ui.MetadataCard.linkageName, "metadataCard_clip", _local2++));
playPauseButton_ = com.google.video.ui.PlayPauseButton(mediaPlayer_.attachMovie(com.google.video.ui.PlayPauseButton.linkageName, "playPauseButton_clip", _local2++));
playPauseButton_.addEventListener("clicked", com.google.utils.DelegateEx.create(this, onPlayPauseClicked));
metadataCard_.playPauseButton = playPauseButton_;
if (playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_SYNDICATED) {
playPauseButton_._visible = false;
}
bufferingWidget_ = com.google.video.ui.BufferingWidget(mediaPlayer_.attachMovie(com.google.video.ui.BufferingWidget.linkageName, "bufferingWidget_clip", _local2++));
if (playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_SIMPLE) {
controlBar_ = com.google.video.ui.SimpleControlBar(mediaPlayer_.attachMovie(com.google.video.ui.SimpleControlBar.linkageName, "controlBar_clip", _local2++, {disableGVLink:clip_.nogvlm}));
} else {
controlBar_ = com.google.video.ui.SyndicatedControlBar(mediaPlayer_.attachMovie(com.google.video.ui.SyndicatedControlBar.linkageName, "controlBar_clip", _local2++, {disableGVLink:clip_.nogvlm}));
com.google.video.ui.SyndicatedControlBar(controlBar_).videoPubHost = clip_.pubhost;
var _local3 = new Object();
_local3.apptype = clip_.apptype;
_local3.videocreatorid = clip_.videocreatorid;
_local3.videocpid = clip_.videocpid;
com.google.video.ui.SyndicatedControlBar(controlBar_).videoContentPackageInfo = _local3;
if (session_id_val_ > 0.5) {
eventReporter_.addGlobalParameters({tr:"0"});
com.google.video.ui.SyndicatedControlBar(controlBar_).rotateTitleCard = false;
} else {
eventReporter_.addGlobalParameters({tr:"1"});
}
}
controlBar_.initialize(this);
controlBar_.addEventListener("prevItem", com.google.utils.DelegateEx.create(this, onPrevItem));
controlBar_.addEventListener("nextItem", com.google.utils.DelegateEx.create(this, onNextItem));
controlBar_.addEventListener("videoItemClicked", com.google.utils.DelegateEx.create(this, onVideoItemClicked));
mediaPlayer_.addEventListener("mouseOverVideo", com.google.utils.DelegateEx.create(this, onMouseOverVideo));
mediaPlayer_.addEventListener("mouseOutVideo", com.google.utils.DelegateEx.create(this, onMouseOutVideo));
mediaPlayer_.storeUserSettings = false;
mediaPlayer_.volume = 1;
mediaPlayer_.smoothing = true;
HandleResize();
}
function onVideoItemClicked(evtObj) {
incMediaRssIndex((playlists_.allItems.length - playlists_.curIndex) + evtObj.itemPos, true);
playMediaRssItem();
}
function initPlayerWithVars() {
videoStats_.endPlayback();
if (mediaState_.videoUrl != undefined) {
mediaPlayer_.mediaType = com.google.ui.media.MediaPlayer.MEDIA_VIDEO;
setVideoUrl(mediaState_.videoUrl);
} else if (mediaState_.audioUrl != undefined) {
mediaPlayer_.mediaType = com.google.ui.media.MediaPlayer.MEDIA_AUDIO;
mediaPlayer_.url = mediaState_.audioUrl;
}
mediaPlayer_.playPage = mediaState_.playPage;
if (layout_ == "sky-embed") {
mediaPlayer_.controlBar.setSkyLogoClickUrl(mediaState_.playPage);
}
_global.setInterval(this, "checkForPageChanges", 100);
if (mediaPlayer_.playerMode == com.google.ui.media.MediaPlayer.PLAYER_MODE_FULLSCREEN) {
initializeFullscreenConnection2();
fullscreenConnection_.open(fullscreenConnectionId_);
_global.setInterval(this, "updateFullscreenStatus", 250, false);
} else {
if (mediaState_.videoUrl != undefined) {
if (mediaState_.initialTime != undefined) {
mediaPlayer_.resumeTime = mediaState_.initialTime;
mediaState_.initialTime = undefined;
} else {
mediaPlayer_.resumeTime = 0;
}
if (clip_.autoplay) {
mediaPlayer_.loadMedia(true);
} else {
mediaPlayer_.loadThumbnail(mediaState_.thumbnailUrl);
}
} else if (mediaState_.audioUrl != undefined) {
if (clip_.autoplay) {
mediaPlayer_.play();
}
}
clip_.autoplay = false;
if ((mediaPlayer_.playerMode == com.google.ui.media.MediaPlayer.PLAYER_MODE_NORMAL) && (!isNativeFlashFullScreen())) {
initializeFullscreenConnection();
}
}
if ((mediaPlayer_.playerMode == com.google.ui.media.MediaPlayer.PLAYER_MODE_SYNDICATED) && (!playerPrefEventSent_)) {
playerPrefEventSent_ = true;
var _local2 = new Object();
_local2.smode = mediaPlayer_.sizeMode;
_local2.vol = mediaPlayer_.volume;
_local2.smooth = mediaPlayer_.smoothing;
_local2.ver = _global.escape(System.capabilities.version);
_local2.resX = System.capabilities.screenResolutionX;
_local2.resY = System.capabilities.screenResolutionY;
_local2.dpi = System.capabilities.screenDPI;
_local2.rw = clip_._width;
_local2.rh = clip_._height;
eventReporter_.send(_local2);
}
initSubtitle(false, "", false);
HandleResize();
}
function initPlayerWithhl() {
mediaPlayer_.hlval = clip_.hl;
}
function initSubtitle(is_fullscreen, video_doc_id, sub_on) {
if ((mediaPlayer_.playerMode == com.google.ui.media.MediaPlayer.PLAYER_MODE_SYNDICATED) || ((mediaPlayer_.playerMode == com.google.ui.media.MediaPlayer.PLAYER_MODE_SIMPLE) || (mediaPlayer_.playerMode == com.google.ui.media.MediaPlayer.PLAYER_MODE_MINI))) {
return(undefined);
}
if ((mediaPlayer_.playerMode == com.google.ui.media.MediaPlayer.PLAYER_MODE_FULLSCREEN) && (!is_fullscreen)) {
return(undefined);
}
if (subtitleControl_ == null) {
subtitleControl_ = new com.google.video.subtitle.SubtitleControl(mediaPlayer_);
subtitleControl_.addEventListener("subtitleUpdate", com.google.utils.DelegateEx.create(this, onSubtitleUpdate));
}
var _local5 = null;
var _local6 = "";
if ((clip_.timedTextUrl != undefined) && ((clip_.timedTextUrl != null) && (clip_.timedTextUrl != ""))) {
_local5 = clip_.timedTextUrl;
} else {
if (is_fullscreen && ((video_doc_id != undefined) && (video_doc_id != null))) {
_local6 = video_doc_id;
} else {
_local6 = mediaState_.docid;
}
if ((_local6 != "") && (!_global.isNaN(_global.parseInt(_local6)))) {
_local5 = (vgcHostPort + VGC_SCRIPTFEED_PATH) + _local6;
if (com.google.utils.SecurityUtils.isSafeUrl(clip_.messagesUrl)) {
_local5 = (com.google.webutil.url.Utils.getProtocolHostAndPort(clip_.messagesUrl) + VGC_SCRIPTFEED_PATH) + _local6;
}
if ((clip_.hl != null) && (clip_.hl != "")) {
_local5 = _local5 + ("&hl=" + clip_.hl);
}
}
}
if (_local5 == null) {
subtitleControl_.subtitleEnabled = false;
} else {
var _local7 = null;
if (is_fullscreen) {
_local7 = (sub_on ? (com.google.video.subtitle.SubtitleControl.MODE_ON) : (com.google.video.subtitle.SubtitleControl.MODE_OFF));
} else if (clip_.subtitle == "on") {
_local7 = com.google.video.subtitle.SubtitleControl.MODE_ON;
} else if (clip_.subtitle == "off") {
_local7 = com.google.video.subtitle.SubtitleControl.MODE_OFF;
}
if (_local5 != subtitleControl_.url) {
subtitleControl_.initSubtitle(_local6, _local5, _local7);
}
}
if ((mediaState_.docid == undefined) || (mediaState_.docid == null)) {
subtitleControl_.pause();
return(undefined);
}
if (subtitleControl_.paused) {
subtitleControl_.resume();
return(undefined);
}
}
function setVideoUrl(url) {
videoUrl_ = url;
var _local3 = Number(com.google.webutil.url.Utils.getUrlParameter(url, "begin"));
var _local4 = Number(com.google.webutil.url.Utils.getUrlParameter(url, "len"));
if ((!_global.isNaN(_local3)) && (!_global.isNaN(_local4))) {
mediaPlayer_.clipStart = _local3 / 1000;
mediaPlayer_.clipEnd = (_local3 + _local4) / 1000;
} else {
mediaPlayer_.clipStart = 0;
mediaPlayer_.clipEnd = 0;
}
loadVideoUrl();
}
function loadVideoUrl() {
mediaPlayer_.url = videoUrl_;
}
function seekTimeWatcher(property, oldVal, newVal, thisObject) {
thisObject.mediaPlayer.seek(newVal);
lastSeekTime_ = newVal;
return(undefined);
}
function doPlayWatcher(property, oldVal, newVal, thisObject) {
thisObject.mediaPlayer.play();
return(undefined);
}
function doPauseWatcher(property, oldVal, newVal, thisObject) {
thisObject.mediaPlayer.pause();
return(undefined);
}
function checkForPageChanges() {
if (clip_.newVideoUrl != undefined) {
mediaPlayer_.mediaType = com.google.ui.media.MediaPlayer.MEDIA_VIDEO;
setVideoUrl(clip_.newVideoUrl);
mediaPlayer_.loadMedia(true);
mediaPlayer_.hideMessage();
clip_.newVideoUrl = undefined;
}
if (clip_.newPlayerMode != undefined) {
mediaPlayer_.playerMode = clip_.newPlayerMode;
clip_.newPlayerMode = undefined;
}
if (urlQueue_ != undefined) {
var _local2 = urlQueue_.shift();
if (_local2 != undefined) {
callHostPage(_local2.command, _local2.args);
}
}
if (mediaState_.clickUrlData != undefined) {
mediaPlayer_.useHandCursor = false;
var _local3 = 0;
for ( ; _local3 < mediaState_.clickUrlData.length ; _local3++) {
if ((mediaPlayer_.time >= mediaState_.clickUrlData[_local3].start) && (mediaPlayer_.time < mediaState_.clickUrlData[_local3].end)) {
mediaPlayer_.useHandCursor = true;
}
}
}
}
function queueURL(command, args) {
if (urlQueue_ == undefined) {
urlQueue_ = new Array();
}
urlQueue_.push({command:command, args:args});
}
function callHostPage(command, args) {
if ((System.capabilities.playerType == "ActiveX") && ((command != null) && (clip_.avoidgeturl))) {
fscommand (command, args);
} else if (command == null) {
getURL (args, "_self");
} else {
getURL ((((("javascript:if(typeof(FlashRequest)=='function')" + "{ FlashRequest('") + command) + "', '") + args) + "'); }", "_self");
}
}
function copyState(src, dest) {
dest.url = src.url;
dest.time = src.time;
dest.playing = src.playing;
dest.volume = src.volume;
dest.smoothing = src.smoothing;
dest.sizeMode = src.sizeMode;
dest.restartOnPlay = src.restartOnPlay;
}
function onSubtitleUpdate(evt) {
if (clip_.avoidgeturl) {
queueURL("subtitleUpdate", (evt.subtitleEnabled + ", ") + evt.subtitleOn);
} else {
getURL ((((("javascript:if(typeof(DoFSCommand)==\"function\")" + "{DoFSCommand(\"subtitleUpdate\",\"") + evt.subtitleEnabled) + ",") + evt.subtitleOn) + "\");}", "_self");
}
}
function onFullscreenConnectionEstablished() {
copyState(mediaPlayer_, fullscreenStatus_);
fullscreenStatus_.wasConnected = true;
if (subtitleControl_ != null) {
fullscreenStatus_.subtitleDocid = subtitleControl_.docid;
fullscreenStatus_.subtitleOn = subtitleControl_.subtitleOn;
}
fullscreenConnection_.send("setState", fullscreenStatus_);
mediaPlayer_.pause();
mediaPlayer_.stopDownload();
mediaPlayer_.url = "";
mediaPlayer_.showMessage(MESSAGE_PLAYING_FULLSCREEN);
}
function onFullscreenConnectionClosed() {
if (fullscreenStatus_.wasConnected) {
setVideoUrl(fullscreenStatus_.url);
mediaPlayer_.volume = fullscreenStatus_.volume;
mediaPlayer_.smoothing = fullscreenStatus_.smoothing;
mediaPlayer_.sizeMode = fullscreenStatus_.sizeMode;
mediaPlayer_.restartOnPlay = fullscreenStatus_.restartOnPlay;
mediaPlayer_.resumeTime = fullscreenStatus_.time;
mediaPlayer_.loadMedia(fullscreenStatus_.playing);
if (subtitleControl_ != null) {
subtitleControl_.subtitleOn = fullscreenStatus_.subtitleOn;
}
fullscreenStatus_.wasConnected = false;
mediaPlayer_.hideMessage();
}
}
function onFullscreenStatusUpdate(args) {
copyState(args, fullscreenStatus_);
fullscreenStatus_.subtitleOn = args.subtitleOn;
if (args.closing) {
}
}
function initializeFullscreenConnection() {
fullscreenConnection_.addEventListener("connected", com.google.utils.DelegateEx.create(this, onFullscreenConnectionEstablished));
fullscreenConnection_.addEventListener("closed", com.google.utils.DelegateEx.create(this, onFullscreenConnectionClosed));
fullscreenConnection_.setHandler("statusUpdate", com.google.utils.DelegateEx.create(this, onFullscreenStatusUpdate));
}
function onFullscreenSetState(args) {
setVideoUrl(args.url);
mediaPlayer_.volume = args.volume;
mediaPlayer_.smoothing = args.smoothing;
mediaPlayer_.sizeMode = args.sizeMode;
mediaPlayer_.restartOnPlay = args.restartOnPlay;
mediaPlayer_.resumeTime = args.time;
mediaPlayer_.loadMedia(args.playing);
if (args.subtitleDocid != null) {
initSubtitle(true, args.subtitleDocid, args.subtitleOn);
HandleResize();
}
}
function initializeFullscreenConnection2() {
fullscreenConnection_.setHandler("setState", com.google.utils.DelegateEx.create(this, onFullscreenSetState));
}
function HandleResize() {
super.HandleResize();
if ((playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_SIMPLE) || (playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_SYNDICATED)) {
metadataCard_.setSize(width_, height_);
metadataBar_.setSize(width_, height_);
controlBar_.setSize(width_, height_);
playPauseButton_._x = 8 + 4;
playPauseButton_._y = (height_ - 16) - 32;
}
}
function onPlaybackComplete() {
if ((playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_NORMAL) || (playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_MINI)) {
queueURL("donePlaying", _global.escape(mediaPlayer_.url));
}
var _local2 = false;
if (mediaRss_ != undefined) {
if ((playlists_.curIndex == (playlistSize_ - 1)) && (!clip_.loop)) {
resetRssFeed();
} else {
incMediaRssIndex((playlistNext_ ? 1 : -1), false);
_local2 = true;
}
playMediaRssItem();
}
if (eovMessage_ != undefined) {
mediaPlayer_.showMessage(eovMessage_);
} else if (shareLayerEnabled_ && ((!_local2) && (mediaState_.docid != undefined))) {
mediaPlayer_.showShareLayer(mediaState_.docid, sendLinkButtonEnabled_, embedButtonEnabled_);
}
}
function onClickVideo() {
if ((playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_NORMAL) || (playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_MINI)) {
queueURL("clickVideo", ((_global.escape(mediaPlayer_.url) + ",\"") + mediaPlayer_.time) + "\"");
} else if ((playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_SYNDICATED) || (playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_SIMPLE)) {
mediaPlayer_.toggle();
}
if (mediaState_.clickUrlData != undefined) {
var _local2 = 0;
for ( ; _local2 < mediaState_.clickUrlData.length ; _local2++) {
if ((mediaPlayer_.time >= mediaState_.clickUrlData[_local2].start) && (mediaPlayer_.time < mediaState_.clickUrlData[_local2].end)) {
queueURL(null, mediaState_.clickUrlData[_local2].url);
}
}
}
}
function onDoubleClickVideo() {
onFullscreen();
}
function onShareClick() {
var _local2 = new Object();
_local2.SendLinkButton = "1";
_local2.DocID = clip_.docid;
eventReporter_.send(_local2);
}
function onBlogClick() {
var _local2 = "";
if ((clip_.hl != undefined) && (clip_.hl != "en")) {
_local2 = "&hl=" + clip_.hl;
}
var _local3 = (VGC_BLOG_URL_BASE_PATH + mediaState_.docid) + VGC_BLOG_URL_SUFFIX;
if (vgcHostPort == VGC_URL) {
_local3 = (VGC_SECURED_BLOGPOST_HOST + _local3) + _local2;
} else {
_local3 = (vgcHostPort + _local3) + _local2;
}
getURL (_local3, " _self");
}
function onReplayClick() {
mediaPlayer_.hideShareLayer();
mediaPlayer.play();
var _local2 = new Object();
_local2.ReplayButton = "1";
_local2.DocID = clip_.docid;
eventReporter_.send(_local2);
}
function startFullscreen() {
if (isNativeFlashFullScreen()) {
if (mediaPlayer_.isFlashFullScreen()) {
return(undefined);
}
setFlashFullScreen(true);
mediaPlayer_.setControlBarFullscreen();
return(undefined);
}
if (mediaPlayer_.playerMode == com.google.ui.media.MediaPlayer.PLAYER_MODE_NORMAL) {
if (fullscreenConnection_.state == com.google.comm.NamedConnection.STATE_CONNECTED) {
return(undefined);
}
fullscreenConnection_.open(fullscreenConnectionId_);
queueURL("goFullscreen", (((((((((("\"" + mediaPlayer_.url) + "\", \"") + mediaState_.docid) + "\", \"") + fullscreenConnectionId_) + "\", ") + mediaPlayer_.time) + ", true, ") + "\"") + mediaPlayer_.hlval) + "\"");
}
}
function killFullscreen() {
if (mediaPlayer_.playerMode == com.google.ui.media.MediaPlayer.PLAYER_MODE_FULLSCREEN) {
updateFullscreenStatus(false);
mediaPlayer_.pause();
queueURL("goFullscreen", (((((((((("\"" + mediaPlayer_.url) + "\", \"") + mediaState_.docid) + "\", \"") + fullscreenConnectionId_) + "\", ") + mediaPlayer_.time) + ", false, \"") + "\"") + mediaPlayer_.hlval) + "\"");
}
}
function onFullscreen() {
if (isNativeFlashFullScreen()) {
setFlashFullScreen((mediaPlayer_.isFlashFullScreen() ? false : true));
return(undefined);
}
if (mediaPlayer_.playerMode == com.google.ui.media.MediaPlayer.PLAYER_MODE_NORMAL) {
startFullscreen();
} else if (mediaPlayer_.playerMode == com.google.ui.media.MediaPlayer.PLAYER_MODE_FULLSCREEN) {
updateFullscreenStatus(true);
_global.setInterval(this, "killFullscreen", 100);
}
}
function setFlashFullScreen(fullOrNot) {
if (fullOrNot) {
mediaPlayer_.orgSizeMode = mediaPlayer_.sizeMode;
mediaPlayer_.sizeMode = com.google.ui.media.MediaPlayer.SIZE_FIT;
Stage.displayState = "fullScreen";
} else {
Stage.displayState = (fullOrNot ? "fullScreen" : "normal");
}
}
function onMessagesParsed(evtObj) {
if (!evtObj.success) {
return(undefined);
}
if (messages_.messages_.NotAvailableTryLater != null) {
ERROR_NO_VIDEO = messages_.messages_.NotAvailableTryLater;
}
if (messages_.messages_.VideoPlayingInFullScreen != null) {
MESSAGE_PLAYING_FULLSCREEN = messages_.messages_.VideoPlayingInFullScreen;
}
if (messages_.messages_.Buffering != null) {
mediaPlayer_.setBufferingMessageText(messages_.messages_.Buffering);
}
mediaPlayer_.initializePopupMenuText(messages_.messages_);
mediaPlayer_.controlBar.initializeSubtitleLocalization(messages_);
mediaPlayer_.controlBar.initializeMarkerLocalization(messages_);
mediaPlayer_.shareLayer.initializeShareLocalization(messages_);
}
function onContentAdParsed(evtObj) {
if (!evtObj.success) {
return(undefined);
}
}
function onPlayPauseClicked(evtObj) {
mediaPlayer_.toggle();
}
function onMouseOverVideo(evtObj) {
playPauseButton_.mouseOverVideo = true;
}
function onMouseOutVideo(evtObj) {
playPauseButton_.mouseOverVideo = false;
}
function onPrevItem(evtObj) {
if ((playlists_.curIndex == 0) && (!clip_.loop)) {
return(undefined);
}
incMediaRssIndex(-1, false);
playMediaRssItem();
}
function onNextItem(evtObj) {
if ((playlists_.curIndex == (playlists_.allItems.length - 1)) && (!clip_.loop)) {
return(undefined);
}
incMediaRssIndex(1, false);
playMediaRssItem();
}
function onRssParsed(evtObj) {
if (!evtObj.success) {
return(undefined);
}
playlistNext_ = true;
playlists_.loadFromMediaRssData(mediaRss_.channelData_);
playlistSize_ = playlists_.allItems.length;
if ((playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_SYNDICATED) || (playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_SIMPLE)) {
resetRssFeed();
} else {
playlists_.curIndex = 0;
prevMediaRssIndex_ = 0;
}
playMediaRssItem();
}
function resetRssFeed() {
prevMediaRssIndex_ = -1;
playlists_.curIndex = -1;
playlistStarted_ = false;
playlists_.loadFromMediaRssData(mediaRss_.channelData_);
if (playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_SYNDICATED) {
var _local2 = com.google.video.ui.SyndicatedControlBar(controlBar_);
_local2.loadFromPlaylists(playlists_);
}
}
function incMediaRssIndex(inc, now) {
var _local4 = playlists_.allItems.length;
playlists_.curIndex = ((playlists_.curIndex + _local4) + inc) % _local4;
if (playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_SIMPLE) {
var _local5 = com.google.video.ui.SimpleControlBar(controlBar_);
_local5.playlistPosition = playlists_.curIndex + 1;
}
playlistNext_ = inc > 0;
if (now) {
updateMediaRSSIndex();
} else {
_global.clearInterval(updateRSSIndexTimer_);
updateRSSIndexTimer_ = _global.setInterval(this, "updateMediaRSSIndex", MRSS_SAMPLING_FREQ);
}
}
function playMediaRssItem() {
_global.clearInterval(playlistTimer_);
if (prevMediaRssIndex_ != playlists_.curIndex) {
playlistTimer_ = _global.setInterval(this, "playMediaRssItem", 500);
return(undefined);
}
var _local2;
if ((playlists_.curIndex == -1) && (((playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_SYNDICATED) || (playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_SIMPLE)) && (!clip_.autoplay))) {
_local2 = mediaRss_.channelData_.image.url;
mediaPlayer_.loadThumbnail(_local2);
}
if ((!playlistStarted_) && (clip_.autoplay != true)) {
playlistStarted_ = true;
} else {
clip_.autoplay = true;
}
if (playlists_.curIndex == -1) {
playlists_.curIndex = 0;
}
if (playlistMediaStates_ == undefined) {
playlistMediaStates_ = new Array();
}
if (playlistMediaStates_[playlists_.curIndex] == undefined) {
var _local3 = new com.google.video.apps.MediaState();
_local3.fromMediaRssItem(clip_, playlists_.curItem, playlists_.curIndex == 0);
playlistMediaStates_[playlists_.curIndex] = _local3;
}
mediaState_ = playlistMediaStates_[playlists_.curIndex];
if ((_local2 != undefined) && (playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_SYNDICATED)) {
mediaState_.thumbnailUrl = _local2;
}
docidPosition_ = playlists_.curIndex;
if ((playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_SYNDICATED) || (playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_SIMPLE)) {
updateSyndicatedUI();
}
initPlayerWithVars();
_global.clearInterval(updateRSSIndexTimer_);
}
function updateSyndicatedUI() {
var _local2 = playlists_.curItem;
var _local3 = _local2.title;
var _local4 = _local2.author;
var _local5 = _local2["gm:visible_url"];
if (mediaState_.isAd) {
metadataBar_.setLeft("Advertisement");
} else {
metadataBar_.setLeft("");
}
if (_local5 != undefined) {
var _local6 = _local2["gm:click_url"];
if ((_local6 == undefined) && (com.google.utils.SecurityUtils.isSafeUrl(_local5))) {
_local6 = _local5;
}
if (redirectUrl_ != undefined) {
var _local7 = {url:_global.escape(_local6), ad:(mediaState_.isAd ? 1 : 0), docid:mediaState_.docid, docidpos:docidPosition_};
for (var key in mediaState_.guidParams) {
_local7[key] = mediaState_.guidParams[key];
}
_local6 = redirectUrl_.makeUrl(_local7);
}
metadataBar_.setRight(_local5, _local6);
} else {
metadataBar_.setRight("", "");
}
metadataCard_.title = _local3;
metadataCard_.provider = ((_local4 == undefined) ? "" : (_local4));
if (playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_SIMPLE) {
var _local8 = com.google.video.ui.SimpleControlBar(controlBar_);
_local8.linkDestination = mediaState_.playPage;
_local8.playlistSize = playlists_.allItems.length;
_local8.playlistPosition = playlists_.curIndex + 1;
}
}
function onPlayerStateChange(evtObj) {
if ((mediaState_.docid != undefined) && (!videoStats_.playbackStarted)) {
videoStats_.startPlayback(mediaState_.docid, "1");
}
if ((playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_SYNDICATED) || (playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_SIMPLE)) {
metadataBar_.showMetadata = true;
metadataBar_.showLeft = evtObj.newState != com.google.ui.media.MediaPlayer.STATE_BUFFERING;
bufferingWidget_.buffering = evtObj.newState == com.google.ui.media.MediaPlayer.STATE_BUFFERING;
if ((width_ < 300) || (playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_SYNDICATED)) {
metadataCard_.showMetadata = false;
} else {
metadataCard_.showMetadata = (evtObj.newState != com.google.ui.media.MediaPlayer.STATE_PLAYING) && ((evtObj.newState != com.google.ui.media.MediaPlayer.STATE_COMPLETED) && (!mediaState_.isAd));
}
playPauseButton_.showPlay = (evtObj.newState != com.google.ui.media.MediaPlayer.STATE_PLAYING) && (evtObj.newState != com.google.ui.media.MediaPlayer.STATE_BUFFERING);
if (playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_SYNDICATED) {
playPauseButton_._visible = false;
}
if (evtObj.newState == "error") {
incMediaRssIndex((playlistNext_ ? 1 : -1), false);
playMediaRssItem();
}
if ((evtObj.oldState == com.google.ui.media.MediaPlayer.STATE_PAUSED) && (evtObj.newState == com.google.ui.media.MediaPlayer.STATE_BUFFERING)) {
if (mediaState_.isAd && (!adImpressionStats_[docidPosition_])) {
var _local3 = playlists_.curItem;
adImpressionStats_[docidPosition_] = true;
contentadSynd_.init(((((clip_.adserver + "/cpa/ads?client=") + clip_.videopubid) + "&cpa_choice=") + _local3["gm:cpa_choice"]) + "&output=xml");
contentadSynd_.fetch();
}
}
}
if ((playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_NORMAL) || (playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_MINI)) {
queueURL("stateChanged", ((((("\"" + evtObj.oldState) + "\", \"") + evtObj.newState) + "\", \"") + mediaPlayer_.time) + "\"");
}
}
function onBeginScrub(evtObj) {
if ((playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_NORMAL) || (playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_MINI)) {
queueURL("beginScrub", ("\"" + evtObj.seekPos) + "\"");
}
}
function onEndScrub(evtObj) {
if ((playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_NORMAL) || (playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_MINI)) {
queueURL("endScrub", ("\"" + evtObj.seekPos) + "\"");
}
}
function onSizeModeChange(evtObj) {
if ((playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_NORMAL) || (playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_MINI)) {
queueURL("sizeModeChange", ("\"" + evtObj.sizeMode) + "\"");
}
}
function onKeyDown(evtObj) {
if ((mediaPlayer_.playerMode == com.google.ui.media.MediaPlayer.PLAYER_MODE_MINI) || (mediaPlayer_.playerMode == com.google.ui.media.MediaPlayer.PLAYER_MODE_SYNDICATED)) {
return(undefined);
}
if (mediaPlayer_.shareLayerVisible) {
return(undefined);
}
switch (Key.getCode()) {
case Key.LEFT :
mediaPlayer_.skipBackward();
break;
case Key.RIGHT :
mediaPlayer_.skipForward();
break;
case Key.SPACE :
mediaPlayer_.toggle();
break;
case Key.UP :
mediaPlayer_.volumeUp();
break;
case Key.DOWN :
mediaPlayer_.volumeDown();
break;
case 77 :
mediaPlayer_.toggleMute();
break;
case 70 :
if (ENABLE_FULLSCREEN) {
onFullscreen();
}
break;
case 67 :
if (!((subtitleControl_ != null) && (subtitleControl_.subtitleEnabled))) {
break;
}
subtitleControl_.switchSubtitleOnOff();
}
}
function onKeyUp() {
if (mediaPlayer_.playerMode == com.google.ui.media.MediaPlayer.PLAYER_MODE_MINI) {
return(undefined);
}
if (!(Key.getCode() === Key.ESCAPE)) {
} else {
killFullscreen();
}
}
function updateFullscreenStatus(closing) {
var _local3 = new Object();
copyState(mediaPlayer_, _local3);
_local3.closing = closing;
if (subtitleControl_ != null) {
_local3.subtitleOn = subtitleControl_.subtitleOn;
} else {
_local3.subtitleOn = false;
}
fullscreenConnection_.send("statusUpdate", _local3);
}
function requestHostLocation() {
clip_.watch("hostcheck", com.google.utils.DelegateEx.create(this, onHostCheckResult));
fscommand ("hostcheck", "document.referrer");
}
function onHostCheckResult(prop, oldValue, newValue) {
if (prop == "hostcheck") {
verifiedhost_ = newValue;
if (clip_.pubhost != verifiedhost_) {
eventReporter_.send({pubhost:_global.escape(clip_.pubhost), verifiedhost:_global.escape(verifiedhost_)});
}
clip_.unwatch("hostcheck");
}
}
function onReportStatsEvent(e) {
if ((playerMode_ == com.google.ui.media.MediaPlayer.PLAYER_MODE_SYNDICATED) && ((e.type == "reportEvent") && (e.stats.reportevent == ADCLICK_REPORT_TIME))) {
if ((!adConversionStats_[docidPosition_]) && ((contentadSynd_.xmlUrl_ != "") && (mediaState_.isAd))) {
adeventReporter_.sendUrl(contentadSynd_.messages_[contentadSynd_.PLAYCONFURL]);
adConversionStats_[docidPosition_] = true;
}
}
eventReporter_.send(e.stats);
}
function getPlayPage(docid) {
return((((vgcHostPort + VGC_PLAYPAGE_PATH) + docid) + "&hl=") + clip_.hl);
}
function get docid() {
return(mediaState_.docid);
}
function get docidPosition() {
return(docidPosition_);
}
function get isAd() {
return((mediaState_.isAd ? 1 : 0));
}
function get docidDuration() {
if (mediaPlayer_.duration > 0) {
return(mediaPlayer_.duration);
}
return(mediaState_.duration);
}
function get reportParams() {
return(mediaState_.guidParams);
}
function get controlBar() {
return(controlBar_);
}
function get playlistSize() {
return(playlistSize_);
}
function get inLoopMode() {
return(clip_.loop);
}
var MESSAGE_PLAYING_FULLSCREEN = "Video is playing in fullscreen window.";
static var ENABLE_FULLSCREEN = true;
static var VGC_URL = "http://video.google.com";
static var VGC_SECURED_BLOGPOST_HOST = "https://www.google.com";
static var VGC_VIDEOFEED_PATH = "/videofeed?fgvns=1&fai=1&docid=";
static var VGC_PLAYPAGE_PATH = "/videoplay?docid=";
static var VGC_SCRIPTFEED_PATH = "/videotranscript?frame=c&docid=";
static var VGC_FLASHUI_PATH = "/FlashUiStrings.xlb?frame=flashstrings&hl=";
static var VGC_REDIRECTURL_PATH = "/videoredirect";
static var VGC_BLOG_URL_BASE_PATH = "/video/blogpost?fp=1&docid=";
static var VGC_BLOG_URL_SUFFIX = "&siteindex=0";
static var VGC_VIDEOSYNDFEED_PATH = "/video/s/videosyndfeed?";
static var ADCLICK_REPORT_TIME = "3000";
static var MRSS_SAMPLING_FREQ = 1000;
var videoUrl_ = "";
var lastSeekTime_ = 0;
var shareLayerEnabled_ = false;
var embedButtonEnabled_ = false;
var sendLinkButtonEnabled_ = false;
var subtitleControl_ = null;
}
Symbol 20576 MovieClip [__Packages.com.google.video.apps.BloggerPlayback] Frame 0
class com.google.video.apps.BloggerPlayback extends com.google.video.apps.VideoPlayback
{
function BloggerPlayback () {
super();
}
static function main(clip) {
com.google.video.apps.BaseVideoPlayback.app = new com.google.video.apps.VideoPlayback(clip);
com.google.video.apps.BaseVideoPlayback.app.run();
}
}
Symbol 20577 MovieClip [__Packages.com.google.ui.media.ScrubControl] Frame 0
class com.google.ui.media.ScrubControl extends com.google.ui.common.UIComponent
{
var log_, boundingBox_mc, timelineLeft_, attachMovie, getNextHighestDepth, timelineMiddle_, timelineRight_, timelineFill_, createEmptyMovieClip, timelineSlider_, __height, __width, _xmouse, dispatchEvent, onMouseMove, onMouseUp;
function ScrubControl () {
super();
}
function init() {
log_ = new com.google.logs.Logger("Scrub");
mx.events.EventDispatcher.initialize(this);
log_.log(5, "ScrubControl::init");
super.init();
boundingBox_mc._visible = false;
boundingBox_mc._width = 0;
boundingBox_mc._height = 0;
}
function createChildren() {
timelineLeft_ = attachMovie("time_left", "timelineLeft", getNextHighestDepth());
timelineMiddle_ = attachMovie("time_mid", "timelineMiddle", getNextHighestDepth());
timelineRight_ = attachMovie("time_right", "timelineRight", getNextHighestDepth());
timelineFill_ = createEmptyMovieClip("timelineFill", getNextHighestDepth());
timelineFill_.beginFill(3355443, 20);
com.google.ui.common.Drawing.drawRectangle(timelineFill_, 0, 0, 127, 5, 0);
timelineSlider_ = attachMovie(timelineSliderGraphic, "timelineSlider", getNextHighestDepth());
var _local2 = com.google.utils.DelegateEx.create(this, onPressForScrub);
timelineLeft_.onPress = _local2;
timelineMiddle_.onPress = _local2;
timelineRight_.onPress = _local2;
timelineFill_.onPress = _local2;
timelineSlider_.onPress = _local2;
size();
}
function size() {
log_.log(10, (((("ScrubControl::size - this = " + this) + " to ") + __width) + "x") + __height);
__height = timelineSlider_._height + BOTTOM_GAP;
var _local2 = __height - timelineMiddle_._height;
timelineLeft_._x = 0 + (timelineSlider_._width / 2);
timelineLeft_._y = _local2;
timelineRight_._x = (__width - timelineRight_._width) - (timelineSlider_._width / 2);
timelineRight_._y = _local2;
timelineMiddle_._x = timelineLeft_._x + timelineLeft_._width;
timelineMiddle_._y = _local2;
timelineMiddle_._width = timelineRight_._x - timelineMiddle_._x;
timelineFill_._y = timelineMiddle_._y;
timelineFill_._height = timelineMiddle_._height;
timelineFill_._x = timelineMiddle_._x + (bufferStart_ * timelineMiddle_._width);
timelineFill_._width = (bufferEnd_ - bufferStart_) * timelineMiddle_._width;
log_.log(10, (((((("Set timeline fill to " + timelineFill_._x) + ",") + timelineFill_._y) + " ") + timelineFill_._width) + "x") + timelineFill_._height);
timelineSlider_._y = 0;
for (var id in markers_) {
adjustMarkerPosition(markers_[id]);
}
repositionPlayMarker();
}
function calculateMarkerPosition(percent, width) {
return(timelineMiddle_._x + (percent * (timelineMiddle_._width - width)));
}
function adjustMarkerPosition(marker) {
marker._x = calculateMarkerPosition(marker.markerPos, marker.markerWidth);
marker._y = timelineMiddle_._y + BOTTOM_GAP;
}
function calculatePosition(markerPercent, markerWidth) {
var _local4 = timelineLeft_._width;
var _local5 = timelineMiddle_._width;
log_.log(10, (("rangeStart = " + _local4) + " & rangeWidth = ") + _local5);
var _local6 = _local4 + (markerPercent * _local5);
log_.log(9, (((((("calcPos: " + markerPercent) + " between ") + _local4) + " and ") + (_local4 + _local5)) + " = ") + _local6);
return(_local6);
}
function repositionPlayMarker() {
timelineSlider_._x = calculatePosition(playProgress_, timelineSlider_._width);
}
function percentageFromPosition(pos) {
var _local3 = timelineMiddle_._x;
var _local4 = timelineMiddle_._width;
var _local5 = (pos - _local3) / _local4;
_local5 = Math.max(0, _local5);
_local5 = Math.min(1, _local5);
return(_local5);
}
function scrubMove() {
log_.log(10, (("ScrubControl::scrubMove - this = " + this) + " scrubbing_ = ") + scrubbing_);
if (scrubbing_) {
log_.log(7, "ScrubControl::scrubMove");
var _local2 = _xmouse - scrubOffset_;
var _local3 = percentageFromPosition(_local2);
log_.log(7, (("Mouse at " + _local2) + " => ") + _local3);
var _local4 = new Object();
_local4.type = "scrub";
_local4.target = this;
_local4.value = _local3;
playProgress_ = _local3;
dispatchEvent(_local4);
repositionPlayMarker();
}
}
function scrubUp() {
log_.log(10, (("ScrubControl::scrubUp - this = " + this) + " scrubbing_ = ") + scrubbing_);
if (scrubbing_) {
var _local2 = _xmouse - scrubOffset_;
var _local3 = percentageFromPosition(_local2);
log_.log(6, "ScrubControl::scrubUp");
log_.log(6, (("Mouse at " + _local2) + " => ") + _local3);
delete onMouseMove;
delete onMouseUp;
scrubbing_ = false;
var _local4 = new Object();
_local4.type = "endScrub";
_local4.target = this;
_local4.value = _local3;
dispatchEvent(_local4);
}
}
function onPressForScrub() {
log_.log(6, (("ScrubControl::onPressForScrub - this = " + this) + " scrubbing_ = ") + scrubbing_);
if ((timelineSlider_._xmouse >= 0) && ((timelineSlider_._xmouse < timelineSlider_._width) && ((timelineSlider_._ymouse >= 0) && (timelineSlider_._ymouse < timelineSlider_._height)))) {
scrubOffset_ = timelineSlider_._xmouse - (timelineSlider_._width / 2);
log_.log(7, "Clicked inside slider, offset of " + scrubOffset_);
} else {
scrubOffset_ = 0;
log_.log(7, "Clicked outside slider, offset of " + scrubOffset_);
}
var _local2 = _xmouse - scrubOffset_;
var _local3 = percentageFromPosition(_local2);
log_.log(6, ((((((("Mouse at " + _xmouse) + "(") + scrubOffset_) + ") => ") + _local2) + " => ") + _local3) + "%");
scrubbing_ = true;
onMouseMove = com.google.utils.DelegateEx.create(this, scrubMove);
onMouseUp = com.google.utils.DelegateEx.create(this, scrubUp);
var _local4 = new Object();
_local4.type = "beginScrub";
_local4.target = this;
_local4.value = _local3;
dispatchEvent(_local4);
scrubMove();
}
function setMarkers(markers) {
clearMarkers();
if (markers != undefined) {
var _local3 = 0;
for ( ; _local3 < markers.length ; _local3++) {
addMarker(markers[_local3]);
}
}
}
function addMarker(marker) {
index_++;
var _local3 = "m" + String(index_);
var _local4 = createEmptyMovieClip(_local3, getNextHighestDepth());
_local4.lineStyle(0, marker.color, 100);
_local4.beginFill(marker.color, 100);
com.google.ui.common.Drawing.drawRectangle(_local4, 0, 0, marker.width, timelineMiddle_._height - (BOTTOM_GAP * 2), 1);
_local4.endFill();
_local4.markerPos = marker.pos;
_local4.markerWidth = marker.width;
_local4.onPress = com.google.utils.DelegateEx.create(this, onPressForScrub);
if (_local4.getDepth() > timelineSlider_.getDepth()) {
timelineSlider_.swapDepths(_local4.getDepth());
}
com.google.ui.common.ToolTips.registerEventHandlers(_local4, ((marker.tooltip == undefined) ? (markerToolTipText_) : (marker.tooltip)), 0.8, 5, true);
markers_[_local3] = _local4;
adjustMarkerPosition(_local4);
return(_local3);
}
function removeMarker(id) {
if (markers_[id] != undefined) {
markers_[id].removeMovieClip();
delete markers_[id];
}
}
function clearMarkers() {
for (var id in markers_) {
markers_[id].removeMovieClip();
}
markers_ = new Object();
}
function set timelineSliderGraphic(val) {
log_.log(9, "ScrubControl::timelineSliderGraphic setter = " + val);
timelineSliderGraphic_ = val;
if (timelineSlider_ != undefined) {
timelineSlider_.removeMovieClip();
}
timelineSlider_ = attachMovie(val, "timelineSlider", getNextHighestDepth());
size();
//return(timelineSliderGraphic);
}
function get timelineSliderGraphic() {
return(timelineSliderGraphic_);
}
function set bufferStart(val) {
if (_global.isNaN(val) || (!((val >= 0) && (val <= 1)))) {
val = Math.min(val, 1);
val = Math.max(val, 0);
}
if (bufferStart_ == val) {
return;
}
bufferStart_ = val;
size();
//return(bufferStart);
}
function get bufferStart() {
return(bufferStart_);
}
function set bufferEnd(val) {
if (_global.isNaN(val) || (!((val >= 0) && (val <= 1)))) {
val = Math.min(val, 1);
val = Math.max(val, 0);
}
if (bufferEnd_ == val) {
return;
}
bufferEnd_ = val;
size();
//return(bufferEnd);
}
function get bufferEnd() {
return(bufferEnd_);
}
function set playProgress(val) {
if (_global.isNaN(val) || (!((val >= 0) && (val <= 1)))) {
val = Math.min(val, 1);
val = Math.max(val, 0);
}
if (val == playProgress_) {
return;
}
playProgress_ = val;
repositionPlayMarker();
//return(playProgress);
}
function get playProgress() {
return(playProgress_);
}
function get trackLeft() {
return(timelineLeft_._x);
}
function get trackRight() {
log_.log(20, (("tr._x = " + timelineRight_._x) + "tr._w = ") + timelineRight_._width);
return(timelineRight_._x + timelineRight_._width);
}
function initializeMarkerLocalization(xlb) {
if (xlb.messages_[MARKER_TOOLTIP_XLB_KEY]) {
markerToolTipText_ = xlb.messages_[MARKER_TOOLTIP_XLB_KEY];
for (var i in markers_) {
com.google.ui.common.ToolTips.registerMessage(markers_[i], markerToolTipText_);
}
}
}
static var classPath = com.google.ui.media.ScrubControl;
static var linkageName = "__Packages.com.google.ui.media.ScrubControl";
static var forceLinkage = Object.registerClass(linkageName, classPath);
var bufferStart_ = 0;
var bufferEnd_ = 0;
var playProgress_ = 0;
var scrubOffset_ = 0;
var scrubbing_ = false;
var markers_ = new Object();
var timelineSliderGraphic_ = "time_slider";
var BOTTOM_GAP = 2;
static var MARKER_TOOLTIP_XLB_KEY = "Advertisement";
var markerToolTipText_ = "Advertisement";
var index_ = 0;
}
Symbol 20578 MovieClip [__Packages.com.google.ui.media.ControlBar] Frame 0
class com.google.ui.media.ControlBar extends com.google.ui.common.UIComponent
{
var boundingBox_mc, useHandCursor, currentLayoutFn_, currentLayoutName_, soundControl_, controlBar_, attachMovie, getNextHighestDepth, playButton_, rewindButton_, fastForwardButton_, fullscreenButton_, menuButton_, menuButtonNoMenu_, scrubControl_, volumeControl_, createTextField, timeDisplay_, linkDisplay_, abgDisplay_, __width, __height, skyLogo_, dispatchEvent, __get__playing, muted_;
function ControlBar () {
super();
}
function init() {
mx.events.EventDispatcher.initialize(this);
super.init();
boundingBox_mc._visible = false;
boundingBox_mc._width = 0;
boundingBox_mc._height = 0;
useHandCursor = false;
currentLayoutFn_ = this[currentLayoutName_];
if (currentLayoutFn_ == undefined) {
currentLayoutFn_ = oneLineLayout;
currentLayoutName_ = "oneLineLayout";
}
soundControl_ = new Sound();
}
function createChildren() {
controlBar_ = attachMovie("controlbar_bg", "controlBar_", getNextHighestDepth());
playButton_ = attachMovie(com.google.ui.common.IconButton.linkageName, "playButton", getNextHighestDepth(), {_width:60, _height:BUTTON_HEIGHT, baseName:"btn", icon:"icon_play"});
rewindButton_ = attachMovie(com.google.ui.common.IconButton.linkageName, "rewindButton", getNextHighestDepth(), {_width:32, _height:BUTTON_HEIGHT, baseName:"btn", icon:"icon_rew"});
fastForwardButton_ = attachMovie(com.google.ui.common.IconButton.linkageName, "fastForwardButton", getNextHighestDepth(), {_width:32, _height:BUTTON_HEIGHT, baseName:"btn", icon:"icon_ff"});
fullscreenButton_ = attachMovie(com.google.ui.common.IconButton.linkageName, "fullscreenButton", getNextHighestDepth(), {_width:32, _height:BUTTON_HEIGHT, baseName:"btn", icon:"icon_max"});
menuButton_ = attachMovie(com.google.ui.common.IconButton.linkageName, "menuButton", getNextHighestDepth(), {_width:24, _height:BUTTON_HEIGHT, baseName:"btn", icon:"icon_menu"});
menuButtonNoMenu_ = attachMovie("google_video_logo_23px", "menuButtonNoMenu", getNextHighestDepth());
scrubControl_ = attachMovie(com.google.ui.media.ScrubControl.linkageName, "scrubControl", getNextHighestDepth());
volumeControl_ = attachMovie(com.google.ui.media.VolumeControl.linkageName, "volumeControl", getNextHighestDepth(), {value:1});
subtitleButton_ = attachMovie(com.google.ui.common.IconToggleButton.linkageName, "subtitleControl", getNextHighestDepth(), {_width:SUBTITLE_BUTTON_WIDTH, _height:BUTTON_HEIGHT, baseName:"btn", icon:SUBTITLE_ICON_NAME_NA_ON});
subtitleListButton_ = attachMovie(com.google.ui.common.IconToggleButton.linkageName, "subtitleList", getNextHighestDepth(), {_width:SUBTITLE_LIST_BUTTON_WIDTH, _height:BUTTON_HEIGHT, baseName:"btn", icon:"icon_menu_small", label:"*"});
subtitleButton_.setOpenHalfAndSpacingRatio(com.google.ui.common.IconHalfButton.OPEN_RIGHT, 0.8);
subtitleListButton_.setOpenHalfAndSpacingRatio(com.google.ui.common.IconHalfButton.OPEN_LEFT, 0.2);
subtitleListButton_.toggleOff();
createTextField("timeDisplay_", getNextHighestDepth(), 0, 0, 50, 20);
createTextField("linkDisplay_", getNextHighestDepth(), 0, 0, 140, 15);
createTextField("abgDisplay_", getNextHighestDepth(), 60, 0, 65, 15);
timeDisplay_.autoSize = "left";
timeDisplay_.selectable = false;
var _local2 = new TextFormat();
_local2.font = "Arial";
_local2.size = 10;
_local2.color = 8421504 /* 0x808080 */;
timeDisplay_.setNewTextFormat(_local2);
timeDisplay_.text = timeDisplayText_;
var _local3 = new TextFormat();
_local3.font = "Arial";
_local3.size = 9;
_local3.color = 1123037 /* 0x1122DD */;
_local3.bold = true;
_local3.align = "right";
linkDisplay_.html = true;
linkDisplay_.setNewTextFormat(_local3);
var _local4 = new TextFormat();
_local4.font = "Arial";
_local4.size = 9;
_local4.color = 9671571 /* 0x939393 */;
abgDisplay_.setNewTextFormat(_local4);
abgDisplay_.selectable = false;
abgDisplay_.text = "Ads by Google";
abgDisplay_._visible = false;
playButton_.addEventListener("press", com.google.utils.DelegateEx.create(this, onButtonPress, {command:"play"}));
rewindButton_.addEventListener("press", com.google.utils.DelegateEx.create(this, onButtonPress, {command:"rewind"}));
fastForwardButton_.addEventListener("press", com.google.utils.DelegateEx.create(this, onButtonPress, {command:"fastForward"}));
playButton_.addEventListener("hold", com.google.utils.DelegateEx.create(this, onButtonHold, {command:"play"}));
rewindButton_.addEventListener("hold", com.google.utils.DelegateEx.create(this, onButtonHold, {command:"rewind"}));
fastForwardButton_.addEventListener("hold", com.google.utils.DelegateEx.create(this, onButtonHold, {command:"fastForward"}));
playButton_.addEventListener("release", com.google.utils.DelegateEx.create(this, onButtonRelease, {command:"play"}));
rewindButton_.addEventListener("release", com.google.utils.DelegateEx.create(this, onButtonRelease, {command:"rewind"}));
fastForwardButton_.addEventListener("release", com.google.utils.DelegateEx.create(this, onButtonRelease, {command:"fastForward"}));
playButton_.addEventListener("releaseOutside", com.google.utils.DelegateEx.create(this, onButtonReleaseOutside, {command:"play"}));
rewindButton_.addEventListener("releaseOutside", com.google.utils.DelegateEx.create(this, onButtonReleaseOutside, {command:"rewind"}));
fastForwardButton_.addEventListener("releaseOutside", com.google.utils.DelegateEx.create(this, onButtonReleaseOutside, {command:"fastForward"}));
fullscreenButton_.addEventListener("press", com.google.utils.DelegateEx.create(this, onButtonPress, {command:"fullscreen"}));
fullscreenButton_.addEventListener("hold", com.google.utils.DelegateEx.create(this, onButtonHold, {command:"fullscreen"}));
fullscreenButton_.addEventListener("release", com.google.utils.DelegateEx.create(this, onButtonRelease, {command:"fullscreen"}));
fullscreenButton_.addEventListener("releaseOutside", com.google.utils.DelegateEx.create(this, onButtonReleaseOutside, {command:"fullscreen"}));
menuButton_.addEventListener("press", com.google.utils.DelegateEx.create(this, onButtonPress, {command:"menu"}));
menuButton_.addEventListener("hold", com.google.utils.DelegateEx.create(this, onButtonHold, {command:"menu"}));
menuButton_.addEventListener("release", com.google.utils.DelegateEx.create(this, onButtonRelease, {command:"menu"}));
menuButton_.addEventListener("releaseOutside", com.google.utils.DelegateEx.create(this, onButtonReleaseOutside, {command:"menu"}));
scrubControl_.addEventListener("beginScrub", com.google.utils.DelegateEx.create(this, onBeginScrub));
scrubControl_.addEventListener("scrub", com.google.utils.DelegateEx.create(this, onScrub));
scrubControl_.addEventListener("endScrub", com.google.utils.DelegateEx.create(this, onEndScrub));
volumeControl_.addEventListener("scrub", com.google.utils.DelegateEx.create(this, onVolumeChange));
subtitleButton_.addEventListener("press", com.google.utils.DelegateEx.create(this, onSubtitleControlEvent, {command:"subtitleSwitch"}));
subtitleListButton_.addEventListener("press", com.google.utils.DelegateEx.create(this, onSubtitleControlEvent, {command:"subtitlePick"}));
subtitleListButton_.addEventListener("release", com.google.utils.DelegateEx.create(this, onSubtitleControlEvent, {command:"subtitleListButtonRelease"}));
subtitleListButton_.addEventListener("releaseOutside", com.google.utils.DelegateEx.create(this, onSubtitleControlEvent, {command:"subtitleListButtonRelease"}));
if (subtitleText_ == null) {
subtitleText_ = new Array();
}
if (subtitleText_[SUBTITLE_STRING_SHOW_CAPTIONS] == null) {
subtitleText_[SUBTITLE_STRING_SHOW_CAPTIONS] = SUBTITLE_STRING_SHOW_CAPTIONS_TEXT;
}
if (subtitleText_[SUBTITLE_STRING_HIDE_CAPTIONS] == null) {
subtitleText_[SUBTITLE_STRING_HIDE_CAPTIONS] = SUBTITLE_STRING_HIDE_CAPTIONS_TEXT;
}
if (subtitleText_[SUBTITLE_STRING_CAPTION_TRACKS] == null) {
subtitleText_[SUBTITLE_STRING_CAPTION_TRACKS] = SUBTITLE_STRING_CAPTION_TRACKS_TEXT;
}
if (subtitleText_[SUBTITLE_MENU_STRING_SHOW_CAPTIONS] == null) {
subtitleText_[SUBTITLE_MENU_STRING_SHOW_CAPTIONS] = SUBTITLE_MENU_STRING_SHOW_CAPTIONS_TEXT;
}
if (subtitleText_[SUBTITLE_MENU_STRING_SHOW_BKGROUND] == null) {
subtitleText_[SUBTITLE_MENU_STRING_SHOW_BKGROUND] = SUBTITLE_MENU_STRING_SHOW_BKGROUND_TEXT;
}
size();
}
function size() {
currentLayoutFn_.call(this);
__width = controlBar_._width;
__height = controlBar_._height;
}
function clickToPlayLayout() {
if (Stage.height == 280) {
var _local2 = 2.5;
} else {
var _local2 = 1;
}
var _local3 = 120;
var _local4 = 0;
playButton_.baseName = "adbtn";
scrubControl_.timelineSliderGraphic = "time_slider_small";
controlBar_._x = 0;
controlBar_._y = 0;
controlBar_._width = __width;
controlBar_._height = Math.max(scrubControl_.height, playButton_._height) + (2 * _local2);
if (controlBar_._width >= 280) {
var _local5 = 2;
} else {
var _local5 = 0;
}
var _local6 = Math.max(30, Math.round(controlBar_._width / 6));
if ((_local6 % 2) == 1) {
_local6 = _local6 + 1;
}
playButton_.setSize(_local6, playButton_.height);
var _local7 = _local4 + _local5;
var _local8 = Math.round((((controlBar_._height - playButton_._height) + _local2) - 1) / 2);
rewindButton_._visible = false;
playButton_._x = _local7;
playButton_._y = _local8;
_local7 = _local7 + playButton_._width;
fastForwardButton_._visible = false;
var _local9 = controlBar_._width;
linkDisplay_._x = _local7;
menuButton_._visible = false;
menuButtonNoMenu_._visible = false;
fullscreenButton_._visible = false;
abgDisplay_._x = _local9 - abgDisplay_._width;
abgDisplay_._y = controlBar_._height / 4;
if (Stage.width == 200) {
abgDisplay_._y = abgDisplay_._y - 6;
}
_local9 = (_local9 - abgDisplay_._width) - _local5;
_local9 = (_local9 - volumeControl_._width) - _local5;
volumeControl_._x = _local9;
scrubControl_._x = _local7;
scrubControl_.setSize(_local9 - scrubControl_._x, 30);
scrubControl_._y = ((controlBar_._height - scrubControl_._height) / 2) + 5;
linkDisplay_._width = scrubControl_.width - 2;
volumeControl_._y = scrubControl_._y - 5;
volumeControl_.setSize(30, volumeControl_.height);
linkDisplay_._y = scrubControl_._y - 14;
if (timeDisplay_._visible) {
timeDisplay_._x = 235;
timeDisplay_._y = scrubControl_._y - 15;
abgDisplay_._y = scrubControl_._y - 4;
}
linkDisplay_._visible = true;
abgDisplay_._visible = true;
}
function oneLineLayout() {
var _local2 = 2;
var _local3 = 2;
var _local4 = 0;
controlBar_._x = 0;
controlBar_._y = 0;
controlBar_._width = __width;
controlBar_._height = Math.max(scrubControl_.height, playButton_.height) + (2 * _local2);
var _local5 = _local4 + _local3;
var _local6 = (controlBar_._height - playButton_._height) / 2;
rewindButton_._visible = false;
fastForwardButton_._visible = false;
playButton_._x = _local5;
playButton_._y = _local6;
playButton_.setSize((subtitleButtonEnabled_ ? 50 : 60), playButton_.height);
_local5 = _local5 + playButton_._width;
var _local7 = controlBar_._width - _local3;
if (menuButtonType_ != MENUBUTTON_NONE) {
var _local9 = 0;
switch (menuButtonType_) {
case MENUBUTTON_TRIANGLE :
menuButton_.icon = "icon_menu";
menuButton_.setSize(24, BUTTON_HEIGHT);
menuButton_._visible = true;
menuButtonNoMenu_._visible = false;
var _local8 = menuButton_;
break;
case MENUBUTTON_LOGO :
menuButton_.icon = "google_video_logo_18px";
menuButton_.setSize(70, BUTTON_HEIGHT);
menuButton_._visible = true;
menuButtonNoMenu_._visible = false;
_local8 = menuButton_;
break;
case MENUBUTTON_LOGO_NO_MENU :
menuButton_._visible = false;
menuButtonNoMenu_._visible = true;
_local8 = menuButtonNoMenu_;
_local9 = 16;
}
_local7 = (_local7 - _local8._width) + _local9;
_local8._x = _local7;
_local8._y = _local6;
} else {
menuButton_._visible = false;
menuButtonNoMenu_._visible = false;
}
if (showFullscreen_ != FULLSCREEN_NONE) {
_local7 = _local7 - fullscreenButton_._width;
fullscreenButton_._x = _local7;
fullscreenButton_._y = _local6;
_local7 = _local7 - 2;
}
if (subtitleButtonEnabled_) {
if (subtitleListButtonEnabled_) {
subtitleListButton_.setSize(SUBTITLE_LIST_BUTTON_WIDTH, subtitleButton_.height);
_local7 = _local7 - subtitleListButton_._width;
subtitleListButton_._x = _local7;
subtitleListButton_._y = _local6;
subtitleListButton_._visible = true;
subtitleButton_.setSize(SUBTITLE_BUTTON_WIDTH, subtitleButton_.height);
subtitleButton_.setOpenHalfAndSpacingRatio(com.google.ui.common.IconHalfButton.OPEN_RIGHT, 0.8);
} else {
subtitleListButton_._visible = false;
subtitleButton_.setSize(SUBTITLE_BUTTON_WIDTH_WIDER, subtitleButton_.height);
subtitleButton_.setOpenHalfAndSpacingRatio(com.google.ui.common.IconHalfButton.OPEN_NONE, 0.5);
}
_local7 = _local7 - subtitleButton_._width;
subtitleButton_._x = _local7;
subtitleButton_._y = _local6;
subtitleButton_._visible = true;
} else {
subtitleListButton_._visible = false;
subtitleButton_._visible = false;
}
if (speedControl_ != null) {
if (speedControlEnabled_) {
_local7 = _local7 - speedControl_.getWidth();
speedControl_.setPosition(_local7, _local6);
speedControl_.setSize(speedControl_.getWidth(), BUTTON_HEIGHT);
speedControl_.enable();
} else {
speedControl_.disable();
}
}
_local7 = (_local7 - volumeControl_._width) - _local3;
volumeControl_._x = _local7;
volumeControl_.setSize(40, volumeControl_.height);
scrubControl_._x = _local5;
scrubControl_.setSize(_local7 - scrubControl_._x, 30);
scrubControl_._y = (controlBar_._height - scrubControl_._height) / 2;
volumeControl_._y = scrubControl_._y + 2;
timeDisplay_._y = scrubControl_._y - 6;
timeDisplay_._x = (scrubControl_._x + scrubControl_.trackRight) - timeDisplay_._width;
linkDisplay_._visible = false;
}
function skyLayout() {
if (!skyLayoutInited_) {
skyLogo_ = attachMovie("skycast_logo", "skyLogo_", getNextHighestDepth());
skyLayoutInited_ = true;
}
var _local2 = 2;
var _local3 = 2;
var _local4 = 0;
rewindButton_._visible = false;
fastForwardButton_._visible = false;
fullscreenButton_._visible = false;
menuButton_._visible = false;
menuButtonNoMenu_._visible = false;
linkDisplay_._visible = false;
abgDisplay_._visible = false;
if (speedControl_ != null) {
speedControl_.disable();
}
subtitleButton_._visible = false;
subtitleListButton_._visible = false;
controlBar_._x = 0;
controlBar_._y = 0;
controlBar_._width = __width;
controlBar_._height = Math.max(scrubControl_.height, playButton_.height) + (2 * _local2);
var _local5 = _local4 + _local3;
var _local6 = (controlBar_._height - playButton_._height) / 2;
playButton_._x = _local5;
playButton_._y = _local6;
playButton_.setSize(50, playButton_.height);
_local5 = _local5 + playButton_._width;
var _local7 = controlBar_._width - _local3;
_local7 = _local7 - skyLogo_._width;
skyLogo_._x = _local7;
skyLogo_._y = _local6;
_local7 = (_local7 - volumeControl_._width) - (_local3 * 2);
volumeControl_._x = _local7;
volumeControl_.setSize(40, volumeControl_.height);
scrubControl_._x = _local5;
scrubControl_.setSize(_local7 - scrubControl_._x, 30);
scrubControl_._y = (controlBar_._height - scrubControl_._height) / 2;
volumeControl_._y = scrubControl_._y + 2;
timeDisplay_._y = scrubControl_._y - 6;
timeDisplay_._x = (scrubControl_._x + scrubControl_.trackRight) - timeDisplay_._width;
}
function onButtonPress(evtObj, context) {
dispatchEvent({type:"press", target:this, command:context.command});
}
function onButtonHold(evtObj, context) {
dispatchEvent({type:"hold", target:this, command:context.command});
}
function onButtonClick(evtObj, context) {
dispatchEvent({type:"command", target:this, command:context.command});
}
function onButtonRelease(evtObj, context) {
dispatchEvent({type:"release", target:this, command:context.command, clicked:evtObj.clicked});
}
function onButtonReleaseOutside(evtObj, context) {
dispatchEvent({type:"releaseOutside", target:this, command:context.command});
}
function onSubtitleControlEvent(evtObj, context) {
if (context.command == "subtitleListButtonRelease") {
subtitleListButton_.toggleOff();
} else {
dispatchEvent({type:"subtitleControlEvent", target:this, command:context.command});
}
}
function onBeginScrub(evtObj) {
dispatchEvent(evtObj);
}
function onScrub(evtObj) {
dispatchEvent(evtObj);
}
function onEndScrub(evtObj) {
dispatchEvent(evtObj);
}
function onVolumeChange(evtObj) {
dispatchEvent({type:"volumeChange", target:this, value:evtObj.value});
}
function set timeDisplay(val) {
if (timeDisplayText_ == val) {
return;
}
timeDisplayText_ = val;
timeDisplay_.text = val;
size();
//return(timeDisplay);
}
function get timeDisplay() {
return(timeDisplay_.text);
}
function setLinkDisplayProperties(visible_url, redirect_url) {
linkDisplay_.text = visible_url;
var _local4 = linkDisplay_.getTextFormat();
_local4.url = redirect_url;
linkDisplay_.setTextFormat(_local4);
}
function setAbgText(abgText) {
abgDisplay_.text = abgText;
abgDisplay_.autoSize = true;
}
function setAbgLinkUrl(redirect_url) {
abgDisplay_.html = true;
var _local3 = abgDisplay_.getTextFormat();
_local3.url = redirect_url;
abgDisplay_.setTextFormat(_local3);
}
function setTimeDisplayVisible(val) {
timeDisplay_._visible = val;
}
function set playing(val) {
if (val) {
playButton_.icon = "icon_pause";
} else {
playButton_.icon = "icon_play";
}
//return(__get__playing());
}
function setSpeedControl(control) {
speedControl_ = control;
}
function get speedControlEnabled() {
return(speedControlEnabled_);
}
function set speedControlEnabled(val) {
if (val) {
speedControlEnabled_ = true;
} else {
speedControlEnabled_ = false;
}
size();
//return(speedControlEnabled);
}
function get subtitleButtonEnabled() {
return(subtitleButtonEnabled_);
}
function set subtitleButtonEnabled(val) {
if (val) {
subtitleButtonEnabled_ = true;
com.google.ui.common.ToolTips.registerEventHandlers(subtitleButton_, subtitleText_[SUBTITLE_STRING_HIDE_CAPTIONS], 0.8, 5, false);
} else {
subtitleButtonEnabled_ = false;
com.google.ui.common.ToolTips.hideToolTips(subtitleButton_);
}
size();
//return(subtitleButtonEnabled);
}
function get subtitleButtonOn() {
return(subtitleButtonOn_);
}
function set subtitleButtonOn(val) {
if (val) {
subtitleButtonOn_ = true;
subtitleButton_.toggleOn();
subtitleButton_.icon = (subtitleButtonUseUSIcon_ ? (SUBTITLE_ICON_NAME_NA_ON) : (SUBTITLE_ICON_NAME_OTHERS_ON));
com.google.ui.common.ToolTips.hideToolTips(subtitleButton_);
com.google.ui.common.ToolTips.registerMessage(subtitleButton_, subtitleText_[SUBTITLE_STRING_HIDE_CAPTIONS]);
} else {
subtitleButtonOn_ = false;
subtitleButton_.toggleOff();
subtitleButton_.icon = (subtitleButtonUseUSIcon_ ? (SUBTITLE_ICON_NAME_NA_OFF) : (SUBTITLE_ICON_NAME_OTHERS_OFF));
com.google.ui.common.ToolTips.hideToolTips(subtitleButton_);
com.google.ui.common.ToolTips.registerMessage(subtitleButton_, subtitleText_[SUBTITLE_STRING_SHOW_CAPTIONS]);
}
//return(subtitleButtonOn);
}
function get subtitleListButtonEnabled() {
return(subtitleListButtonEnabled_);
}
function set subtitleListButtonEnabled(val) {
subtitleListButtonEnabled_ = val;
size();
//return(subtitleListButtonEnabled);
}
function get subtitleListButtonRight() {
return(subtitleListButton_._x + subtitleListButton_._width);
}
function initSubtitleListButtonTooltip() {
com.google.ui.common.ToolTips.hideToolTips(subtitleListButton_);
com.google.ui.common.ToolTips.registerEventHandlers(subtitleListButton_, subtitleText_[SUBTITLE_STRING_CAPTION_TRACKS], 0.8, 5, false);
}
function hideSubtitleListButtonTooltip() {
com.google.ui.common.ToolTips.hideToolTips(subtitleListButton_);
}
function initializeSubtitleLocalization(xlb) {
var _local3 = xlb.messages_;
if (_local3[SUBTITLE_STRING_SHOW_CAPTIONS] != null) {
subtitleText_[SUBTITLE_STRING_SHOW_CAPTIONS] = _local3[SUBTITLE_STRING_SHOW_CAPTIONS];
} else {
subtitleText_[SUBTITLE_STRING_SHOW_CAPTIONS] = "";
}
if (_local3[SUBTITLE_STRING_HIDE_CAPTIONS] != null) {
subtitleText_[SUBTITLE_STRING_HIDE_CAPTIONS] = _local3[SUBTITLE_STRING_HIDE_CAPTIONS];
} else {
subtitleText_[SUBTITLE_STRING_HIDE_CAPTIONS] = "";
}
if (_local3[SUBTITLE_STRING_CAPTION_TRACKS] != null) {
subtitleText_[SUBTITLE_STRING_CAPTION_TRACKS] = _local3[SUBTITLE_STRING_CAPTION_TRACKS];
} else {
subtitleText_[SUBTITLE_STRING_CAPTION_TRACKS] = "";
}
if (_local3[SUBTITLE_MENU_STRING_SHOW_CAPTIONS] != null) {
subtitleText_[SUBTITLE_MENU_STRING_SHOW_CAPTIONS] = _local3[SUBTITLE_MENU_STRING_SHOW_CAPTIONS];
}
if (_local3[SUBTITLE_MENU_STRING_SHOW_BKGROUND] != null) {
subtitleText_[SUBTITLE_MENU_STRING_SHOW_BKGROUND] = _local3[SUBTITLE_MENU_STRING_SHOW_BKGROUND];
}
subtitleButtonUseUSIcon_ = (xlb.locale_ == com.google.xml.XlbMessages.LOCALE_EN_US) || (xlb.locale_ == com.google.xml.XlbMessages.LOCALE_EN_CA);
subtitleButtonOn = subtitleButtonOn_;
}
function get subtitleMenuStringShowCaptions() {
return(subtitleText_[SUBTITLE_MENU_STRING_SHOW_CAPTIONS]);
}
function get subtitleMenuStringShowBkground() {
return(subtitleText_[SUBTITLE_MENU_STRING_SHOW_BKGROUND]);
}
function initializeMarkerLocalization(xlb) {
scrubControl_.initializeMarkerLocalization(xlb);
}
function get showFullscreen() {
return(showFullscreen_);
}
function set showFullscreen(val) {
showFullscreen_ = val;
switch (showFullscreen_) {
case FULLSCREEN_NONE :
fullscreenButton_._visible = false;
break;
case FULLSCREEN_MAX :
fullscreenButton_.icon = "icon_max";
fullscreenButton_._visible = true;
break;
case FULLSCREEN_MIN :
fullscreenButton_.icon = "icon_min";
fullscreenButton_._visible = true;
}
size();
//return(showFullscreen);
}
function set menuButtonType(val) {
menuButtonType_ = val;
size();
//return(menuButtonType);
}
function get menuButtonType() {
return(menuButtonType_);
}
function set playProgress(val) {
scrubControl_.playProgress = val;
//return(playProgress);
}
function get playProgress() {
return(scrubControl_.playProgress);
}
function set bufferStart(val) {
scrubControl_.bufferStart = val;
//return(bufferStart);
}
function get bufferStart() {
return(scrubControl_.bufferStart);
}
function set bufferEnd(val) {
scrubControl_.bufferEnd = val;
//return(bufferEnd);
}
function get bufferEnd() {
return(scrubControl_.bufferEnd);
}
function set volume(val) {
volumeControl_.value = val;
soundControl_.setVolume(val * 100);
if (val > 0) {
muted_ = false;
}
//return(volume);
}
function get volume() {
return(volumeControl_.value);
}
function get unMuteVolume() {
return(unMuteVolume_);
}
function set muted(val) {
if (val == muted_) {
return;
}
if (val) {
if (volume > 0) {
unMuteVolume_ = volume;
}
volume = 0;
} else {
volume = unMuteVolume_;
}
muted_ = val;
//return(muted);
}
function get muted() {
return(muted_);
}
function set layout(val) {
var _local3 = this[val];
if (_local3 != undefined) {
currentLayoutName_ = val;
currentLayoutFn_ = _local3;
size();
}
//return(layout);
}
function get layout() {
return(currentLayoutName_);
}
function get scrubControl() {
return(com.google.ui.media.ScrubControl(scrubControl_));
}
function setSkyLogoClickUrl(url) {
if (skyLogo_) {
skyLogo_.onRelease = function () {
getURL (url, "_top");
};
}
}
static var classPath = com.google.ui.media.ControlBar;
static var linkageName = "__Packages.com.google.ui.media.ControlBar";
static var forceLinkage = Object.registerClass(linkageName, classPath);
static var FULLSCREEN_NONE = "none";
static var FULLSCREEN_MAX = "max";
static var FULLSCREEN_MIN = "min";
static var MENUBUTTON_NONE = "none";
static var MENUBUTTON_TRIANGLE = "triangle";
static var MENUBUTTON_LOGO = "logo";
static var MENUBUTTON_LOGO_NO_MENU = "logonomenu";
var speedControlEnabled_ = false;
var speedControl_ = null;
static var SUBTITLE_ICON_NAME_NA_ON = "icon_cc_us_on";
static var SUBTITLE_ICON_NAME_NA_OFF = "icon_cc_us_off";
static var SUBTITLE_ICON_NAME_OTHERS_ON = "icon_cc_intl_on";
static var SUBTITLE_ICON_NAME_OTHERS_OFF = "icon_cc_intl_off";
static var SUBTITLE_BUTTON_WIDTH = 28;
static var SUBTITLE_BUTTON_WIDTH_WIDER = 32;
static var SUBTITLE_LIST_BUTTON_WIDTH = 12;
var subtitleButtonEnabled_ = false;
var subtitleButton_ = null;
var subtitleButtonOn_ = false;
var subtitleButtonUseUSIcon_ = true;
var subtitleListButtonEnabled_ = false;
var subtitleListButton_ = null;
static var SUBTITLE_STRING_SHOW_CAPTIONS = "ShowCaptions";
static var SUBTITLE_STRING_SHOW_CAPTIONS_TEXT = "Click to show captions";
static var SUBTITLE_STRING_HIDE_CAPTIONS = "HideCaptions";
static var SUBTITLE_STRING_HIDE_CAPTIONS_TEXT = "Click to hide captions";
static var SUBTITLE_STRING_CAPTION_TRACKS = "CaptionOptions";
static var SUBTITLE_STRING_CAPTION_TRACKS_TEXT = "Click for more caption options";
static var SUBTITLE_MENU_STRING_SHOW_CAPTIONS = "CCMenuShowCaptions";
static var SUBTITLE_MENU_STRING_SHOW_CAPTIONS_TEXT = "Show Captions";
static var SUBTITLE_MENU_STRING_SHOW_BKGROUND = "CCMenuShowBackground";
static var SUBTITLE_MENU_STRING_SHOW_BKGROUND_TEXT = "Show Background";
var subtitleText_ = null;
var timeDisplayText_ = "";
var unMuteVolume_ = 1;
var BUTTON_HEIGHT = 23;
var showFullscreen_ = FULLSCREEN_MAX;
var menuButtonType_ = MENUBUTTON_NONE;
var skyUrl_ = null;
var skyLayoutInited_ = false;
}
Symbol 20579 MovieClip [__Packages.com.google.video.ui.BackButton] Frame 0
class com.google.video.ui.BackButton extends com.google.video.ui.TransparentButton
{
var highlight_, redraw, lineStyle, beginFill, endFill, state, __get__highlight;
function BackButton () {
super();
highlight_ = false;
redraw();
}
function drawButtonContents() {
lineStyle(0, 13421772, 0);
if (highlight_) {
beginFill(16777215, 100);
} else {
beginFill(16777215, 20);
}
com.google.ui.common.Drawing.drawTriangle(this, 17, 3, 5, 9, 17, 15, 1);
endFill();
}
function drawButtonContainer() {
lineStyle(1, 16777215, 50);
if (state == com.google.video.ui.SimpleButton.UP) {
beginFill(3368601, 40);
} else if (state == com.google.video.ui.SimpleButton.OVER) {
beginFill(6724044, 40);
} else {
beginFill(4487082, 40);
}
com.google.ui.common.Drawing.drawRectangle(this, 0, 0, 22, 18, 0);
endFill();
}
function set highlight(val) {
highlight_ = val;
redraw();
//return(__get__highlight());
}
static var classPath = com.google.video.ui.BackButton;
static var linkageName = "__Packages.com.google.video.ui.BackButton";
static var forceLinkage = Object.registerClass(linkageName, classPath);
}
Symbol 20580 MovieClip [__Packages.com.google.video.ui.BigHonkingPlayButton] Frame 0
class com.google.video.ui.BigHonkingPlayButton extends com.google.video.ui.ButtonFader
{
var redraw, lineStyle, beginGradientFill, endFill, beginFill, state;
function BigHonkingPlayButton () {
super();
redraw();
}
function drawButtonContents() {
lineStyle(0, 0, 0);
var _local2 = {a:0, b:32, c:0, d:-32, e:0, f:0, g:0, h:0, i:1};
beginGradientFill("linear", [8961006, 16777215], [100, 100], [0, 255], _local2);
com.google.ui.common.Drawing.drawTriangle(this, 30, 8, 54, 20, 30, 32, 1);
endFill();
}
function drawButtonContainer() {
var _local2 = 0;
var _local3 = 0;
var _local4 = 80;
var _local5 = 40;
var _local6 = {a:0, b:_local5, c:0, d:-_local5, e:0, f:0, g:0, h:0, i:1};
lineStyle(2, 0, 40);
beginFill(0, 40);
com.google.ui.common.Drawing.drawRectangle(this, _local2 + 2, _local3 + 2, _local4, _local5, 10);
endFill();
lineStyle(4, 3368601, 40);
beginFill(0, 0);
com.google.ui.common.Drawing.drawRectangle(this, _local2, _local3, _local4, _local5, 10);
endFill();
lineStyle(2, 16777215, 100);
if (state == com.google.video.ui.SimpleButton.UP) {
beginGradientFill("linear", [5605563, 2250120], [75, 75], [0, 255], _local6);
} else if (state == com.google.video.ui.SimpleButton.OVER) {
beginGradientFill("linear", [6724044, 3368601], [100, 100], [0, 255], _local6);
} else {
beginGradientFill("linear", [4487082, 1131639], [100, 100], [0, 255], _local6);
}
com.google.ui.common.Drawing.drawRectangle(this, _local2, _local3, _local4, _local5, 10);
endFill();
lineStyle(0, 0, 0);
beginGradientFill("linear", [16777215, 16777215], [50, 0], [0, 255], _local6);
com.google.ui.common.Drawing.drawRectangle(this, _local2 + 3, _local3, _local4 - 6, (_local5 - 6) / 2, 0);
endFill();
}
static var classPath = com.google.video.ui.BigHonkingPlayButton;
static var linkageName = "__Packages.com.google.video.ui.BigHonkingPlayButton";
static var forceLinkage = Object.registerClass(linkageName, classPath);
}
Symbol 20581 MovieClip [__Packages.com.google.comm.NamedConnection] Frame 0
class com.google.comm.NamedConnection
{
var log_, connection_, connectionName_, targetName_, master_, sessionId_, statusTimer_, lastPingReceived_, dispatchEvent;
function NamedConnection () {
log_ = new com.google.logs.Logger("NamedCxn");
mx.events.EventDispatcher.initialize(this);
connection_ = new LocalConnection();
connection_.allowDomain = function () {
return(true);
};
connection_.ping = com.google.utils.DelegateEx.create(this, pingHandler);
connection_.terminate = com.google.utils.DelegateEx.create(this, terminateHandler);
connection_.syn = com.google.utils.DelegateEx.create(this, synHandler);
connection_.ack = com.google.utils.DelegateEx.create(this, ackHandler);
}
function open(name) {
log_.log(3, ("Opening new connection (" + name) + ")");
if (state_ != STATE_CLOSED) {
log_.log(3, ("Current state was " + state_) + ": closing");
close("new connection opened");
}
state_ = STATE_PENDING;
if (connection_.connect(name + "_MASTER")) {
connectionName_ = name + "_MASTER";
targetName_ = name + "_SLAVE";
master_ = true;
sessionId_ = Math.random();
log_.log(5, "Created master endpoint");
} else {
connection_.connect(name + "_SLAVE");
connectionName_ = name + "_SLAVE";
targetName_ = name + "_MASTER";
master_ = false;
log_.log(5, "Created slave endpoint");
}
statusTimer_ = _global.setInterval(this, "checkConnectionStatus", PING_INTERVAL);
return(master_);
}
function close(closeReason) {
log_.log(3, (master_ ? "MASTER" : "SLAVE") + ": Closing connection");
if (state_ != STATE_CLOSED) {
send("terminate", {reason:closeReason, sessionId:sessionId_});
}
connection_.close();
_global.clearInterval(statusTimer_);
statusTimer_ = undefined;
lastPingReceived_ = undefined;
state_ = STATE_CLOSED;
dispatchEvent({type:"closed", target:this});
}
function send(message, args) {
log_.log(10, ((((master_ ? "MASTER" : "SLAVE") + ": Sending ") + message) + " to ") + targetName_);
connection_.send(targetName_, message, args);
}
function setHandler(name, handler) {
connection_[name] = handler;
}
function get state() {
return(state_);
}
function pingHandler(args) {
var _local3 = getTimer();
log_.log(10, ((((master_ ? "MASTER" : "SLAVE") + ": Ping received on ") + connectionName_) + " at ") + _local3);
if ((state_ == STATE_CONNECTED) && (args.sessionId == sessionId_)) {
lastPingReceived_ = _local3;
}
}
function synHandler(args) {
log_.log(5, ((master_ ? "MASTER" : "SLAVE") + ": SYN id = ") + args.sessionId);
if ((state_ == STATE_PENDING) && (!master_)) {
sessionId_ = args.sessionId;
state_ = STATE_CONNECTED;
dispatchEvent({type:"connected", target:this});
send("ack", {sessionId:sessionId_});
log_.log(5, "Connection established - sessionId = " + sessionId_);
}
}
function ackHandler(args) {
log_.log(5, ((master_ ? "MASTER" : "SLAVE") + ": ACK id = ") + args.sessionId);
if ((state_ == STATE_PENDING) && (master_ && (args.sessionId == sessionId_))) {
state_ = STATE_CONNECTED;
dispatchEvent({type:"connected", target:this});
log_.log(5, "Connection established - sessionId = " + sessionId_);
}
}
function terminateHandler(args) {
log_.log(5, (((master_ ? "MASTER" : "SLAVE") + ": Received terminate request (") + args.reason) + ") from remote endpoint");
log_.log(5, ((((master_ ? "MASTER" : "SLAVE") + ": Term sessionId = ") + args.sessionId) + " my sessionId = ") + sessionId_);
if ((state_ == STATE_CONNECTED) && (args.sessionId == sessionId_)) {
close("received term request");
}
}
function checkConnectionStatus() {
var _local2 = getTimer();
if (state_ == STATE_PENDING) {
if (master_) {
log_.log(15, "MASTER: sending SYN message");
send("syn", {sessionId:sessionId_});
} else {
log_.log(15, "SLAVE: Waiting for SYN message");
}
return(undefined);
}
if (state_ == STATE_CONNECTED) {
var _local3 = _local2 - lastPingReceived_;
if (_local3 > CONNECTION_TIMEOUT) {
log_.log(5, (((master_ ? "MASTER" : "SLAVE") + ": No ping for ") + _local3) + " ms. Connection terminated");
close("timeout - " + _local3);
} else {
send("ping", {sessionId:sessionId_, time:_local2});
}
}
}
static var STATE_CLOSED = "disconnected";
static var STATE_PENDING = "pending";
static var STATE_CONNECTED = "connected";
static var CONNECTION_TIMEOUT = 1000;
static var PING_INTERVAL = 100;
var state_ = STATE_CLOSED;
}
Symbol 20582 MovieClip [__Packages.com.google.geom.Rect] Frame 0
class com.google.geom.Rect extends flash.geom.Rectangle
{
var x, y, width, height;
function Rect (x, y, width, height) {
super();
this.x = x;
this.y = y;
this.width = width;
this.height = height;
}
function fitToSize(newWidth, newHeight) {
var _local4 = width / height;
var _local5 = newWidth;
var _local6 = newHeight;
if (_local5 > (_local4 * newHeight)) {
_local5 = _local4 * newHeight;
} else {
_local6 = newWidth / _local4;
}
width = _local5;
height = _local6;
}
}
Symbol 20583 MovieClip [__Packages.com.google.ui.common.SmoothFader] Frame 0
class com.google.ui.common.SmoothFader
{
var intervalId_, getFunc_, setFunc_, target_, speed_, velocity_, acceleration_, lastTimestep_;
function SmoothFader (getFunc, setFunc, speed) {
intervalId_ = null;
getFunc_ = getFunc;
setFunc_ = setFunc;
target_ = getFunc_();
speed_ = speed;
velocity_ = 0;
acceleration_ = 0;
}
function get target() {
return(target_);
}
function set target(val) {
if (target_ == val) {
return;
}
target_ = val;
if (target_ < getFunc_()) {
acceleration_ = -speed_;
} else {
acceleration_ = speed_;
}
if (intervalId_ == null) {
lastTimestep_ = getTimer();
intervalId_ = _global.setInterval(this, "timerCallback", INTERVAL);
doTimestep();
}
//return(target);
}
function timerCallback() {
var _local2 = getTimer();
var _local3 = (_local2 - lastTimestep_) / INTERVAL;
while ((_local3 > 0) && (intervalId_ != null)) {
doTimestep();
_local3--;
}
lastTimestep_ = _local2;
}
function doTimestep() {
var _local2 = getFunc_();
var _local3 = Math.abs(velocity_ / acceleration_);
var _local4 = (velocity_ * _local3) + (((acceleration_ * _local3) * _local3) / 2);
var _local5 = (velocity_ * _local3) - (((acceleration_ * _local3) * _local3) / 2);
if (Math.abs((_local2 + _local4) - target) > Math.abs((_local2 + _local5) - target)) {
acceleration_ = -acceleration_;
}
velocity_ = velocity_ + acceleration_;
var _local6 = _local2 + velocity_;
if ((Math.abs(velocity_) <= Math.abs(acceleration_)) && (Math.abs(_local6 - target_) <= Math.abs(acceleration_))) {
_local6 = target_;
velocity_ = 0;
acceleration_ = 0;
}
setFunc_(_local6);
if ((_local6 == target_) && (velocity_ == 0)) {
_global.clearInterval(intervalId_);
intervalId_ = null;
}
}
static var INTERVAL = 42;
}
Symbol 20584 MovieClip [__Packages.com.google.ui.common.ShareLayer] Frame 0
class com.google.ui.common.ShareLayer extends com.google.ui.common.UIComponent
{
var buttonPaneVisible_, showSharePaneOnReturn_, replayEnabled_, videoPubHost_, textSendPane_, textBlogPane_, textReplayPane_, textSendDescription_, textToLabel_, textFromLabel_, textContentLabel_, textSendButton_, textCancelButton_, textSendSuccess_, textSendErrorFrom_, textSendErrorTo_, textSendErrorUnkown_, boundingBox_, attachMovie, getNextHighestDepth, emailButton_, blogButton_, replayButton_, descriptionLabel_, toLabel_, toBox_, fromLabel_, fromBox_, contentLabel_, contentBox_, sendErrorLabel_, sendButton_, cancelButton_, __width, __height, embedEnabled_, width, emailPaneButtonsDisabled_, _visible, sendLinkEnabled_, dispatchEvent, receiveLoadVars_, docid_, subtitleControl_, dismissTimerID_, shareWidget_, skipToEmailPane_, __get__subtitleControl;
function ShareLayer () {
super();
}
function init() {
mx.events.EventDispatcher.initialize(this);
super.init();
buttonPaneVisible_ = true;
showSharePaneOnReturn_ = true;
replayEnabled_ = true;
videoPubHost_ = null;
textSendPane_ = "Send link to a friend";
textBlogPane_ = "Post to Blog/MySpace";
textReplayPane_ = "Play again";
textSendDescription_ = "Send a link to this video to your friends:";
textToLabel_ = "To:";
textFromLabel_ = "From:";
textContentLabel_ = "Message:";
textSendButton_ = "Send link";
textCancelButton_ = "Cancel";
textSendSuccess_ = "Message sent successfully";
textSendErrorFrom_ = "Invalid email address for sender";
textSendErrorTo_ = "Invalid email address for recipient";
textSendErrorUnkown_ = "Unable to send mail";
if (flash.external.ExternalInterface.available) {
var _local3 = flash.external.ExternalInterface.call("vsfe.util.checkForShareWidget");
if ((_local3 != null) && (_local3.exists == true)) {
shareWidget = true;
} else {
shareWidget = false;
}
} else {
shareWidget = false;
}
}
function createChildren() {
if (boundingBox_ == undefined) {
boundingBox_ = attachMovie(com.google.ui.common.ColorLayer.linkageID, "boundingBox_", getNextHighestDepth(), {_visible:true, _height:100, _width:300, _x:0, _y:0, layerColor:1052688, layerAlpha:70, radius:3});
}
if (emailButton_ == undefined) {
emailButton_ = attachMovie(com.google.ui.common.BackedIconButton.linkageID, "emailButton", getNextHighestDepth(), {_width:mainButtonWidth_, _height:buttonHeight_, baseName:"btn", label:textSendPane_, radius:3, padding:buttonBackerPadding_, labelFontSize:buttonFontSize_});
emailButton_.addEventListener("release", com.google.utils.DelegateEx.create(this, onShareClick));
}
if (blogButton_ == undefined) {
blogButton_ = attachMovie(com.google.ui.common.BackedIconButton.linkageID, "blogButton", getNextHighestDepth(), {_width:mainButtonWidth_, _height:buttonHeight_, baseName:"btn", label:textBlogPane_, radius:3, padding:buttonBackerPadding_, labelFontSize:buttonFontSize_});
blogButton_.addEventListener("release", com.google.utils.DelegateEx.create(this, onBlogClick));
}
if (replayButton_ == undefined) {
replayButton_ = attachMovie(com.google.ui.common.BackedIconButton.linkageID, "replayButton", getNextHighestDepth(), {_width:mainButtonWidth_, _height:buttonHeight_, baseName:"btn", label:textReplayPane_, radius:3, padding:buttonBackerPadding_, labelFontSize:buttonFontSize_});
replayButton_.addEventListener("release", com.google.utils.DelegateEx.create(this, onReplayClick));
}
if (descriptionLabel_ == undefined) {
descriptionLabel_ = attachMovie(com.google.ui.common.InputBox.linkageID, "descriptionLabel_", getNextHighestDepth(), {_visible:false, alpha:100, backgroundColor:undefined, alignment:"Left", fontSize:labelFontSize_, text:textSendDescription_, fontColor:16777215, readOnly:true});
}
if (toLabel_ == undefined) {
toLabel_ = attachMovie(com.google.ui.common.InputBox.linkageID, "toLabel_", getNextHighestDepth(), {_visible:false, alpha:100, backgroundColor:undefined, alignment:"right", fontSize:labelFontSize_, text:textToLabel_, fontColor:16777215, readOnly:true});
}
if (toBox_ == undefined) {
toBox_ = attachMovie(com.google.ui.common.InputBox.linkageID, "toBox_", getNextHighestDepth(), {_visible:false, alpha:100, fontSize:labelFontSize_, backgroundColor:16777215, fontColor:0, text:"", readOnly:false, tabIndex:2});
}
if (fromLabel_ == undefined) {
fromLabel_ = attachMovie(com.google.ui.common.InputBox.linkageID, "fromLabel_", getNextHighestDepth(), {_visible:false, alpha:100, backgroundColor:undefined, alignment:"right", fontSize:labelFontSize_, text:textFromLabel_, fontColor:16777215, readOnly:true});
}
if (fromBox_ == undefined) {
fromBox_ = attachMovie(com.google.ui.common.InputBox.linkageID, "fromBox_", getNextHighestDepth(), {_visible:false, alpha:100, fontSize:labelFontSize_, backgroundColor:16777215, fontColor:0, text:"", readOnly:false, tabIndex:1});
}
if (contentLabel_ == undefined) {
contentLabel_ = attachMovie(com.google.ui.common.InputBox.linkageID, "contentLabel_", getNextHighestDepth(), {_visible:false, alpha:100, backgroundColor:undefined, alignment:"right", fontSize:labelFontSize_, text:textContentLabel_, fontColor:16777215, readOnly:true});
}
if (contentBox_ == undefined) {
contentBox_ = attachMovie(com.google.ui.common.InputBox.linkageID, "contentBox_", getNextHighestDepth(), {_visible:false, alpha:100, fontSize:labelFontSize_, backgroundColor:16777215, fontColor:0, multiline:true, text:"", readOnly:false, tabIndex:3});
}
if (sendErrorLabel_ == undefined) {
sendErrorLabel_ = attachMovie(com.google.ui.common.InputBox.linkageID, "sendErrorLabel_", getNextHighestDepth(), {_visible:false, alpha:100, backgroundColor:undefined, alignment:"Left", fontSize:labelFontSize_, text:"", fontColor:16777215, readOnly:true});
}
if (sendButton_ == undefined) {
sendButton_ = attachMovie(com.google.ui.common.BackedIconButton.linkageID, "sendButton", getNextHighestDepth(), {_visible:false, _width:sendButtonWidth_, _height:buttonHeight_, baseName:"btn", label:textSendButton_, radius:3, padding:buttonBackerPadding_, tabIndex:4, labelFontSize:buttonFontSize_});
sendButton_.addEventListener("release", com.google.utils.DelegateEx.create(this, onSendClick));
}
if (cancelButton_ == undefined) {
cancelButton_ = attachMovie(com.google.ui.common.BackedIconButton.linkageID, "cancelButton", getNextHighestDepth(), {_visible:false, _width:sendButtonWidth_, _height:buttonHeight_, baseName:"btn", label:textCancelButton_, radius:3, padding:buttonBackerPadding_, tabIndex:5, labelFontSize:buttonFontSize_});
cancelButton_.addEventListener("release", com.google.utils.DelegateEx.create(this, onCancelClick));
}
size();
}
function size() {
var _local4 = new Object();
var _local5 = 0;
_local4.xMin = 0;
_local4.yMin = 0;
_local4.xMax = 0;
_local4.yMax = 0;
var _local6 = (inputFieldWidth_ + labelWidth_) + spaceBetweenTextFields_;
var _local7 = ((((5 + numMesgLines_) * inputFieldHeight_) + (6 * spaceBetweenTextFields_)) + (2 * boundingBoxPadding_)) + 50;
if (!buttonPaneVisible_) {
var _local2 = Math.floor((__width - _local6) / 2);
var _local3 = Math.floor((__height - _local7) / 2);
} else {
if (embedEnabled_) {
_local5 = SHARE_PANE_DEFAULT_WIDTH;
} else {
_local5 = mainButtonWidth_;
}
var _local2 = Math.floor((__width - _local5) / 2);
var _local3 = Math.floor((__height - SHARE_PANE_HEIGHT) / 2);
}
if (replayEnabled_) {
replayButton_._visible = true;
replayButton_._x = _local2 + ((_local5 - mainButtonWidth_) / 2);
replayButton_._y = _local3;
replayButton_.setSize(mainButtonWidth_, buttonHeight_);
var _local3 = (replayButton_._y + buttonHeight_) + spaceBetweenButtons_;
} else {
replayButton_._visible = false;
}
if (isShowSendLinkButton() && (buttonPaneVisible_)) {
emailButton_._visible = true;
emailButton_._x = _local2;
emailButton_._y = _local3;
emailButton_.setSize(mainButtonWidth_, buttonHeight_);
} else {
emailButton_._visible = false;
}
if (embedEnabled_ && (buttonPaneVisible_)) {
blogButton_._visible = true;
blogButton_._x = (emailButton_._x + emailButton_.__width) + spaceBetweenButtons_;
blogButton_._y = _local3;
blogButton_.setSize(mainButtonWidth_, buttonHeight_);
} else {
blogButton_._visible = false;
}
descriptionLabel_.setSize(width - _local2, inputFieldHeight_);
descriptionLabel_._x = _local2;
descriptionLabel_._y = _local3;
fromLabel_.setSize(labelWidth_, inputFieldHeight_);
fromLabel_._x = descriptionLabel_._x;
fromLabel_._y = (descriptionLabel_._y + inputFieldHeight_) + spaceBetweenTextFields_;
fromBox_.setSize(inputFieldWidth_, inputFieldHeight_);
fromBox_._x = (fromLabel_._x + fromLabel_.__width) + spaceBetweenTextFields_;
fromBox_._y = fromLabel_._y;
toLabel_.setSize(labelWidth_, inputFieldHeight_);
toLabel_._x = fromLabel_._x;
toLabel_._y = (fromLabel_._y + inputFieldHeight_) + spaceBetweenTextFields_;
toBox_.setSize(inputFieldWidth_, inputFieldHeight_);
toBox_._x = (toLabel_._x + toLabel_.__width) + spaceBetweenTextFields_;
toBox_._y = toLabel_._y;
contentLabel_.setSize(labelWidth_, inputFieldHeight_);
contentLabel_._x = toLabel_._x;
contentLabel_._y = (toLabel_._y + inputFieldHeight_) + spaceBetweenTextFields_;
contentBox_.setSize(inputFieldWidth_, inputFieldHeight_ * numMesgLines_);
contentBox_._x = (toLabel_._x + toLabel_.__width) + spaceBetweenTextFields_;
contentBox_._y = contentLabel_._y;
sendErrorLabel_.setSize(_local6, inputFieldHeight_);
sendErrorLabel_._x = contentLabel_._x;
sendErrorLabel_._y = (contentBox_._y + contentBox_.__height) + spaceBetweenTextFields_;
sendButton_.padding = buttonBackerPadding_;
sendButton_._x = sendErrorLabel_._x;
sendButton_._y = (sendErrorLabel_._y + sendErrorLabel_.__height) + spaceBetweenTextFields_;
sendButton_.setSize(sendButtonWidth_, buttonHeight_);
cancelButton_.padding = buttonBackerPadding_;
cancelButton_._x = (sendButton_._x + sendButton_.__width) + spaceBetweenButtons_;
cancelButton_._y = sendButton_._y;
cancelButton_.setSize(sendButtonWidth_, buttonHeight_);
if (!buttonPaneVisible_) {
_local4.xMin = descriptionLabel_._x;
_local4.yMin = descriptionLabel_._y;
_local4.xMax = contentBox_._x + contentBox_.__width;
_local4.yMax = cancelButton_._y + cancelButton_.__height;
fromBox_.setFocus();
} else {
_local4 = replayButton_.getBounds(this);
if (isShowSendLinkButton()) {
_local4.xMin = emailButton_._x;
_local4.xMax = emailButton_._x + emailButton_.__width;
_local4.yMax = emailButton_._y + emailButton_.__height;
}
if (embedEnabled_) {
_local4.xMax = blogButton_._x + blogButton_.__width;
_local4.yMax = blogButton_._y + blogButton_.__height;
}
}
boundingBox_._x = Math.floor(_local4.xMin - boundingBoxPadding_) + 0.5;
boundingBox_._y = Math.floor(_local4.yMin - boundingBoxPadding_) + 0.5;
boundingBox_.setSize((_local4.xMax - _local4.xMin) + (boundingBoxPadding_ * 2), (_local4.yMax - _local4.yMin) + (boundingBoxPadding_ * 2));
}
function showSharePane(val) {
emailButton_._visible = val;
blogButton_._visible = val;
replayButton_._visible = val;
replayEnabled_ = replayButton_._visible;
}
function showEmailPane(val) {
descriptionLabel_._visible = val;
toLabel_._visible = val;
toBox_._visible = val;
fromLabel_._visible = val;
fromBox_._visible = val;
contentLabel_._visible = val;
contentBox_._visible = val;
sendErrorLabel_._visible = val;
sendButton_._visible = val;
cancelButton_._visible = val;
emailPaneButtonsDisabled_ = false;
}
function switchPane() {
if (showSharePaneOnReturn_) {
showSharePane(!buttonPaneVisible_);
showEmailPane(buttonPaneVisible_);
buttonPaneVisible_ = !buttonPaneVisible_;
size();
} else {
_visible = false;
}
}
function isShowSendLinkButton() {
if (sendLinkEnabled_ && (shareWidget)) {
return(true);
}
return(false);
}
function onBlogClick(evtObj) {
dispatchEvent({type:"blogClick", target:this});
}
function onReplayClick(evtObj) {
dispatchEvent({type:"replayClick", target:this});
}
function onSendClick(evtObj) {
if (emailPaneButtonsDisabled_) {
return(undefined);
}
emailPaneButtonsDisabled_ = true;
var _local3 = new LoadVars();
if (receiveLoadVars_ != undefined) {
delete receiveLoadVars_;
receiveLoadVars_ = undefined;
}
receiveLoadVars_ = new LoadVars();
_local3.sendToSender = "false";
_local3.msg = contentBox_.text;
_local3.to = toBox_.text;
_local3.from = fromBox_.text;
_local3.docid = docid_;
if (videoPubHost_ != null) {
_local3.videoPubHost = videoPubHost_;
}
if (subtitleControl_.subtitleEnabled) {
_local3.subtitle = (subtitleControl_.subtitleOn ? "on" : "off");
}
var _local4 = com.google.webutil.url.Utils.getServerUrl(VGC_URL) + SHARE_PATH;
_local3.sendAndLoad(_local4, receiveLoadVars_, "POST");
receiveLoadVars_.onData = com.google.utils.DelegateEx.create(this, mailSendOnData);
if (_local3 != undefined) {
}
}
function onCancelClick(evtObj) {
if (emailPaneButtonsDisabled_) {
return(undefined);
}
sendErrorLabel_.text = "";
switchPane();
}
function onShareClick(evtObj) {
flash.external.ExternalInterface.call("share.display_now");
dispatchEvent({type:"shareClick", target:this});
}
function mailSendOnData(data) {
if (data.charAt(0) == SEND_MESSAGE_SUCCESS) {
sendErrorLabel_.text = textSendSuccess_;
dismissTimerID_ = _global.setInterval(this, "dismissSendPane", SEND_MESSAGE_TIMER);
} else {
if (data.charAt(0) == SEND_MESSAGE_ERROR_FROM) {
var _local3 = textSendErrorFrom_;
} else if (data.charAt(0) == SEND_MESSAGE_ERROR_TO) {
var _local3 = textSendErrorTo_;
} else {
var _local3 = textSendErrorUnkown_;
}
sendErrorLabel_.text = _local3;
emailPaneButtonsDisabled_ = false;
}
}
function dismissSendPane() {
_global.clearInterval(dismissTimerID_);
dismissTimerID_ = undefined;
sendErrorLabel_.text = "";
toBox_.text = "";
switchPane();
}
function get docid() {
return(docid_);
}
function set docid(val) {
docid_ = val;
//return(docid);
}
function get videoPubHost() {
return(videoPubHost_);
}
function set videoPubHost(val) {
videoPubHost_ = val;
//return(videoPubHost);
}
function get embedEnabled() {
return(embedEnabled_);
}
function set embedEnabled(val) {
embedEnabled_ = val;
size();
//return(embedEnabled);
}
function get sendLinkEnabled() {
return(sendLinkEnabled_);
}
function set sendLinkEnabled(val) {
sendLinkEnabled_ = val;
size();
//return(sendLinkEnabled);
}
function get shareWidget() {
return(shareWidget_);
}
function set shareWidget(val) {
shareWidget_ = val;
//return(shareWidget);
}
function get skipToEmailPane() {
return(skipToEmailPane_);
}
function set skipToEmailPane(val) {
skipToEmailPane_ = val;
if (skipToEmailPane_) {
showSharePane(false);
showEmailPane(true);
showSharePaneOnReturn_ = false;
buttonPaneVisible_ = false;
}
size();
//return(skipToEmailPane);
}
function showShareLayer() {
_visible = true;
}
function hideShareLayer() {
_visible = false;
}
function set subtitleControl(sc) {
subtitleControl_ = sc;
//return(__get__subtitleControl());
}
function setLayoutConstraints(paramsObj) {
for (var attr in paramsObj) {
this[attr] = paramsObj[attr];
}
}
function initializeShareLocalization(xlb) {
var _local3 = xlb.messages_;
if (_local3.Pane_Send != null) {
emailButton_.iconButton.label = _local3.Pane_Send;
}
if (_local3.Pane_Blog != null) {
blogButton_.iconButton.label = _local3.Pane_Blog;
}
if (_local3.Pane_Replay != null) {
replayButton_.iconButton.label = _local3.Pane_Replay;
}
if (_local3.Email_SendDescription != null) {
descriptionLabel_.text = _local3.Email_SendDescription;
}
if (_local3.Email_ToLabel != null) {
toLabel_.text = _local3.Email_ToLabel;
}
if (_local3.Email_FromLabel != null) {
fromLabel_.text = _local3.Email_FromLabel;
}
if (_local3.Email_ContentLabel != null) {
contentLabel_.text = _local3.Email_ContentLabel;
}
if (_local3.Email_SendButton != null) {
sendButton_.iconButton.label = _local3.Email_SendButton;
}
if (_local3.Email_CancelButton != null) {
cancelButton_.iconButton.label = _local3.Email_CancelButton;
}
if (_local3.Email_SendSuccess != null) {
textSendSuccess_ = _local3.Email_SendSuccess;
}
if (_local3.Email_SendErrorFrom != null) {
textSendErrorFrom_ = _local3.Email_SendErrorFrom;
}
if (_local3.Email_SendErrorTo != null) {
textSendErrorTo_ = _local3.Email_SendErrorTo;
}
if (_local3.Email_SendErrorUnknown != null) {
textSendErrorUnkown_ = _local3.Email_SendErrorUnknown;
}
}
static var classPath = com.google.ui.common.ShareLayer;
static var linkageID = "__Packages.com.google.ui.common.ShareLayer";
static var forceLinkage = Object.registerClass(linkageID, classPath);
var labelFontSize_ = 16;
var buttonFontSize_ = 15;
var spaceBetweenButtons_ = 20;
var inputFieldHeight_ = 25;
var inputFieldWidth_ = 350;
var boundingBoxPadding_ = 15;
var spaceBetweenTextFields_ = 10;
var buttonBackerPadding_ = 3;
var mainButtonWidth_ = 200 + (_local1.buttonBackerPadding_ * 2);
var sendButtonWidth_ = 88 + (_local1.buttonBackerPadding_ * 2);
var buttonHeight_ = 23 + (_local1.buttonBackerPadding_ * 2);
var labelWidth_ = 84;
var numMesgLines_ = 4;
static var SHARE_PANE_DEFAULT_WIDTH = ((_local1.mainButtonWidth_ * 2) + _local1.spaceBetweenTextFields_) + 11;
static var SHARE_PANE_HEIGHT = _local1.inputFieldHeight_;
static var SEND_MESSAGE_TIMER = 1500;
static var SEND_MESSAGE_SUCCESS = "0";
static var SEND_MESSAGE_ERROR_FROM = "1";
static var SEND_MESSAGE_ERROR_TO = "2";
static var VGC_URL = "http://video.google.com";
static var SHARE_PATH = "/videosendlink?fp=1";
}
Symbol 20585 MovieClip [__Packages.com.google.xml.ContentAdSynd] Frame 0
class com.google.xml.ContentAdSynd extends com.google.xml.AbstractXmlFetcher
{
var messages_;
function ContentAdSynd () {
super();
messages_ = new Object();
}
function parseAI() {
var _local2 = messages_.url.split("&");
var _local3 = 0;
for ( ; _local3 < _local2.length ; _local3++) {
if (_local2[_local3].indexOf("ai=") == 0) {
messages_.ai = _local2[_local3].substring(3, _local2[_local3].length);
}
}
}
function parseAdGroup(node) {
var _local3 = 0;
for ( ; _local3 < node.childNodes.length ; _local3++) {
var _local4 = node.childNodes[_local3];
if (_local4.nodeName == AD) {
for (var attr in _local4.attributes) {
messages_[attr] = _local4.attributes[attr];
if (attr == "url") {
parseAI();
}
}
var _local5 = 0;
for ( ; _local5 < _local4.childNodes.length ; _local5++) {
var _local6 = _local4.childNodes[_local5];
if (_local6.nodeName == PLAYCONFURL) {
messages_[PLAYCONFURL] = _local6.firstChild.nodeValue;
break;
}
}
}
}
}
function parseRootNode(rootNode) {
if ((rootNode == null) || ((!rootNode.hasChildNodes()) || (rootNode.nodeName != GSP))) {
return(false);
}
var _local3 = 0;
for ( ; _local3 < rootNode.childNodes.length ; _local3++) {
if (rootNode.childNodes[_local3].nodeName == ADS) {
parseAdGroup(rootNode.childNodes[_local3]);
}
}
return(true);
}
var PLAYCONFURL = "PLAYCONFURL";
var GSP = "GSP";
var ADS = "ADS";
var AD = "AD";
}
Symbol 20586 MovieClip [__Packages.com.google.video.ui.PlaylistCard] Frame 0
class com.google.video.ui.PlaylistCard extends com.google.video.ui.ListCard
{
var playlists_, title_, playlistPosition_, items_, scrollContents_, scrollUp_, scrollDown_, dispatchEvent;
function PlaylistCard () {
super()
mx.events.EventDispatcher.initialize(this);
}
function loadFromPlaylists(playlists) {
playlists_ = playlists;
playlists_.addEventListener("curIndexUpdated", com.google.utils.DelegateEx.create(this, onCurIndexUpdated));
title_.text = playlists_.channelTitle;
title_._x = (300 - 10) - title_.width;
playlistPosition_ = -1;
items_ = new Array();
for (var playlistName in playlists.playlists) {
var _local3 = playlists.playlists[playlistName].playlistPos;
var _local4 = scrollContents_.attachMovie(com.google.video.ui.PlaylistItem.linkageName, "item_" + _local3, scrollContents_.getNextHighestDepth());
_local4._x = 0;
_local4._y = 56 * _local3;
items_[_local3] = _local4;
items_[_local3].initialize(playlists.playlists[playlistName]);
items_[_local3].playlistName = playlistName;
items_[_local3].addEventListener("clicked", com.google.utils.DelegateEx.create(this, onPlaylistItemClicked));
}
if (items_.length > 3) {
scrollUp_._visible = false;
scrollDown_._visible = true;
} else {
scrollUp_._visible = false;
scrollDown_._visible = false;
}
onCurIndexUpdated(null);
}
function onCurIndexUpdated(evtObj) {
if (playlistPosition_ >= 0) {
items_[playlistPosition_].active = false;
}
var _local3 = playlists_.curPlaylistName;
playlistPosition_ = playlists_.playlists[_local3].playlistPos;
items_[playlistPosition_].active = true;
}
function onPlaylistItemClicked(evtObj) {
dispatchEvent({type:"playlistItemClicked", playlistName:evtObj.target.playlistName});
}
static var classPath = com.google.video.ui.PlaylistCard;
static var linkageName = "__Packages.com.google.video.ui.PlaylistCard";
static var forceLinkage = Object.registerClass(linkageName, classPath);
}
Symbol 20587 MovieClip [__Packages.com.google.ui.media.VolumeControl] Frame 0
class com.google.ui.media.VolumeControl extends com.google.ui.common.UIComponent
{
var boundingBox_mc, backgroundClip_, attachMovie, getNextHighestDepth, sliderClip_, setSize, __width, __height, _xmouse, dispatchEvent;
function VolumeControl () {
super();
}
function init() {
mx.events.EventDispatcher.initialize(this);
super.init();
boundingBox_mc._visible = false;
boundingBox_mc._width = 0;
boundingBox_mc._height = 0;
}
function createChildren() {
backgroundClip_ = attachMovie("vol_bg3", "backgroundClip_", getNextHighestDepth());
sliderClip_ = attachMovie("vol_slider", "sliderClip_", getNextHighestDepth());
var _local2 = com.google.utils.DelegateEx.create(this, OnPressForScrub);
backgroundClip_.onPress = _local2;
sliderClip_.onPress = _local2;
setSize(backgroundClip_._width, backgroundClip_._height);
}
function size() {
backgroundClip_._width = __width;
backgroundClip_._height = __height;
var _local2 = 0;
sliderClip_._y = (backgroundClip_._y + backgroundClip_._height) - (sliderClip_._height / 2);
repositionSlider();
}
function repositionSlider() {
var _local2 = backgroundClip_._x;
var _local3 = backgroundClip_._width - sliderClip_._width;
sliderClip_._x = _local2 + (value_ * _local3);
}
function PercentageFromPosition(pos) {
var _local3 = backgroundClip_._width - sliderClip_._width;
var _local4 = pos / _local3;
_local4 = Math.max(0, _local4);
_local4 = Math.min(1, _local4);
return(_local4);
}
function set value(val) {
if (_global.isNaN(val) || (!((val >= 0) && (val <= 1)))) {
val = 0;
}
if (value_ == val) {
return;
}
value_ = val;
repositionSlider();
//return(value);
}
function get value() {
return(value_);
}
function ScrubMove() {
if (scrubbing_) {
var _local2 = (_xmouse - backgroundClip_._x) - scrubOffset_;
var _local3 = PercentageFromPosition(_local2);
var _local4 = new Object();
_local4.type = "scrub";
_local4.target = this;
_local4.value = _local3;
value = _local3;
dispatchEvent(_local4);
}
}
function ScrubUp() {
if (scrubbing_) {
var _local2 = (_xmouse - backgroundClip_._x) - scrubOffset_;
var _local3 = PercentageFromPosition(_local2);
delete sliderClip_.onMouseMove;
delete sliderClip_.onMouseUp;
scrubbing_ = false;
value = _local3;
var _local4 = new Object();
_local4.type = "endScrub";
_local4.target = this;
_local4.value = _local3;
dispatchEvent(_local4);
}
}
function OnPressForScrub() {
var _local2 = _xmouse - backgroundClip_._x;
if ((_local2 >= sliderClip_._x) && (_local2 <= (sliderClip_._x + sliderClip_._width))) {
scrubOffset_ = (_local2 - sliderClip_._x) - backgroundClip_._x;
} else {
scrubOffset_ = sliderClip_._width / 2;
}
var _local3 = _local2 - scrubOffset_;
var _local4 = PercentageFromPosition(_local3);
scrubbing_ = true;
sliderClip_.onMouseMove = com.google.utils.DelegateEx.create(this, ScrubMove);
sliderClip_.onMouseUp = com.google.utils.DelegateEx.create(this, ScrubUp);
var _local5 = new Object();
_local5.type = "beginScrub";
_local5.target = this;
_local5.value = _local4;
dispatchEvent(_local5);
value = _local4;
ScrubMove();
}
static var classPath = com.google.ui.media.VolumeControl;
static var linkageName = "__Packages.com.google.ui.media.VolumeControl";
static var forceLinkage = Object.registerClass(linkageName, classPath);
var scrubbing_ = false;
var scrubOffset_ = 0;
var value_ = 0;
}
Symbol 20588 MovieClip [__Packages.com.google.media.TimepointNotifier] Frame 0
class com.google.media.TimepointNotifier
{
var lastTimepointIndex_, tolerance_, mediaPlayer_, stopped_, playProgressUpdatedListener_, stateChangeListener_, __get__tolerance, timepoints_, dispatchEvent;
function TimepointNotifier (mediaPlayer) {
mx.events.EventDispatcher.initialize(this);
lastTimepointIndex_ = -1;
tolerance_ = DEFAULT_TOLERANCE;
mediaPlayer_ = mediaPlayer;
stopped_ = true;
start();
}
function start() {
if (!stopped_) {
return(undefined);
}
playProgressUpdatedListener_ = com.google.utils.DelegateEx.create(this, onPlayProgressUpdated);
stateChangeListener_ = com.google.utils.DelegateEx.create(this, onStateChange);
mediaPlayer_.addEventListener("playProgressUpdated", playProgressUpdatedListener_);
mediaPlayer_.addEventListener("stateChange", stateChangeListener_);
stopped_ = false;
}
function stop() {
if (stopped_) {
return(undefined);
}
mediaPlayer_.removeEventListener("playProgressUpdated", playProgressUpdatedListener_);
mediaPlayer_.removeEventListener("stateChange", stateChangeListener_);
playProgressUpdatedListener_ = null;
stateChangeListener_ = null;
stopped_ = true;
}
function destroy() {
stop();
}
function set tolerance(val) {
tolerance_ = val;
//return(__get__tolerance());
}
function setTimepoints(tps) {
timepoints_ = tps;
if (timepoints_ != undefined) {
timepoints_.sortOn("timestamp", Array.NUMERIC);
}
lastTimepointIndex_ = -1;
}
function clearTimepoints() {
setTimepoints(undefined);
}
function onPlayProgressUpdated(eventObj) {
if (stopped_) {
return(undefined);
}
if ((timepoints_ != undefined) && (mediaPlayer_.isStatePlaying())) {
var _local3 = eventObj.newTime;
var _local4 = lastTimepointIndex_ + 1;
for ( ; _local4 < timepoints_.length ; _local4++) {
if ((timepoints_[_local4].timestamp <= _local3) && ((_local3 - timepoints_[_local4].timestamp) <= tolerance_)) {
lastTimepointIndex_ = _local4;
dispatchEvent({type:"onTimepoint", target:this, timestamp:timepoints_[lastTimepointIndex_].timestamp, context:timepoints_[lastTimepointIndex_].context});
} else if (timepoints_[_local4].timestamp > _local3) {
break;
}
}
}
}
function onStateChange(eventObj) {
if (stopped_) {
return(undefined);
}
if ((eventObj.newState != com.google.ui.media.MediaPlayer.STATE_PLAYING) && ((eventObj.newState != com.google.ui.media.MediaPlayer.STATE_BUFFERING) && ((eventObj.newState != com.google.ui.media.MediaPlayer.STATE_PAUSED) && (eventObj.newState != com.google.ui.media.MediaPlayer.STATE_COMPLETED)))) {
lastTimepointIndex_ = -1;
}
if ((eventObj.oldState == com.google.ui.media.MediaPlayer.STATE_COMPLETED) && (eventObj.newState == com.google.ui.media.MediaPlayer.STATE_PLAYING)) {
lastTimepointIndex_ = -1;
}
}
static var DEFAULT_TOLERANCE = 0.5;
}
Symbol 20589 MovieClip [__Packages.com.google.video.ui.ShareCard] Frame 0
class com.google.video.ui.ShareCard extends MovieClip
{
var backgroundClip_, createEmptyMovieClip, getNextHighestDepth, focusRect_, attachMovie, videoTitle_, toBox_, fromBox_, msgBox_, sendButton_, statusText_, videoPubHost_, __get__videoPubHost, videoContentPackageInfo_, __get__videoContentPackageInfo, hideTimer_, dispatchEvent, docid_, receiveLoadVars_;
function ShareCard () {
super();
mx.events.EventDispatcher.initialize(this);
backgroundClip_ = createEmptyMovieClip("backgroundClip_", getNextHighestDepth());
var _local3 = {a:0, b:300, c:0, d:-300, e:0, f:0, g:0, h:0, i:1};
backgroundClip_.beginGradientFill("linear", [2236962, 2236962, 0], [100, 100, 90], [0, 128, 255], _local3);
com.google.ui.common.Drawing.drawRectangle(backgroundClip_, 0, 0, 300, 250, 0);
backgroundClip_.endFill();
backgroundClip_.onPress = function () {
};
backgroundClip_.useHandCursor = false;
focusRect_ = createEmptyMovieClip("focusRect_", getNextHighestDepth());
var _local4 = com.google.video.ui.CloseButton(attachMovie(com.google.video.ui.CloseButton.linkageName, "closeButton_", getNextHighestDepth()));
_local4._x = 300 - 20;
_local4.addEventListener("clicked", com.google.utils.DelegateEx.create(this, onCloseClicked));
var _local5 = com.google.ui.common.StylishText(attachMovie(com.google.ui.common.StylishText.linkageName, "titleText_", getNextHighestDepth(), {size:13, color:16777215, style:com.google.ui.common.StylishText.BOLD}));
_local5._y = 1;
_local5._x = 4;
_local5.text = "Share this video with your friends";
videoTitle_ = com.google.ui.common.StylishText(attachMovie(com.google.ui.common.StylishText.linkageName, "videoTitle_", getNextHighestDepth(), {size:13, color:16113331, style:com.google.ui.common.StylishText.BORDER}));
videoTitle_._x = 12;
videoTitle_._y = (_local5._y + _local5.height) + 8;
videoTitle_.maxWidth = 280;
videoTitle_.text = " ";
var _local6 = com.google.ui.common.StylishText(attachMovie(com.google.ui.common.StylishText.linkageName, "toText_", getNextHighestDepth(), {size:13, color:16777215, style:com.google.ui.common.StylishText.NONE}));
_local6._x = 12;
_local6._y = (videoTitle_._y + videoTitle_.height) + 12;
_local6.text = "To:";
var _local7 = com.google.ui.common.StylishText(attachMovie(com.google.ui.common.StylishText.linkageName, "fromText_", getNextHighestDepth(), {size:13, color:16777215, style:com.google.ui.common.StylishText.NONE}));
_local7._x = 12;
_local7._y = (_local6._y + _local6.height) + 10;
_local7.text = "Your email:";
var _local8 = com.google.ui.common.StylishText(attachMovie(com.google.ui.common.StylishText.linkageName, "msgText_", getNextHighestDepth(), {size:13, color:16777215, style:com.google.ui.common.StylishText.NONE}));
_local8._x = 12;
_local8._y = (_local7._y + _local7.height) + 10;
_local8.text = "Message:";
var _local9 = function (oldFocus) {
this._parent._parent.moveFocusRect(this._parent);
};
toBox_ = com.google.ui.common.InputBox(attachMovie(com.google.ui.common.InputBox.linkageID, "toBox_", getNextHighestDepth(), {fontSize:12, backgroundColor:16777215, fontColor:0, multiline:false, text:"", readOnly:false, tabIndex:1}));
toBox_.setSize(200, 20);
toBox_._x = 92;
toBox_._y = _local6._y;
toBox_.textField.onSetFocus = _local9;
fromBox_ = com.google.ui.common.InputBox(attachMovie(com.google.ui.common.InputBox.linkageID, "fromBox_", getNextHighestDepth(), {fontSize:12, backgroundColor:16777215, fontColor:0, multiline:false, text:"", readOnly:false, tabIndex:2}));
fromBox_.setSize(200, 20);
fromBox_._x = 92;
fromBox_._y = _local7._y;
fromBox_.textField.onSetFocus = _local9;
msgBox_ = com.google.ui.common.InputBox(attachMovie(com.google.ui.common.InputBox.linkageID, "msgBox_", getNextHighestDepth(), {fontSize:12, backgroundColor:16777215, fontColor:0, multiline:true, text:"", readOnly:false, tabIndex:3}));
msgBox_.setSize(280, 60);
msgBox_._x = 12;
msgBox_._y = (_local8._y + _local8.height) + 8;
msgBox_.textField.wordWrap = true;
msgBox_.textField.onSetFocus = _local9;
sendButton_ = com.google.video.ui.TextButton(attachMovie(com.google.video.ui.TextButton.linkageName, "sendButton_", getNextHighestDepth()));
sendButton_.text = "Send E-Mail";
sendButton_._x = 196;
sendButton_._y = (msgBox_._y + msgBox_.height) + 8;
sendButton_.addEventListener("clicked", com.google.utils.DelegateEx.create(this, onSendClicked));
statusText_ = com.google.ui.common.StylishText(attachMovie(com.google.ui.common.StylishText.linkageName, "statusText_", getNextHighestDepth(), {size:13, color:16777215, style:com.google.ui.common.StylishText.NONE}));
statusText_._x = 12;
statusText_._y = (msgBox_._y + msgBox_.height) + 8;
statusText_.text = " ";
}
function moveFocusRect(newFocus) {
focusRect_.clear();
focusRect_.lineStyle(2, 3368601, 100);
com.google.ui.common.Drawing.drawRectangle(focusRect_, 0, 0, newFocus.__width + 4, newFocus.__height + 4, 2);
focusRect_._x = newFocus._x - 2;
focusRect_._y = newFocus._y - 2;
}
function set videoPubHost(val) {
videoPubHost_ = val;
//return(__get__videoPubHost());
}
function set videoContentPackageInfo(val) {
videoContentPackageInfo_ = val;
//return(__get__videoContentPackageInfo());
}
function onCloseClicked(evtObj) {
_global.clearInterval(hideTimer_);
statusText_.text = "";
toBox_.text = "";
dispatchEvent({type:"closeClicked"});
}
function updateMetadata(playlists) {
var _local3 = playlists.curItem;
videoTitle_.text = _local3.title;
videoTitle_._x = (300 - videoTitle_.width) / 2;
var _local4 = com.google.video.apps.MediaState.getRequestArgs(_local3.guid);
docid_ = _local4.docid;
}
function onSendClicked(evtObj) {
statusText_.text = "Sending ...";
var _local3 = new LoadVars();
if (receiveLoadVars_ != undefined) {
delete receiveLoadVars_;
receiveLoadVars_ = undefined;
}
receiveLoadVars_ = new LoadVars();
_local3.sendToSender = "false";
_local3.msg = msgBox_.text;
_local3.to = toBox_.text;
_local3.from = fromBox_.text;
_local3.docid = docid_;
if ((videoPubHost_ != undefined) && (videoPubHost_ != null)) {
_local3.videoPubHost = videoPubHost_;
}
if (videoContentPackageInfo_ != undefined) {
for (var key in videoContentPackageInfo_) {
_local3[key] = videoContentPackageInfo_[key];
}
}
var _local4 = com.google.webutil.url.Utils.getServerUrl(VGC_URL) + SHARE_PATH;
_local3.sendAndLoad(_local4, receiveLoadVars_, "POST");
receiveLoadVars_.onData = com.google.utils.DelegateEx.create(this, mailSendOnData);
}
function mailSendOnData(data) {
if (data.charAt(0) == SEND_MESSAGE_SUCCESS) {
statusText_.text = "E-mail sent!";
hideTimer_ = _global.setInterval(this, "onCloseClicked", SEND_MESSAGE_TIMER);
} else if (data.charAt(0) == SEND_MESSAGE_ERROR_FROM) {
statusText_.text = "Invalid from address!";
} else if (data.charAt(0) == SEND_MESSAGE_ERROR_TO) {
statusText_.text = "Invalid to address!";
} else {
statusText_.text = "Unable to send mail";
}
}
static var classPath = com.google.video.ui.ShareCard;
static var linkageName = "__Packages.com.google.video.ui.ShareCard";
static var forceLinkage = Object.registerClass(linkageName, classPath);
static var SEND_MESSAGE_SUCCESS = "0";
static var SEND_MESSAGE_ERROR_FROM = "1";
static var SEND_MESSAGE_ERROR_TO = "2";
static var SEND_MESSAGE_TIMER = 1500;
static var VGC_URL = "http://video.google.com";
static var SHARE_PATH = "/videosendlink?fp=2";
}
Symbol 20590 MovieClip [__Packages.com.google.ui.common.LinearInterpolator] Frame 0
class com.google.ui.common.LinearInterpolator
{
function LinearInterpolator () {
}
static function interpolate(obj, propertyName, targetValue, duration, callback, interval) {
var _local6 = function () {
return(obj[propertyName]);
};
var _local7 = function (val) {
obj[propertyName] = val;
if (obj instanceof MovieClip) {
obj.updateAfterEvent();
}
};
com.google.ui.common.FunctionLinearInterpolator.interpolate(_local6, _local7, targetValue, duration, callback, interval);
}
}
Symbol 20591 MovieClip [__Packages.com.google.media.VideoSource] Frame 0
class com.google.media.VideoSource implements com.google.media.IStreamingMediaSource
{
var timerID_, netConn_, netStream_, sourceUrl_, sourceStartTime_, sourceDuration_, isMP4_, rootSegment_, currentSegment_, target_, lastBufferStart_, lastBufferEnd_, lastPlayProgress_;
function VideoSource () {
mx.events.EventDispatcher.initialize(this);
timerID_ = _global.setInterval(this, "onInterval", 100);
netConn_ = new NetConnection();
netConn_.connect(null);
playState_ = ERROR;
}
function dispatchEvent() {
}
function addEventListener() {
}
function removeEventListener() {
}
function load(src, netStream) {
netStream_ = netStream;
loadRange(src, 0, 0);
}
function loadRange(srcUrl, startTime, endTime) {
sourceUrl_ = srcUrl;
sourceStartTime_ = 0;
sourceDuration_ = 0;
isMP4_ = false;
rootSegment_ = new com.google.media.VideoSegment();
rootSegment_.addEventListener("onStatus", com.google.utils.DelegateEx.create(this, onStatus));
rootSegment_.addEventListener("onMetaData", com.google.utils.DelegateEx.create(this, onMetaData));
rootSegment_.addEventListener("onTransition", com.google.utils.DelegateEx.create(this, onTransition));
rootSegment_.init(sourceUrl_, startTime, endTime, netConn_, netStream_);
currentSegment_ = rootSegment_;
onPlayStateChange(PAUSED, true);
dispatchEvent({type:"loadProgressChange"});
}
function attachTo(target) {
target_ = Video(target);
target_.attachVideo(currentSegment_.netStream);
}
function detach() {
target_.attachVideo(null);
}
function resume() {
currentSegment_.netStream.pause(false);
if ((currentSegment_.netStream.time < currentSegment_.startTime) && (!isMP4_)) {
currentSegment_.netStream.seek(currentSegment_.startTime);
}
onPlayStateChange(PLAYING, true);
ticksWithoutProgress_ = 0;
}
function pause() {
if (currentSegment_.readMetaDataTag) {
currentSegment_.netStream.pause(true);
}
onPlayStateChange(PAUSED, true);
}
function seek(time, allowNewUrl) {
if (getDuration() == 0) {
return(undefined);
}
time = Math.max(0, time);
time = Math.min(time, getDuration());
var _local4 = getBufferedRegion();
var _local5 = time / getDuration();
var _local6 = false;
if (_local5 < _local4.first) {
_local6 = true;
} else if (_local5 > _local4.second) {
_local6 = true;
} else if (_local4.second == 0) {
_local6 = true;
}
if (_local6 && (allowNewUrl)) {
var _local7 = Math.floor(time * 1000);
var _local8 = _local7 + Math.floor(sourceStartTime_ * 1000);
var _local9 = Math.floor((getDuration() * 1000) - _local7);
if (sourceUrl_.indexOf("/videoplayback") >= 0) {
var _local10 = com.google.webutil.url.Utils.setUrlParameter(sourceUrl_, "begin", _local8);
} else {
var _local10 = com.google.webutil.url.Utils.setUrlParameter(sourceUrl_, "begin", _local7);
}
var _local10 = com.google.webutil.url.Utils.setUrlParameter(_local10, "len", _local9);
currentSegment_.netStream.close();
delete currentSegment_;
currentSegment_ = new com.google.media.VideoSegment();
currentSegment_.addEventListener("onStatus", com.google.utils.DelegateEx.create(this, onStatus));
currentSegment_.addEventListener("onMetaData", com.google.utils.DelegateEx.create(this, onMetaData));
currentSegment_.addEventListener("onTransition", com.google.utils.DelegateEx.create(this, onTransition));
currentSegment_.init(_local10, _local8 / 1000, (_local8 + _local9) / 1000, netConn_, netStream_);
target_.attachVideo(currentSegment_.netStream);
var _local11 = new Object();
_local11.type = "onNewSegment";
_local11.time = time;
_local11.beginTime = _local8;
_local11.length = _local9;
dispatchEvent(_local11);
} else {
var _local12 = time + sourceStartTime_;
if (isMP4_) {
_local12 = _local12 - currentSegment_.startTime;
}
currentSegment_.netStream.seek(_local12);
var _local13 = getDimensionsAtTime(_local12);
if (_local13 != undefined) {
var _local14 = new Object();
_local14.type = "onAspectRatioChange";
_local14.target = this;
_local14.width = _local13.width;
_local14.height = _local13.height;
dispatchEvent(_local14);
}
}
}
function destroy() {
if (timerID_ != undefined) {
_global.clearInterval(timerID_);
}
detach();
currentSegment_.netStream.close();
delete currentSegment_;
delete rootSegment_;
}
function getBufferedRegion() {
if (currentSegment_.segmentBytes <= 0) {
return({first:0, second:0});
}
var _local2 = (currentSegment_.startTime - sourceStartTime_) / getDuration();
var _local3 = currentSegment_.netStream.bytesLoaded / currentSegment_.segmentBytes;
var _local4 = (_local3 * currentSegment_.segmentLength) / getDuration();
var _local5 = _local2 + _local4;
if (_global.isNaN(_local5) || (_local5 < _local2)) {
_local5 = _local2;
}
return({first:_local2, second:_local5});
}
function getPlayProgress() {
var _local2 = getTime() / getDuration();
return(_local2);
}
function getPlayState() {
return(playState_);
}
function getTime() {
if ((currentSegment_ != undefined) && (currentSegment_.netStream != undefined)) {
var _local2 = Math.max((currentSegment_.netStream.time - sourceStartTime_) + (isMP4_ ? (currentSegment_.startTime) : 0), currentSegment_.startTime - sourceStartTime_);
return(Math.max(0, _local2));
}
return(0);
}
function getDuration() {
return(Math.max(0, sourceDuration_));
}
function getCurrentUrl() {
return(sourceUrl_);
}
function getBytesLoaded() {
return(currentSegment_.netStream.bytesLoaded);
}
function getSegmentLength() {
return(currentSegment_.segmentBytes);
}
function getBufferEmptyEvents() {
return(bufferEmptyEvents);
}
function getRemainingDownloadTime(maxContentTime) {
var _local3 = getTimer();
if ((currentSegment_.netStream.bytesLoaded > 0) && (currentSegment_.firstReceivedTime == undefined)) {
currentSegment_.firstReceivedTime = _local3;
currentSegment_.firstReceivedSize = currentSegment_.netStream.bytesLoaded;
}
var _local4 = 0;
if (currentSegment_.firstReceivedTime) {
_local4 = (_local3 - currentSegment_.firstReceivedTime) / 1000;
}
if ((_local4 == 0) || (currentSegment_.segmentBytes == 0)) {
return(Number.POSITIVE_INFINITY);
}
var _local5 = currentSegment_.netStream.bytesLoaded - currentSegment_.firstReceivedSize;
var _local6 = _local5 / _local4;
var _local7 = (maxContentTime * currentSegment_.segmentBytes) / currentSegment_.segmentLength;
var _local8 = Math.min(currentSegment_.segmentBytes, _local7);
var _local9 = _local8 - currentSegment_.netStream.bytesLoaded;
if (_local9 <= 0) {
return(0);
}
var _local10 = Math.max(0, _local9 / _local6);
return(_local10);
}
function onStatus(infoObject) {
if (infoObject.level == "error") {
if (infoObject.code == "NetStream.Seek.InvalidTime") {
return(undefined);
}
dispatchEvent({type:"error", target:this});
onPlayStateChange(ERROR, false);
}
if (infoObject.target != currentSegment_) {
return(undefined);
}
infoObject.target = this;
dispatchEvent(infoObject);
if (infoObject.level == "status") {
if (infoObject.code == "NetStream.Play.Start") {
} else if (infoObject.code == "NetStream.Play.Stop") {
} else if (infoObject.code == "NetStream.Buffer.Empty") {
if (Math.ceil(getDuration()) != Math.ceil(getTime())) {
bufferEmptyEvents++;
}
dispatchEvent({type:"bufferEmptied", target:this});
}
}
}
function onMetaData(infoObject) {
if (playState_ != PLAYING) {
currentSegment_.netStream.pause(true);
}
if (infoObject.target == rootSegment_) {
isMP4_ = infoObject.moovposition != undefined;
if (infoObject.starttime != undefined) {
sourceStartTime_ = infoObject.starttime;
} else {
sourceStartTime_ = 0;
}
sourceDuration_ = infoObject.duration;
}
infoObject.target = this;
dispatchEvent(infoObject);
}
function onTransition(infoObject) {
infoObject.target = this;
infoObject.type = "onAspectRatioChange";
dispatchEvent(infoObject);
}
function onInterval() {
var _local2 = getBufferedRegion();
var _local3 = _local2.second;
var _local4 = {type:"loadProgressChange", target:this};
_local4.value = _local3;
_local4.bufferStart = _local2.first;
if (_local2.second > 1) {
_local2.second = 1;
}
_local4.bufferEnd = _local2.second;
if ((_local4.bufferStart != lastBufferStart_) || (_local4.bufferEnd != lastBufferEnd_)) {
dispatchEvent(_local4);
lastBufferStart_ = _local4.bufferStart;
lastBufferEnd_ = _local4.bufferEnd;
}
var _local5 = getPlayProgress();
if (_global.isNaN(_local5)) {
_local5 = 0;
} else if (_local5 != lastPlayProgress_) {
_local4 = {type:"playProgressChange", target:this};
_local4.value = _local5;
dispatchEvent(_local4);
lastPlayProgress_ = _local5;
ticksWithoutProgress_ = 0;
} else if (playState_ == PLAYING) {
ticksWithoutProgress_++;
var _local6 = Math.max(0, getDuration() - getTime());
if ((getDuration() != 0) && (((ticksWithoutProgress_ > STOP_TICK_COUNT) && (_local6 < STOP_TIME_WINDOW)) || (_local6 == 0))) {
currentSegment_.netStream.pause(true);
onPlayStateChange(PAUSED, false);
}
}
}
function onPlayStateChange(newState, requested) {
if (playState_ != newState) {
playState_ = newState;
var _local4 = new Object();
_local4.type = "playStateChange";
_local4.target = this;
_local4.value = playState_;
_local4.requested = requested;
dispatchEvent(_local4);
}
}
function getDimensionsAtTime(timestamp) {
var _local3 = currentSegment_.transitions;
var _local4 = 0;
var _local5 = 0;
for ( ; _local5 < _local3.length ; _local5++) {
if (timestamp > _local3[_local5].timestamp) {
_local4 = _local5;
}
}
return(((_local4 < _local3.length) ? (_local3[_local4]) : undefined));
}
static var ALLOW_NEW_URL = true;
static var PROHIBIT_NEW_URL = false;
static var PLAYING = "playing";
static var PAUSED = "paused";
static var ERROR = "error";
static var STOP_TICK_COUNT = 3;
static var STOP_TIME_WINDOW = 1;
var playState_ = ERROR;
var ticksWithoutProgress_ = 0;
var bufferEmptyEvents = 0;
}