From 8b9765093611059f68045cac4f15d9169c3d1949 Mon Sep 17 00:00:00 2001 From: rolux Date: Fri, 23 Dec 2011 15:08:04 +0000 Subject: [PATCH] fix a bug regarding opening the tv program in video view when the video position for that item had never been set before --- static/js/pandora/tv.js | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/static/js/pandora/tv.js b/static/js/pandora/tv.js index 15429360..58e1cebf 100644 --- a/static/js/pandora/tv.js +++ b/static/js/pandora/tv.js @@ -53,14 +53,20 @@ pandora.ui.tv = function() { pandora.UI.set('videoMuted', data.muted); }, open: function() { - var set = { - item: result.data.item, - itemView: pandora.user.ui.videoView, - page: '' - }; - set[ - 'videoPoints.' + result.data.item + '.position' - ] = $player.options('position'); + var item = result.data.item, + position = $player.options('position'), + set = { + item: item, + itemView: pandora.user.ui.videoView, + page: '' + }; + if (pandora.user.ui.videoPoints[item]) { + set['videoPoints.' + item + '.position'] = position; + } else { + set['videoPoints.' + item] = { + 'in': 0, out: 0, position: position + }; + } pandora.UI.set(set); }, resolution: function(data) {