Skip to content

Commit

Permalink
feat: export period combiner (shaka-project#5324)
Browse files Browse the repository at this point in the history
  • Loading branch information
baconz committed Jun 16, 2023
1 parent 019dcfd commit e9ba2f4
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions lib/util/periods.js
Expand Up @@ -24,6 +24,7 @@ goog.require('shaka.util.MimeUtils');
*
* @implements {shaka.util.IReleasable}
* @final
* @export
*/
shaka.util.PeriodCombiner = class {
/** */
Expand Down Expand Up @@ -72,20 +73,32 @@ shaka.util.PeriodCombiner = class {
this.variants_ = [];
}

/** @return {!Array.<shaka.extern.Variant>} */
/**
* @return {!Array.<shaka.extern.Variant>}
*
* @export
*/
getVariants() {
return this.variants_;
}

/** @return {!Array.<shaka.extern.Stream>} */
/**
* @return {!Array.<shaka.extern.Stream>}
*
* @export
*/
getTextStreams() {
// Return a copy of the array because makeTextStreamsForClosedCaptions
// may make changes to the contents of the array. Those changes should not
// propagate back to the PeriodCombiner.
return this.textStreams_.slice();
}

/** @return {!Array.<shaka.extern.Stream>} */
/**
* @return {!Array.<shaka.extern.Stream>}
*
* @export
*/
getImageStreams() {
return this.imageStreams_;
}
Expand All @@ -94,6 +107,8 @@ shaka.util.PeriodCombiner = class {
* @param {!Array.<shaka.util.PeriodCombiner.Period>} periods
* @param {boolean} isDynamic
* @return {!Promise}
*
* @export
*/
async combinePeriods(periods, isDynamic) {
const ContentType = shaka.util.ManifestParserUtils.ContentType;
Expand Down Expand Up @@ -1638,6 +1653,8 @@ shaka.util.PeriodCombiner = class {
* The text streams from one Period.
* @property {!Array.<shaka.extern.Stream>} imageStreams
* The image streams from one Period.
*
* @export
*/
shaka.util.PeriodCombiner.Period;

Expand Down

0 comments on commit e9ba2f4

Please sign in to comment.