Skip to content

Instantly share code, notes, and snippets.

@arpu
Created May 24, 2016 19:24
Show Gist options
  • Save arpu/dcacb71d67667e0260d80f8b8cbf2913 to your computer and use it in GitHub Desktop.
Save arpu/dcacb71d67667e0260d80f8b8cbf2913 to your computer and use it in GitHub Desktop.
export default class PNScheduleControllerClassProvider {
constructor() {
const context = this.context;
const factory = this.factory;
const parent = this.parent;
}
validate() {
console.error('validate()')
if (isStopped || playbackController.isPaused() && !scheduleWhilePaused) return;
//log("validating", type);
let readyToLoad = bufferLevelRule.execute(streamProcessor);
if (readyToLoad && !isFragmentLoading &&
(dashManifestModel.getIsTextTrack(type) || !bufferController.getIsAppendingInProgress())) {
isFragmentLoading = true;
const getNextFragment = function () {
let request = nextFragmentRequestRule.execute(streamProcessor);
if (request) {
console.error('executeRequest(request)')
//fragmentModel.executeRequest(request); // we load
} else {
isFragmentLoading = false;
startValidateTimer(1000); //we loop
}
};
//Run ABR rules - let it callback to getNextFragment once it is done running.
abrController.getPlaybackQuality(streamProcessor, getNextFragment);
} else {
startValidateTimer(1000); //we loop
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment