Skip to content
Snippets Groups Projects
Commit 1a205c0e authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Fix #875 Broken embed (develop)

parent 2de5c32a
No related branches found
No related tags found
No related merge requests found
Fixed broken embedded player layout after dependency update (#875)
FROM node:9
FROM node:11
# needed to compile translations
RUN curl -L -o /usr/local/bin/jq https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 && chmod +x /usr/local/bin/jq
......
......@@ -374,6 +374,8 @@ export default {
</script>
<style lang="scss">
@import "~plyr/src/sass/plyr.scss";
html,
body,
main {
......
......@@ -58,9 +58,19 @@ export default {
},
computed: {
iframeSrc () {
return this.$store.getters['instance/absoluteUrl'](
`/front/embed.html?&type=${this.type}&id=${this.id}`
)
let base = process.env.BASE_URL
if (base.startsWith('/')) {
// include hostname/protocol too so that the iframe link is absolute
base = `${window.location.protocol}//${window.location.host}${base}`
}
let instanceUrl = this.$store.state.instance.instanceUrl
let b = ''
if (!window.location.href.startsWith(instanceUrl)) {
// the frontend is running on a separate domain, so we need to provide
// the b= parameter in the iframe
b = `&b=${instanceUrl}`
}
return `${base}embed.html?&type=${this.type}&id=${this.id}${b}`
},
frameWidth () {
if (this.width) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment