From 2f28df6109eb790d748cede3f6b4ec4190a7484e Mon Sep 17 00:00:00 2001 From: rolux Date: Tue, 12 Feb 2013 17:12:12 +0530 Subject: [PATCH] embed player: add 'showCloseButton' option, post event messages --- static/js/embed/pandora.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/static/js/embed/pandora.js b/static/js/embed/pandora.js index a77763695..35b211952 100755 --- a/static/js/embed/pandora.js +++ b/static/js/embed/pandora.js @@ -26,8 +26,12 @@ Ox.load('UI', { censoredIcon: pandora.site.cantPlay.icon, censoredTooltip: pandora.site.cantPlay.text, controlsTooltips: {open: 'Watch on ' + pandora.site.site.name}, - controlsTop: (Ox.Fullscreen.available ? ['fullscreen'] : []).concat( - ['space', 'open'] + controlsTop: (options.showCloseButton ? ['close'] : []).concat( + ['space'] + ).concat( + Ox.Fullscreen.available ? ['fullscreen'] : [] + ).concat( + ['open'] ), controlsBottom: ['play', 'volume', 'scale', 'timeline', 'position', 'settings'], duration: data.duration, @@ -79,6 +83,12 @@ Ox.load('UI', { playing: checkRange, position: checkRange } : {})) + .bindEvent(function(data, event) { + window.postMessage(JSON.stringify({ + event: event, + data: data + }), '*'); + }); ); Ox.UI.hideLoadingScreen(); });