WIP - Sound.file instead of Sound.path; fix issues with player; program.path is now relative

This commit is contained in:
bkfox
2022-03-18 14:12:59 +01:00
parent d17d6831dd
commit e3b744be70
17 changed files with 109 additions and 118 deletions

View File

@ -12,6 +12,7 @@ const App = {
export const PlayerApp = {
el: '#player',
delimiters: ['[[', ']]'],
components: {...components},
}

View File

@ -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

View File

@ -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)
},

View File

@ -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()
}
},
}