Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: export period combiner #5324

Merged
merged 1 commit into from
Jun 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions lib/util/periods.js
Original file line number Diff line number Diff line change
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