From fac583b968cd52a1bc6930273e7a93d1e6ec8e51 Mon Sep 17 00:00:00 2001 From: rolux Date: Mon, 11 Feb 2013 18:13:42 +0530 Subject: [PATCH] add 'open' control to embedded player --- static/js/embed/pandora.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/static/js/embed/pandora.js b/static/js/embed/pandora.js index eaca48231..7034fd2ec 100755 --- a/static/js/embed/pandora.js +++ b/static/js/embed/pandora.js @@ -21,11 +21,14 @@ Ox.load('UI', { pandora.user.ui.item = options.item; pandora.api.get({id: options.item, keys: videoKeys}, function(result) { var data = getVideoOptions(result.data); - that.append(pandora.player = Ox.VideoPlayer({ + that.append(pandora.$player = Ox.VideoPlayer({ censored: data.censored, censoredIcon: pandora.site.cantPlay.icon, censoredTooltip: pandora.site.cantPlay.text, - controlsTop: Ox.Fullscreen.available ? ['fullscreen'] : [], + controlsTooltips: {open: 'Open in ' + pandora.site.site.name}, + controlsTop: (Ox.Fullscreen.available ? ['fullscreen'] : []).concat( + ['space', 'open'] + ), controlsBottom: ['play', 'volume', 'scale', 'timeline', 'settings'], duration: data.duration, enableFind: false, @@ -51,6 +54,9 @@ Ox.load('UI', { width: window.innerWidth }) .bindEvent({ + open: function() { + pandora.$player.options({paused: true}); + }, playing: checkRange, position: checkRange, resolution: function(data) { @@ -120,10 +126,10 @@ Ox.load('UI', { data.position < options['in'] - 0.04 || data.position > options.out ) { - if (!pandora.player.options('paused')) { - pandora.player.togglePaused(); + if (!pandora.$player.options('paused')) { + pandora.$player.togglePaused(); } - pandora.player.options({ + pandora.$player.options({ position: options['in'] }); }