Skip to content

Commit

Permalink
Merge pull request #101 from clappr/improve-presentation-start-time
Browse files Browse the repository at this point in the history
Replace .getManifest() call
  • Loading branch information
joaopaulovieira authored Jun 15, 2021
2 parents bf2288a + 8566524 commit 5f00461
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/clappr-dash-shaka-playback.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -107,9 +107,7 @@ class DashShakaPlayback extends HTML5Video {
}

getProgramDateTime() {
if (!this.shakaPlayerInstance || !this.presentationTimeline) return 0

return new Date((this.presentationTimeline.getPresentationStartTime() + this.seekRange.start) * 1000)
return this.presentationStartTimeAsDate
}

_updateDvr(status) {
Expand Down

0 comments on commit 5f00461

Please sign in to comment.