Skip to content

Commit

Permalink
For VoD content limit the seek to the duration of the content (Dash-I…
Browse files Browse the repository at this point in the history
…ndustry-Forum#4057)

* For VoD content limit the seek to the duration of the content

* Move logic for VoD seek limitation to MediaPlayer.js
  • Loading branch information
dsilhavy authored and eastkiki committed Oct 4, 2022
1 parent ced9a5a commit f7c8c52
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/streaming/MediaPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,13 @@ function MediaPlayer() {
}

let s = playbackController.getIsDynamic() ? getDVRSeekOffset(value) : value;

// For VoD limit the seek to the duration of the content
const videoElement = getVideoElement();
if (!playbackController.getIsDynamic() && videoElement.duration) {
s = Math.min(videoElement.duration, s);
}

playbackController.seek(s, false, false, true);
}

Expand Down Expand Up @@ -1996,7 +2003,7 @@ function MediaPlayer() {
* @return {object}
*/
function getCurrentSteeringResponseData() {
if(contentSteeringController) {
if (contentSteeringController) {
return contentSteeringController.getCurrentSteeringResponseData();
}
}
Expand Down

0 comments on commit f7c8c52

Please sign in to comment.