Skip to content

Commit

Permalink
Stop passing "is live" to |Player.applyPlayRange_|
Browse files Browse the repository at this point in the history
|applyPlayRange_| in |Player| was previously passed |isLive| but that
value would come from the timeline that it was already passed. Instead
of passing in |isLive| this updates |applyPlayRange_| to check the
the timeline for the "is live" condition.

Change-Id: I13efccd14b9177d2fd652347dce55338d74b7ec8
(cherry picked from commit d02959f3288ec140098d555559bcab9c51d02ca7)
  • Loading branch information
vaage committed Dec 14, 2018
1 parent e3739c9 commit 8c69ab1
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions lib/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -862,8 +862,7 @@ shaka.Player.prototype.load = async function(

shaka.Player.applyPlayRange_(this.manifest_.presentationTimeline,
this.config_.playRangeStart,
this.config_.playRangeEnd,
this.isLive());
this.config_.playRangeEnd);

await this.drmEngine_.attach(video);

Expand Down Expand Up @@ -3416,21 +3415,20 @@ shaka.Player.prototype.shouldStreamText_ = function() {


/**
* Applys playRangeStart and playRangeEnd to the given timeline.
* Applies playRangeStart and playRangeEnd to the given timeline. This will
* only affect non-live content.
*
* @param {shaka.media.PresentationTimeline} timeline
* @param {number} playRangeStart
* @param {number} playRangeEnd
* @param {boolean} isLive
*
* @private
*/
shaka.Player.applyPlayRange_ = function(timeline,
playRangeStart,
playRangeEnd,
isLive) {
playRangeEnd) {
if (playRangeStart > 0) {
if (isLive) {
if (timeline.isLive()) {
shaka.log.warning(
'|playRangeStart| has been configured for live content. ' +
'Ignoring the setting.');
Expand All @@ -3443,7 +3441,7 @@ shaka.Player.applyPlayRange_ = function(timeline,
// presentation, update the duration unless it's live content.
const fullDuration = timeline.getDuration();
if (playRangeEnd < fullDuration) {
if (isLive) {
if (timeline.isLive()) {
shaka.log.warning(
'|playRangeEnd| has been configured for live content. ' +
'Ignoring the setting.');
Expand Down

0 comments on commit 8c69ab1

Please sign in to comment.