From b1a2363472ed98bf4080baec295c9e26afaabc31 Mon Sep 17 00:00:00 2001 From: rolux Date: Tue, 12 Feb 2013 13:53:50 +0530 Subject: [PATCH] don't use playInToOut option --- static/js/embed/pandora.js | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/static/js/embed/pandora.js b/static/js/embed/pandora.js index edc6d425f..3c3f385c9 100755 --- a/static/js/embed/pandora.js +++ b/static/js/embed/pandora.js @@ -42,7 +42,7 @@ Ox.load('UI', { height: window.innerHeight, invertHighlight: true, paused: options.paused, - playInToOut: true, + // playInToOut: true, poster: '/' + options.item + '/' + '96p' + data.posterFrame +'.jpg', resolution: pandora.user.ui.videoResolution, showMarkers: false, @@ -59,7 +59,7 @@ Ox.load('UI', { } : {}, options.out ? { out: options.out } : {})) - .bindEvent({ + .bindEvent(Ox.extend({ open: function() { pandora.$player.options({paused: true}); var url = document.location.protocol + '//' @@ -74,7 +74,10 @@ Ox.load('UI', { fullscreen: function(data) { Ox.Fullscreen.toggle(); } - }) + }, options['in'] || options.out ? { + playing: checkRange, + position: checkRange + } : {})) ); Ox.UI.hideLoadingScreen(); }); @@ -129,6 +132,17 @@ Ox.load('UI', { } } }); + function checkRange(data) { + if ( + data.position < options['in'] - 0.04 + || data.position > options.out + ) { + if (!pandora.$player.options('paused')) { + pandora.$player.togglePaused(); + } + pandora.$player.options({position: options['in']}); + } + } Ox.extend(pandora.user, { videoFormat: Ox.UI.getVideoFormat(pandora.site.video.formats) });