forked from rc/aircox
player refresh
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user