Fix before refacto player
All checks were successful
repod / nextcloud (push) Successful in 1m12s
repod / nodejs (push) Successful in 1m47s

This commit is contained in:
Michel Roux 2023-08-24 23:19:54 +02:00
parent fb21092dff
commit e1e93771ff
5 changed files with 36 additions and 19 deletions

View File

@ -1,5 +1,5 @@
<template> <template>
<router-link :to="toUrl(link)"> <router-link :to="toUrl">
<img :alt="`${title} - ${author}`" <img :alt="`${title} - ${author}`"
:src="imageUrl" :src="imageUrl"
:title="author"> :title="author">
@ -28,9 +28,9 @@ export default {
required: true, required: true,
}, },
}, },
methods: { computed: {
toUrl(url) { toUrl() {
return `/${btoa(url)}` return `/${btoa(this.link)}`
}, },
}, },
} }

View File

@ -17,7 +17,7 @@
{{ format(new Date(episode.episodeDuration*1000), 'H:mm:ss') }} {{ format(new Date(episode.episodeDuration*1000), 'H:mm:ss') }}
</template> </template>
<template #actions> <template #actions>
<NcActionButton> <NcActionButton @click="play(episode)">
<template #icon> <template #icon>
<Play :size="20" /> <Play :size="20" />
</template> </template>
@ -73,6 +73,9 @@ export default {
methods: { methods: {
format, format,
formatTimeAgo, formatTimeAgo,
play(episode) {
this.$store.commit('player/play', episode)
},
}, },
} }
</script> </script>

View File

@ -1,7 +1,12 @@
<template> <template>
<div v-if="currentPlayingUrl" class="oui"> <fragment>
<div v-if="episode" class="footer">
<img class="background" :src="episode.episodeImage">
<div class="content">
{{ 'oui' }} {{ 'oui' }}
</div> </div>
</div>
</fragment>
</template> </template>
<script> <script>
@ -9,20 +14,29 @@ export default {
name: 'Bar', name: 'Bar',
components: {}, components: {},
computed: { computed: {
currentPlayingUrl() { episode() {
return this.$store.state.currentPlayingUrl return this.$store.state.player.episode
}, },
}, },
} }
</script> </script>
<style scoped> <style scoped>
.oui { .footer {
position: relative;
}
.background {
filter: blur(5rem) brightness(50%);
height: auto;
left: 0;
opacity: .4;
position: absolute; position: absolute;
bottom: 0; top: 0;
width: 100%; width: 100%;
height: 4rem; }
background-color: red;
z-index: 1001; .content {
position: relative;
} }
</style> </style>

View File

@ -1,11 +1,11 @@
export const player = { export const player = {
namespaced: true, namespaced: true,
state: { state: {
currentPlayingUrl: null, episode: null,
}, },
mutations: { mutations: {
set: (state, currentPlayingUrl) => { play: (state, episode) => {
state.currentPlayingUrl = currentPlayingUrl state.episode = episode
}, },
}, },
} }

View File

@ -17,7 +17,7 @@
</ul> </ul>
</NcAppContentList> </NcAppContentList>
</NcAppNavigation> </NcAppNavigation>
<router-view /> <router-view :key="$route.path" />
<Bar /> <Bar />
</fragment> </fragment>
</template> </template>