Skip to content
This repository has been archived by the owner on May 24, 2021. It is now read-only.

Commit

Permalink
Merge pull request #359 from alexander-heimbuch/fix/baseurl
Browse files Browse the repository at this point in the history
fix(baseurl): Provide base url as asset base
  • Loading branch information
alexander-heimbuch authored Apr 15, 2017
2 parents cde98e5 + 3052775 commit dedfad7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
16 changes: 8 additions & 8 deletions src/embed/embed.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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))
}
6 changes: 4 additions & 2 deletions statics/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,15 @@ <h1>Configuration</h1>
<tr><th colspan="2">References</th></tr>
</thead>
<tbody>
<tr><td>reference.config</td><td>Reference to the Current Configuration</td></tr>
<tr><td>reference.share</td><td>Reference Sharing Embed Endpoint</td></tr>
<tr><td>reference.base</td><td>Reference to webplayer base, if not provided it falls back to the current url</td></tr>
<tr><td>reference.config</td><td>Reference to the current configuration</td></tr>
<tr><td>reference.share</td><td>Reference sharing embed endpoint</td></tr>
</tbody>
</table>

<pre><code class="language-js">{
reference: {
base: &#x27;//podlove-player.surge.sh&#x27;,
config: &#x27;//podlove-player.surge.sh/fixtures/example.json&#x27;,
share: &#x27;//podlove-player.surge.sh/share&#x27;
}
Expand Down

0 comments on commit dedfad7

Please sign in to comment.