From 361058bfec9cd6d345c8e4067b8c822b5f4e3894 Mon Sep 17 00:00:00 2001 From: Jeremy Karlsson Date: Mon, 22 Jan 2024 16:25:40 +0100 Subject: [PATCH 1/2] Fix overwriteDuration (#13) * Fix overwriteDuration * Remove console log --- .../src/internal/helpers/streaming-session-store.ts | 6 +++++- packages/player/src/player/basePlayer.ts | 13 ------------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/packages/player/src/internal/helpers/streaming-session-store.ts b/packages/player/src/internal/helpers/streaming-session-store.ts index b2ffd79e..26cd21ab 100644 --- a/packages/player/src/internal/helpers/streaming-session-store.ts +++ b/packages/player/src/internal/helpers/streaming-session-store.ts @@ -108,7 +108,11 @@ class StreamingSessionStore { return; } - mediaProductTransition.playbackContext.actualDuration = updatedDuration; + mediaProductTransition.playbackContext = { + ...mediaProductTransition.playbackContext, + actualDuration: updatedDuration, + }; + this.saveMediaProductTransition(streamingSessionId, mediaProductTransition); } diff --git a/packages/player/src/player/basePlayer.ts b/packages/player/src/player/basePlayer.ts index be8a8ca9..c340727f 100644 --- a/packages/player/src/player/basePlayer.ts +++ b/packages/player/src/player/basePlayer.ts @@ -742,19 +742,6 @@ export class BasePlayer { case fromTo('PLAYING', 'IDLE'): { this.reportPlaybackProgress(this.currentStreamingSessionId); - console.debug( - 'PS', - { - from: currentPlaybackState, - to: newPlaybackState, - }, - { - currentTime: this.#currentTime, - doIt: this.duration && this.currentTime < this.duration, - duration: this.duration, - }, - ); - if (this.duration && this.currentTime < this.duration) { PlayLog.playbackSessionAction(this.currentStreamingSessionId, { actionType: 'PLAYBACK_STOP', From 6e779dc58fe0a3f62e1733f78de01c17d21d1407 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Smestad?= Date: Mon, 22 Jan 2024 16:35:55 +0100 Subject: [PATCH 2/2] Bump player (#14) Fixes error --- packages/player/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/player/package.json b/packages/player/package.json index 53f7d7db..4b906597 100644 --- a/packages/player/package.json +++ b/packages/player/package.json @@ -1,6 +1,6 @@ { "name": "@tidal-music/player", - "version": "0.1.1", + "version": "0.1.2", "description": "Player logic for TIDAL", "type": "module", "exports": {