Fix embed widget not working

This commit is contained in:
Marcos Peña 2022-06-13 09:53:36 +00:00 committed by Georg Krause
parent 86d73067da
commit 95b5b99484
7 changed files with 18 additions and 8 deletions

View File

@ -162,7 +162,7 @@ FUNKWHALE_SPA_HTML_CACHE_DURATION = env.int(
"FUNKWHALE_SPA_HTML_CACHE_DURATION", default=60 * 15 "FUNKWHALE_SPA_HTML_CACHE_DURATION", default=60 * 15
) )
FUNKWHALE_EMBED_URL = env( FUNKWHALE_EMBED_URL = env(
"FUNKWHALE_EMBED_URL", default=FUNKWHALE_URL + "/front/embed.html" "FUNKWHALE_EMBED_URL", default=FUNKWHALE_URL + "/front/embed/"
) )
FUNKWHALE_SPA_REWRITE_MANIFEST = env.bool( FUNKWHALE_SPA_REWRITE_MANIFEST = env.bool(
"FUNKWHALE_SPA_REWRITE_MANIFEST", default=True "FUNKWHALE_SPA_REWRITE_MANIFEST", default=True

View File

@ -0,0 +1 @@
Fixes embed player (#1783) (1783)

View File

@ -6,8 +6,9 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta name="generator" content="Funkwhale"> <meta name="generator" content="Funkwhale">
<link rel="icon" href="<%= BASE_URL %>favicon.png"> <link rel="icon" href="/favicon.png">
<title>Funkwhale Widget</title> <title>Funkwhale Widget</title>
<script type="module" src="/src/embed/embed.js"></script>
</head> </head>
<body> <body>

View File

@ -292,7 +292,7 @@ export default {
return this.object.tracks_count return this.object.tracks_count
}, },
isChannel () { isChannel () {
return this.object.artist.channel !== null return !!this.object.artist.channel
}, },
isSerie () { isSerie () {
return this.object.artist.content_category === 'podcast' return this.object.artist.content_category === 'podcast'

View File

@ -43,7 +43,7 @@
<img <img
v-else v-else
height="120" height="120"
src="./assets/embed/default-cover.jpeg" src="@/assets/embed/default-cover.jpeg"
alt="Cover" alt="Cover"
> >
</aside> </aside>
@ -246,7 +246,7 @@
<script> <script>
import axios from 'axios' import axios from 'axios'
import Logo from '@/components/Logo' import Logo from '@/components/Logo.vue'
import url from '@/utils/url' import url from '@/utils/url'
import time from '@/utils/time' import time from '@/utils/time'
@ -259,6 +259,7 @@ function getURLParams () {
const query = window.location.search.substring(1) const query = window.location.search.substring(1)
while ((match = search.exec(query)) !== null) { urlParams[decode(match[1])] = decode(match[2]) } while ((match = search.exec(query)) !== null) { urlParams[decode(match[1])] = decode(match[2]) }
return urlParams return urlParams
} }
export default { export default {
@ -529,7 +530,7 @@ export default {
</script> </script>
<style lang="scss"> <style lang="scss">
@import "~plyr/src/sass/plyr.scss"; @import "plyr/src/sass/plyr.scss";
html, html,
body, body,

View File

@ -1,12 +1,11 @@
import Vue from 'vue' import Vue from 'vue'
import EmbedFrame from './EmbedFrame' import EmbedFrame from './EmbedFrame.vue'
import VuePlyr from 'vue-plyr' import VuePlyr from 'vue-plyr'
Vue.use(VuePlyr) Vue.use(VuePlyr)
Vue.config.productionTip = false Vue.config.productionTip = false
/* eslint-disable no-new */ /* eslint-disable no-new */
new Vue({ new Vue({
el: '#app', el: '#app',

View File

@ -30,4 +30,12 @@ export default defineConfig({
"@": path.resolve(__dirname, "./src"), "@": path.resolve(__dirname, "./src"),
}, },
}, },
build: {
rollupOptions: {
input: {
main: path.resolve(__dirname, './index.html'),
embed: path.resolve(__dirname, './embed.html')
}
}
}
}) })