Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Sparacio committed May 26, 2016
1 parent fb4dec3 commit f328c54
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/streaming/controllers/ScheduleController.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ function ScheduleController(config) {
function onPlaybackSeeking(e) {

seekTarget = e.seekTime;
setTimeToLoadDelay(0);

if (!initialPlayback) {
isFragmentLoading = false;
Expand Down
2 changes: 1 addition & 1 deletion src/streaming/rules/abr/ThroughputRule.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function ThroughputRule(config) {

if (bufferStateVO.state === BufferController.BUFFER_LOADED || isDynamic) {
var newQuality = abrController.getQualityForBitrate(mediaInfo, averageThroughput);
streamProcessor.getScheduleController().setTimeToLoadDelay(0); // TODO Watch out for seek event - no delay when seeking.!!
streamProcessor.getScheduleController().setTimeToLoadDelay(0);
switchRequest = SwitchRequest(context).create(newQuality, SwitchRequest.DEFAULT);
}

Expand Down
11 changes: 7 additions & 4 deletions src/streaming/rules/scheduling/BufferLevelRule.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,16 @@ function BufferLevelRule(config) {
let representationInfo = streamProcessor.getCurrentRepresentationInfo();
let mediaInfo = representationInfo.mediaInfo;
let mediaType = mediaInfo.type;
let metrics = metricsModel.getReadOnlyMetricsFor(mediaType);
let bufferLevel = dashMetrics.getCurrentBufferLevel(metrics);
let audioBufferLevel = dashMetrics.getCurrentBufferLevel(metricsModel.getReadOnlyMetricsFor('audio'));
let videoBufferLevel = dashMetrics.getCurrentBufferLevel(metricsModel.getReadOnlyMetricsFor('video'));
let bufferLevel = mediaType === 'video' ? videoBufferLevel : audioBufferLevel;

return bufferLevel < getBufferTarget(streamProcessor, mediaType);
return bufferLevel < getBufferTarget(streamProcessor, mediaType, videoBufferLevel);
}

function reset() {}

function getBufferTarget(streamProcessor, type) {
function getBufferTarget(streamProcessor, type, videoBufferLevel) {

let representationInfo = streamProcessor.getCurrentRepresentationInfo();
let mediaInfo = representationInfo.mediaInfo;
Expand All @@ -74,6 +75,8 @@ function BufferLevelRule(config) {

if (type === 'fragmentedText') {
bufferTarget = textSourceBuffer.getAllTracksAreDisabled() ? 0 : representationInfo.fragmentDuration;
} else if(type === 'audio'){
bufferTarget = videoBufferLevel;
} else {
if (abrController.isPlayingAtTopQuality(streamInfo)) {
bufferTarget = isLongFormContent ? mediaPlayerModel.getBufferTimeAtTopQualityLongForm() : mediaPlayerModel.getBufferTimeAtTopQuality();
Expand Down

0 comments on commit f328c54

Please sign in to comment.