fix issues with home and tv

This commit is contained in:
rolux 2012-02-19 12:58:49 +00:00
parent dfd3a4481f
commit d51deff865
5 changed files with 25 additions and 5 deletions

View file

@ -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

View file

@ -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;

View file

@ -11,7 +11,7 @@ pandora.ui.home = function() {
width: '100%',
height: '100%',
opacity: 0,
zIndex: 1000
zIndex: 1001
}),
$reflectionImage = $('<img>')
.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;
};

View file

@ -12,7 +12,7 @@ pandora.ui.home = function() {
width: '100%',
height: '100%',
opacity: 0,
zIndex: 1000
zIndex: 1001
}),
$box = $('<div>')
.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;
};

View file

@ -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;
}