diff --git a/src/embed/embed.js b/src/embed/embed.js index 527112483..6c09f8846 100644 --- a/src/embed/embed.js +++ b/src/embed/embed.js @@ -91,7 +91,7 @@ const configNode = (config = {}) => .then(config => tag('script', `window.PODLOVE = ${JSON.stringify(config)}`)) // Player Logic -const appLogic = tag('script', '', {type: 'text/javascript', src: './window.js'}) +const appLogic = config => tag('script', '', {type: 'text/javascript', src: `${get(config.reference, 'base', '.')}/window.js`}) // Dynamic resizer const dynamicResizer = tag('script', iframeResizerContentWindow) @@ -104,11 +104,11 @@ window.podlovePlayer = (selector, config) => { const anchor = typeof selector === 'string' ? head(findNode(selector)) : selector return Bluebird.all([ - playerEntry, - configNode(config), - appLogic, - dynamicResizer - ]) - .then(result => result.join('')) - .then(renderPlayer(anchor)) + playerEntry, + configNode(config), + appLogic(config), + dynamicResizer + ]) + .then(result => result.join('')) + .then(renderPlayer(anchor)) } diff --git a/statics/config.html b/statics/config.html index 833f4808b..33209406f 100644 --- a/statics/config.html +++ b/statics/config.html @@ -129,13 +129,15 @@

Configuration

References - reference.configReference to the Current Configuration - reference.shareReference Sharing Embed Endpoint + reference.baseReference to webplayer base, if not provided it falls back to the current url + reference.configReference to the current configuration + reference.shareReference sharing embed endpoint
{
     reference: {
+        base: '//podlove-player.surge.sh',
         config: '//podlove-player.surge.sh/fixtures/example.json',
         share: '//podlove-player.surge.sh/share'
     }