forked from rc/aircox
WIP - Sound.file instead of Sound.path; fix issues with player; program.path is now relative
This commit is contained in:
@ -12,6 +12,7 @@ const App = {
|
||||
|
||||
export const PlayerApp = {
|
||||
el: '#player',
|
||||
delimiters: ['[[', ']]'],
|
||||
components: {...components},
|
||||
}
|
||||
|
||||
|
@ -219,7 +219,7 @@ export default {
|
||||
|
||||
/// Push items to playlist (by name)
|
||||
push(playlist, ...items) {
|
||||
return this.$refs[playlist].push(...items);
|
||||
return this.sets[playlist].push(...items);
|
||||
},
|
||||
|
||||
/// Push and play items
|
||||
|
@ -6,7 +6,7 @@
|
||||
:key="index">
|
||||
<a :class="index == selectedIndex ? 'is-active' : ''">
|
||||
<ASoundItem
|
||||
:data="item" :index="index" :player="player" :set="set"
|
||||
:data="item" :index="index" :set="set" :player="player_"
|
||||
@togglePlay="togglePlay(index)"
|
||||
:actions="actions">
|
||||
<template v-slot:actions="{}">
|
||||
@ -38,7 +38,8 @@ export default {
|
||||
},
|
||||
|
||||
computed: {
|
||||
self() { return this; }
|
||||
self() { return this; },
|
||||
player_() { return this.player || window.aircox.player },
|
||||
},
|
||||
|
||||
methods: {
|
||||
@ -50,8 +51,8 @@ export default {
|
||||
},
|
||||
|
||||
togglePlay(index) {
|
||||
if(this.player.isPlaying(this.set.get(index)))
|
||||
this.player.pause();
|
||||
if(this.player_.isPlaying(this.set.get(index)))
|
||||
this.player_.pause();
|
||||
else
|
||||
this.select(index)
|
||||
},
|
||||
|
@ -35,6 +35,11 @@ window.aircox = {
|
||||
init(props=null, {config=null, builder=null, initBuilder=true,
|
||||
initPlayer=true, hotReload=false}={})
|
||||
{
|
||||
if(initPlayer) {
|
||||
let playerBuilder = this.playerBuilder
|
||||
playerBuilder.mount()
|
||||
}
|
||||
|
||||
if(initBuilder) {
|
||||
builder = builder || this.builder
|
||||
this.builder = builder
|
||||
@ -46,11 +51,6 @@ window.aircox = {
|
||||
if(hotReload)
|
||||
builder.enableHotReload(hotReload)
|
||||
}
|
||||
|
||||
if(initPlayer) {
|
||||
let playerBuilder = this.playerBuilder
|
||||
playerBuilder.mount()
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user