2023-08-24 20:29:11 +00:00
|
|
|
<template>
|
2023-08-27 18:01:26 +00:00
|
|
|
<div v-if="episode" class="footer">
|
|
|
|
<audio id="audio-player"
|
|
|
|
autoplay
|
|
|
|
preload
|
|
|
|
:src="episode.episodeUrl"
|
2023-08-27 18:29:54 +00:00
|
|
|
@durationchange="duration = audio.duration"
|
2023-08-27 18:01:26 +00:00
|
|
|
@loadeddata="loading = false"
|
|
|
|
@pause="paused = audio.paused"
|
|
|
|
@play="paused = audio.paused"
|
|
|
|
@seeked="currentTime = audio.currentTime"
|
2023-08-27 18:29:54 +00:00
|
|
|
@timeupdate="currentTime = audio.currentTime"
|
2023-08-27 18:01:26 +00:00
|
|
|
@volumechange="volume = audio.volume" />
|
|
|
|
<NcLoadingIcon v-if="loading" />
|
2023-08-27 20:20:34 +00:00
|
|
|
<ProgressBar v-if="!loading"
|
|
|
|
:current-time="currentTime"
|
|
|
|
:duration="duration" />
|
2023-08-27 18:01:26 +00:00
|
|
|
<div v-if="!loading" class="player">
|
|
|
|
<img :src="episode.episodeImage">
|
2023-08-27 20:20:34 +00:00
|
|
|
<Infos />
|
|
|
|
<Controls :paused="paused" />
|
|
|
|
<Timer class="timer"
|
|
|
|
:current-time="currentTime"
|
|
|
|
:duration="duration" />
|
|
|
|
<Volume class="volume" :volume="volume" />
|
2023-08-24 21:19:54 +00:00
|
|
|
</div>
|
2023-08-27 18:01:26 +00:00
|
|
|
</div>
|
2023-08-24 20:29:11 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2023-08-27 20:20:34 +00:00
|
|
|
import Controls from './Controls.vue'
|
|
|
|
import Infos from './Infos.vue'
|
|
|
|
import { NcLoadingIcon } from '@nextcloud/vue'
|
|
|
|
import ProgressBar from './ProgressBar.vue'
|
|
|
|
import Timer from './Timer.vue'
|
|
|
|
import Volume from './Volume.vue'
|
2023-08-27 10:45:19 +00:00
|
|
|
|
2023-08-24 20:29:11 +00:00
|
|
|
export default {
|
|
|
|
name: 'Bar',
|
2023-08-27 10:45:19 +00:00
|
|
|
components: {
|
2023-08-27 20:20:34 +00:00
|
|
|
Controls,
|
|
|
|
Infos,
|
2023-08-27 18:01:26 +00:00
|
|
|
NcLoadingIcon,
|
2023-08-27 20:20:34 +00:00
|
|
|
ProgressBar,
|
|
|
|
Timer,
|
|
|
|
Volume,
|
2023-08-27 10:45:19 +00:00
|
|
|
},
|
2023-08-27 18:01:26 +00:00
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
currentTime: 0,
|
2023-08-27 18:29:54 +00:00
|
|
|
duration: 0,
|
2023-08-27 18:01:26 +00:00
|
|
|
loading: true,
|
|
|
|
paused: true,
|
2023-08-27 19:33:39 +00:00
|
|
|
volume: 1,
|
2023-08-27 18:01:26 +00:00
|
|
|
}
|
|
|
|
},
|
2023-08-24 20:29:11 +00:00
|
|
|
computed: {
|
2023-08-27 10:45:19 +00:00
|
|
|
audio() {
|
2023-08-27 18:01:26 +00:00
|
|
|
return document.getElementById('audio-player')
|
2023-08-27 10:45:19 +00:00
|
|
|
},
|
2023-08-24 21:19:54 +00:00
|
|
|
episode() {
|
|
|
|
return this.$store.state.player.episode
|
2023-08-24 20:29:11 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
2023-08-24 21:19:54 +00:00
|
|
|
.footer {
|
2023-08-27 10:45:19 +00:00
|
|
|
background-color: rgba(66, 66, 66, .9);
|
2023-08-24 21:59:55 +00:00
|
|
|
bottom: 0;
|
2023-08-27 10:45:19 +00:00
|
|
|
height: 6rem;
|
2023-08-24 21:59:55 +00:00
|
|
|
right: 0;
|
2023-08-24 20:29:11 +00:00
|
|
|
position: absolute;
|
|
|
|
width: 100%;
|
2023-08-24 21:59:55 +00:00
|
|
|
z-index: 2000;
|
2023-08-24 20:29:11 +00:00
|
|
|
}
|
2023-08-27 10:45:19 +00:00
|
|
|
|
|
|
|
.player {
|
|
|
|
display: flex;
|
|
|
|
gap: 1rem;
|
|
|
|
height: calc(6rem - 6px);
|
2023-08-27 19:33:39 +00:00
|
|
|
justify-content: space-between;
|
2023-08-27 10:45:19 +00:00
|
|
|
}
|
2023-08-27 18:01:26 +00:00
|
|
|
|
2023-08-27 20:20:34 +00:00
|
|
|
.timer {
|
2023-08-27 19:33:39 +00:00
|
|
|
width: 25%;
|
|
|
|
}
|
|
|
|
|
|
|
|
.volume {
|
|
|
|
width: 10%;
|
|
|
|
}
|
2023-08-24 20:29:11 +00:00
|
|
|
</style>
|