Bug 1407243 - Don't immediately fire canplaythrough for infinite/live streams. r=jwwang

MozReview-Commit-ID: 2LQFa8PHvO5

--HG--
extra : rebase_source : 3534a963202658870221fca9cc238185d7e55156
This commit is contained in:
Jean-Yves Avenard 2017-10-10 16:14:24 +02:00
Родитель f4b8906f72
Коммит d34a7ebdc5
1 изменённых файлов: 1 добавлений и 5 удалений

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

@ -310,11 +310,7 @@ MediaSourceDecoder::CanPlayThroughImpl()
}
TimeUnit duration = TimeUnit::FromSeconds(mMediaSource->Duration());
auto currentPosition = CurrentPosition();
if (duration.IsInfinite()) {
// We can't make an informed decision and just assume that it's a live
// stream
return true;
} else if (duration <= currentPosition) {
if (duration <= currentPosition) {
return true;
}
// If we have data up to the mediasource's duration or 10s ahead, we can