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

Merge branch 'broken-embed' into 'develop'

Fix #875 Broken embed (develop)

Closes #875

See merge request funkwhale/funkwhale!825
parents 2de5c32a 1a205c0e
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 # 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 { ...@@ -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 { ...@@ -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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment