Skip to content

Commit

Permalink
try to fix the startIndex issue
Browse files Browse the repository at this point in the history
  • Loading branch information
hawken93 committed Jan 4, 2021
1 parent c84ef49 commit bf0f1a9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/components/playbackManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,18 @@ export abstract class PlaybackManager {
return this.playFromOptionsInternal(options);
}

private static playFromOptionsInternal(options: any): boolean {
private static playFromOptionsInternal(options: any): void {
const stopPlayer =
this.activePlaylist && this.activePlaylist.length > 0;

this.activePlaylist = options.items;
// We need to set -1 so the next index will be 0
this.activePlaylistIndex = -1;
this.activePlaylistIndex = options.startIndex || 0;

console.log('Loaded new playlist:', this.activePlaylist);

return this.playNextItem(options, stopPlayer);
// When starting playback initially, don't use
// the next item facility.
this.playItem(options, stopPlayer);
}

// add item to playlist
Expand Down

0 comments on commit bf0f1a9

Please sign in to comment.