mirror of
https://github.com/koel/koel
synced 2024-09-20 06:11:53 +00:00
Playback now initializes only once
This commit is contained in:
parent
f51740fe3a
commit
eeeb03b313
1 changed files with 8 additions and 0 deletions
|
@ -14,6 +14,7 @@ export default {
|
|||
player: null,
|
||||
$volumeInput: null,
|
||||
repeatModes: ['NO_REPEAT', 'REPEAT_ALL', 'REPEAT_ONE'],
|
||||
initialized: false,
|
||||
|
||||
/**
|
||||
* Initialize the playback service for this whole Koel app.
|
||||
|
@ -21,6 +22,11 @@ export default {
|
|||
* @param object app The root Vue component.
|
||||
*/
|
||||
init(app) {
|
||||
// We don't need to init this service twice, or the media events will be duplicated.
|
||||
if (this.initialized) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.app = app;
|
||||
|
||||
plyr.setup({
|
||||
|
@ -65,6 +71,8 @@ export default {
|
|||
|
||||
// On init, set the volume to the value found in the local storage.
|
||||
this.setVolume(preferenceStore.get('volume'));
|
||||
|
||||
this.initialized = true;
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue