From 63713cf4c90ad776e83b56ec4395e141150a9607 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Wed, 15 Feb 2012 06:39:55 +0000 Subject: [PATCH] check playback range, save resolution changes --- static/js/embed/pandora.js | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/static/js/embed/pandora.js b/static/js/embed/pandora.js index 360f2cee..9437a4af 100755 --- a/static/js/embed/pandora.js +++ b/static/js/embed/pandora.js @@ -41,6 +41,7 @@ Ox.load('UI', { paused: options.paused, position: options['in'], poster: '/' + options.item + '/' + '128p' + options['in'] +'.jpg', + resolution: pandora.user.ui.videoResolution, showMarkers: false, showMilliseconds: 0, timeline: '/' + options.item + '/' + 'timeline16p.png', @@ -49,20 +50,26 @@ Ox.load('UI', { width: document.width }) .bindEvent({ - position: function(data) { - if(data.position options.out) { - if(!pandora.player.options('paused')) { - pandora.player.togglePaused(); - } - pandora.player.options({ - position: options['in'], - }); - } - } + playing: checkRange, + position: checkRange, + resolution: function(data) { + pandora.api.setUI({'videoResolution': data.resolution}); + }, }) ); Ox.UI.hideLoadingScreen(); + + function checkRange(data) { + if(data.position < options['in'] + || data.position > options.out) { + if(!pandora.player.options('paused')) { + pandora.player.togglePaused(); + } + pandora.player.options({ + position: options['in'], + }); + } + } }); return that; }