Fix #875 Broken embed (develop)
This commit is contained in:
parent
2de5c32a54
commit
1a205c0e02
|
@ -0,0 +1 @@
|
||||||
|
Fixed broken embedded player layout after dependency update (#875)
|
|
@ -1,4 +1,4 @@
|
||||||
FROM node:9
|
FROM node:11
|
||||||
|
|
||||||
# needed to compile translations
|
# 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
|
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>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
@import "~plyr/src/sass/plyr.scss";
|
||||||
|
|
||||||
html,
|
html,
|
||||||
body,
|
body,
|
||||||
main {
|
main {
|
||||||
|
|
|
@ -58,9 +58,19 @@ export default {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
iframeSrc () {
|
iframeSrc () {
|
||||||
return this.$store.getters['instance/absoluteUrl'](
|
let base = process.env.BASE_URL
|
||||||
`/front/embed.html?&type=${this.type}&id=${this.id}`
|
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 () {
|
frameWidth () {
|
||||||
if (this.width) {
|
if (this.width) {
|
||||||
|
|
Loading…
Reference in New Issue