diff --git a/static/js/pandora/URL.js b/static/js/pandora/URL.js index a7a2efa30..11bc28ac4 100644 --- a/static/js/pandora/URL.js +++ b/static/js/pandora/URL.js @@ -260,7 +260,7 @@ pandora.URL = (function() { pandora.$ui.home.fadeOutScreen(); } else if (pandora.$ui.tv) { pandora.UI.set({page: ''}); - pandora.$ui.home.fadeOutScreen(); + pandora.$ui.tv.fadeOutScreen(); } if ( pandora.user.ui.item diff --git a/static/js/pandora/appPanel.js b/static/js/pandora/appPanel.js index 9bcd7998e..5dfd42960 100644 --- a/static/js/pandora/appPanel.js +++ b/static/js/pandora/appPanel.js @@ -37,6 +37,10 @@ pandora.ui.appPanel = function() { }); function setPage(page) { if (page === '') { + if (pandora.$ui.home && pandora.$ui.appPanel) { + // unless we're on page load, remove home screen + pandora.$ui.home.fadeOutScreen(); + } ['site', 'account', 'preferences', 'help'].forEach(function(dialog) { pandora.$ui[dialog + 'Dialog'] && pandora.$ui[dialog + 'Dialog'].close(); }); @@ -81,6 +85,7 @@ pandora.ui.appPanel = function() { pandora.$ui.tv = pandora.ui.tv()[ !pandora.$ui.appPanel ? 'showScreen' : 'fadeInScreen' ](); + pandora.$ui.home && pandora.$ui.tv.mute(); } } return that; diff --git a/static/js/pandora/home.js b/static/js/pandora/home.js index 0fef1542b..6ecaf9f50 100644 --- a/static/js/pandora/home.js +++ b/static/js/pandora/home.js @@ -11,7 +11,7 @@ pandora.ui.home = function() { width: '100%', height: '100%', opacity: 0, - zIndex: 1000 + zIndex: 1001 }), $reflectionImage = $('') .attr({src: '/static/png/logo256.png'}) @@ -260,6 +260,7 @@ pandora.ui.home = function() { that.animate({opacity: 0}, 500, function() { that.remove(); }); + pandora.$ui.tv && pandora.$ui.tv.unmute(); return that; }; diff --git a/static/js/pandora/home.padma.js b/static/js/pandora/home.padma.js index e49fe0904..979b563c1 100644 --- a/static/js/pandora/home.padma.js +++ b/static/js/pandora/home.padma.js @@ -12,7 +12,7 @@ pandora.ui.home = function() { width: '100%', height: '100%', opacity: 0, - zIndex: 1000 + zIndex: 1001 }), $box = $('
') .css({ @@ -573,6 +573,7 @@ pandora.ui.home = function() { that.animate({opacity: 0}, 500, function() { that.remove(); }); + pandora.$ui.tv && pandora.$ui.tv.unmute(); self.keydown && Ox.$document.unbind({keydown: self.keydown}); return that; }; diff --git a/static/js/pandora/tv.js b/static/js/pandora/tv.js index 7d6557f36..f466be4a3 100644 --- a/static/js/pandora/tv.js +++ b/static/js/pandora/tv.js @@ -15,7 +15,8 @@ pandora.ui.tv = function() { }), $player, list = pandora.user.ui._list, - lists = []; + lists = [], + muted; function getList(direction) { lists.length == 0 && getLists(); @@ -54,6 +55,7 @@ pandora.ui.tv = function() { enableSubtitles: pandora.user.ui.videoSubtitles, fullscreen: true, logo: pandora.site.tv.showLogo ? '/static/png/logo256.png' : '', + muted: muted || pandora.user.ui.videoMuted, position: result.data.position, resolution: pandora.user.ui.videoResolution, scaleToFill: pandora.user.ui.videoScale == 'fill', @@ -73,7 +75,8 @@ pandora.ui.tv = function() { close: that.fadeOutScreen, ended: play, muted: function(data) { - pandora.UI.set('videoMuted', data.muted); + Ox.print('!MUTED', !muted) + !muted && pandora.UI.set('videoMuted', data.muted); }, open: function() { var item = result.data.item, @@ -150,12 +153,22 @@ pandora.ui.tv = function() { return that; }; + that.mute = function() { + muted = true; + $player && $player.options({muted: muted}); + }; + that.showScreen = function() { that.css({opacity: 1}).appendTo(Ox.UI.$body); play(); return that; }; + that.unmute = function() { + $player && $player.options({muted: pandora.user.ui.videoMuted}); + muted = false; + }; + return that; }