Skip to content

Commit

Permalink
added function for getting add audio segments regardless of group and…
Browse files Browse the repository at this point in the history
… clarified comments
  • Loading branch information
Johan Lautakoksi committed Jun 21, 2023
1 parent 502793f commit bc409b5
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,15 @@ class HLSVod {
return this.mediaSequences[seqIdx].segments;
}

/**
* Get all audio segments (duration, uri) for a specific media sequence
*
* @param {number} seqIdx - media sequence index (first is 0)
*/
getLiveAudioSequenceSegments(seqIdx) {
return this.mediaSequences[seqIdx].audioSegments;
}

/**
* Get all segments (duration, uri)
*
Expand All @@ -646,7 +655,7 @@ class HLSVod {
}

/**
* Get all audio segments (duration, uri) for a specific media sequence
* Get all audio segments (duration, uri) for a specific media sequence based on audio group and lang
*
* @param {string} audioGroupId - audio group Id
* @param {string} audioLanguage - audio language
Expand Down Expand Up @@ -1033,7 +1042,7 @@ class HLSVod {
let index = offset;
let allVideoDurationUsed = false;
while (index < videoSegments.length && totalSubtitleSegmentDuration > 0) {
totalSubtitleSegmentDuration = Math.round(totalSubtitleSegmentDuration * 1000) / 1000;
totalSubtitleSegmentDuration = Math.round(totalSubtitleSegmentDuration * 1000) / 1000;
if (videoSegments[index].discontinuity) {
newSegmentList.push(videoSegments[index])
index += 1;
Expand Down

0 comments on commit bc409b5

Please sign in to comment.