Permalink
Browse files

Set background context for the containing iframe if possible

  • Loading branch information...
1 parent 3560b04 commit 758fafbbe5ae1835c40df49014620f70995e1809 @steffentchr committed Apr 1, 2012
Showing with 11 additions and 2 deletions.
  1. +3 −2 src/ActiveElement.as
  2. +1 −0 src/AppProperties.as
  3. +7 −0 src/Utility.as
View
@@ -44,6 +44,7 @@ private function resetActiveElement(skip:Boolean=false):void {
showBeforeIdentity = true;
showVideoAd = true;
liveStreamsMenu.value = null;
+ updateBackground();
if(!skip) {
progress.setSections([]);
@@ -86,15 +87,14 @@ private function setActiveElementToLiveStream(stream:Object, startPlaying:Boolea
// Make embed code current
updateCurrentVideoEmbedCode();
-
+ updateBackground();
// We want the tray and possible the info box to show up when a new element starts playing
infoShow();
trayShow();
// Note that we've loaded the video
reportEvent('load');
-
}
private function setActiveElement(i:int, startPlaying:Boolean=false, start:Number=0, skip:int=0, format:String=null):Boolean {
@@ -203,6 +203,7 @@ private function setActiveElement(i:int, startPlaying:Boolean=false, start:Numbe
// Make embed code current
updateCurrentVideoEmbedCode();
+ updateBackground();
// We want the tray and possible the info box to show up when a new element starts playing
infoShow();
View
@@ -152,6 +152,7 @@ private function initProperties(settings:Object):void {
props.put('logoVAlign', (new RegExp('top').test(pos) ? 'top' : 'bottom'));
props.put('settingsLoaded', true);
+ updateBackground();
// Tray and information timeout
trayTimer.delay = props.getNumber('trayTimeout');
View
@@ -59,3 +59,10 @@ public function goToUrl(url:String, target:String = '_top'):void {
if(!new RegExp('\:\/\/').test(url)) url = props.get('site_url') + url;
navigateToURL(new URLRequest(url), target);
}
+public function updateBackground():void {
+ try {
+ if(ExternalInterface.available) {
+ ExternalInterface.call('setBackground', props.getString('backgroundColor'), activeElement.get('photoSource'), props.getNumber('verticalPadding'), props.getNumber('horitzontalPadding'));
+ }
+ } catch(e:Error) {}
+}

0 comments on commit 758fafb

Please sign in to comment.