Bug 1382303 - P3. Reduce enough data threadhold to 10s. r=jwwang

We waited 30s until we changed readyState to HAVE_ENOUGH_DATA this would cause autoplay media element to start rather late. In particular with live stream. 10s is typically enough ahead time to start playback.

MozReview-Commit-ID: LJvY8cQYfwZ

--HG--
extra : rebase_source : 4c75326891ba4e9317c432ea7074eb033a77b300
This commit is contained in:
Jean-Yves Avenard 2017-07-20 20:49:06 +02:00
Родитель daf2be6beb
Коммит d0144aba45
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -306,12 +306,12 @@ MediaSourceDecoder::CanPlayThrough()
} else if (duration <= currentPosition) {
return true;
}
// If we have data up to the mediasource's duration or 30s ahead, we can
// If we have data up to the mediasource's duration or 10s ahead, we can
// assume that we can play without interruption.
TimeIntervals buffered = GetBuffered();
buffered.SetFuzz(MediaSourceDemuxer::EOS_FUZZ / 2);
TimeUnit timeAhead =
std::min(duration, currentPosition + TimeUnit::FromSeconds(30));
std::min(duration, currentPosition + TimeUnit::FromSeconds(10));
TimeInterval interval(currentPosition, timeAhead);
return buffered.ContainsStrict(ClampIntervalToEnd(interval));
}