player refresh

This commit is contained in:
bkfox
2022-03-28 15:02:02 +02:00
parent af7289614f
commit d4676a5dd1
10 changed files with 12906 additions and 54 deletions

View File

@ -38,7 +38,7 @@
<img :src="current.data.cover" class="cover" />
</div>
<div class="media-content">
<slot name="content" :loaded='loaded' :live='live'></slot>
<slot name="content" :loaded="loaded" :live="live" :current="current"></slot>
<AProgress v-if="loaded && duration" :value="currentTime" :max="this.duration"
:format="displayTime" class="pt-1 is-size-7"
@select="audio.currentTime = $event"></AProgress>
@ -69,11 +69,12 @@
</template>
<script>
import Live from '../live';
import Sound from '../sound';
import {Set} from '../model';
import APlaylist from './APlaylist';
import AProgress from './AProgress';
import {reactive} from 'vue'
import Live from '../live'
import Sound from '../sound'
import {Set} from '../model'
import APlaylist from './APlaylist'
import AProgress from './AProgress'
export const State = {
@ -97,7 +98,7 @@ export default {
this.duration = Number.isFinite(this.audio.duration) ? this.audio.duration : null;
});
let live = this.liveArgs ? new Live(this.liveArgs) : null;
let live = this.liveArgs ? reactive(new Live(this.liveArgs)) : null;
live && live.refresh();
return {
@ -184,12 +185,14 @@ export default {
let item = this.$refs[playlist].get(index);
if(!item)
throw `No sound at index ${index} for playlist ${playlist}`;
this.loaded = item;
this.loaded = item
this.current = item
src = item.src;
}
// from live
else {
this.loaded = null;
this.current = this.live.current
src = this.live.src;
}