Skip to content

Commit 75f5c01

Browse files
committed
Pass K value through with rep info and check for > 1
1 parent ccf3b95 commit 75f5c01

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

src/dash/constants/DashConstants.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ export default {
100100
INDEX_RANGE: 'indexRange',
101101
INITIALIZATION: 'Initialization',
102102
INITIALIZATION_MINUS: 'initialization',
103+
K: 'k',
103104
LA_URL: 'Laurl',
104105
LA_URL_LOWER_CASE: 'laurl',
105106
LABEL: 'Label',

src/dash/models/DashManifestModel.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ function DashManifestModel() {
752752

753753
function getRepresentationFor(index, adaptation) {
754754
return adaptation && adaptation.Representation && adaptation.Representation.length > 0 &&
755-
isInteger(index) ? adaptation.Representation[index] : null;
755+
isInteger(index) ? adaptation.Representation[index] : null;
756756
}
757757

758758
function getRealAdaptationFor(voAdaptation) {
@@ -934,6 +934,9 @@ function DashManifestModel() {
934934
if (segmentInfo.hasOwnProperty(DashConstants.MEDIA)) {
935935
voRepresentation.media = segmentInfo.media;
936936
}
937+
if (segmentInfo.hasOwnProperty(DashConstants.K)) {
938+
voRepresentation.k = segmentInfo.k || 1;
939+
}
937940
if (segmentInfo.hasOwnProperty(DashConstants.START_NUMBER)) {
938941
voRepresentation.startNumber = parseInt(segmentInfo.startNumber);
939942
}

src/dash/vo/Representation.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ class Representation {
5858
this.id = null;
5959
this.indexRange = null;
6060
this.initialization = null;
61+
this.k = 1;
6162
this.maxPlayoutRate = NaN;
6263
this.mediaFinishedInformation = { numberOfSegments: 0, mediaTimeOfLastSignaledSegment: NaN };
6364
this.mediaInfo = null;

src/streaming/controllers/PlaybackController.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ function PlaybackController() {
177177
/**
178178
* Triggers play() on the video element
179179
*/
180-
function play(adjustLiveDelay = false) {''
180+
function play(adjustLiveDelay = false) {
181181
if (streamInfo && videoModel && videoModel.getElement()) {
182182
if (adjustLiveDelay && isDynamic) {
183183
_adjustLiveDelayAfterUserInteraction(getTime());
@@ -829,7 +829,7 @@ function PlaybackController() {
829829
}
830830

831831
/**
832-
* We enable low latency playback if for the current representation availabilityTimeComplete is set to false
832+
* We enable low latency playback if for the current representation availabilityTimeComplete is set to false or there is a k value larger than 1 in the segment template
833833
* @param e
834834
* @private
835835
*/
@@ -839,7 +839,7 @@ function PlaybackController() {
839839
return;
840840
}
841841

842-
lowLatencyModeEnabled = e.currentRepresentation.availabilityTimeComplete === false;
842+
lowLatencyModeEnabled = e.currentRepresentation.availabilityTimeComplete === false || e.currentRepresentation.k > 1;
843843

844844
// If we enable low latency mode for the first time we also enable the catchup mechanism. This can be deactivated again for instance if the user seeks within the DVR window. We leave deactivation up to the application but also do not activate automatically again.
845845
if (lowLatencyModeEnabled && !initialCatchupModeActivated) {

0 commit comments

Comments
 (0)