From 4cf812260a4cf8a5e48433642a6cde0801f2daa7 Mon Sep 17 00:00:00 2001 From: Leticia Fernandes Date: Fri, 11 Jun 2021 17:17:37 -0300 Subject: [PATCH 1/3] fix(shaka playback): remove getManifest() from getter since it was deprecated by shaka using now getPresentationStartTimeAsDate() --- src/clappr-dash-shaka-playback.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/clappr-dash-shaka-playback.js b/src/clappr-dash-shaka-playback.js index 2132b40..1908ec1 100644 --- a/src/clappr-dash-shaka-playback.js +++ b/src/clappr-dash-shaka-playback.js @@ -86,10 +86,10 @@ class DashShakaPlayback extends HTML5Video { return this.seekRange.start } - get presentationTimeline() { - if (!this.shakaPlayerInstance || !this.shakaPlayerInstance.getManifest()) return null + get presentationStartTimeAsDate() { + if (!this.shakaPlayerInstance || !this.shakaPlayerInstance.getPresentationStartTimeAsDate()) return 0 - return this.shakaPlayerInstance.getManifest().presentationTimeline + return new Date(this.shakaPlayerInstance.getPresentationStartTimeAsDate().getTime() + this.seekRange.start * 1000) } get bandwidthEstimate() { @@ -407,7 +407,7 @@ class DashShakaPlayback extends HTML5Video { let update = { current: this.getCurrentTime(), total: this.getDuration(), - firstFragDateTime: this.getProgramDateTime() + firstFragDateTime: this.presentationStartTimeAsDate } let isSame = this._lastTimeUpdate && ( update.current === this._lastTimeUpdate.current && From ad2bf509a16b4c7a36a1cc21da09c769229a05dd Mon Sep 17 00:00:00 2001 From: Leticia Fernandes Date: Fri, 11 Jun 2021 17:18:51 -0300 Subject: [PATCH 2/3] feat(shaka playback): remove no longer necessary convertion to date time --- src/clappr-dash-shaka-playback.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/clappr-dash-shaka-playback.js b/src/clappr-dash-shaka-playback.js index 1908ec1..768c5a2 100644 --- a/src/clappr-dash-shaka-playback.js +++ b/src/clappr-dash-shaka-playback.js @@ -106,12 +106,6 @@ class DashShakaPlayback extends HTML5Video { this._minDvrSize = typeof (this.options.shakaMinimumDvrSize) === 'undefined' ? 60 : this.options.shakaMinimumDvrSize } - getProgramDateTime() { - if (!this.shakaPlayerInstance || !this.presentationTimeline) return 0 - - return new Date((this.presentationTimeline.getPresentationStartTime() + this.seekRange.start) * 1000) - } - _updateDvr(status) { this.trigger(Events.PLAYBACK_DVR, status) this.trigger(Events.PLAYBACK_STATS_ADD, { 'dvr': status }) From 8566524ac5c268996e5034f3709b78b74b74c362 Mon Sep 17 00:00:00 2001 From: Leticia Fernandes Date: Mon, 14 Jun 2021 16:57:32 -0300 Subject: [PATCH 3/3] revert(shaka playback): mantain getProgramDateTime method used at other playbacks (like hls) --- src/clappr-dash-shaka-playback.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/clappr-dash-shaka-playback.js b/src/clappr-dash-shaka-playback.js index 768c5a2..e90e185 100644 --- a/src/clappr-dash-shaka-playback.js +++ b/src/clappr-dash-shaka-playback.js @@ -106,6 +106,10 @@ class DashShakaPlayback extends HTML5Video { this._minDvrSize = typeof (this.options.shakaMinimumDvrSize) === 'undefined' ? 60 : this.options.shakaMinimumDvrSize } + getProgramDateTime() { + return this.presentationStartTimeAsDate + } + _updateDvr(status) { this.trigger(Events.PLAYBACK_DVR, status) this.trigger(Events.PLAYBACK_STATS_ADD, { 'dvr': status }) @@ -401,7 +405,7 @@ class DashShakaPlayback extends HTML5Video { let update = { current: this.getCurrentTime(), total: this.getDuration(), - firstFragDateTime: this.presentationStartTimeAsDate + firstFragDateTime: this.getProgramDateTime() } let isSame = this._lastTimeUpdate && ( update.current === this._lastTimeUpdate.current &&