mirror of
https://github.com/samsonjs/media.git
synced 2026-04-08 11:45:51 +00:00
Constraint buffered percentage to [0,100]
Issue: #2902 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=158142754
This commit is contained in:
parent
90c62f636c
commit
1316445c00
1 changed files with 3 additions and 3 deletions
|
|
@ -323,10 +323,10 @@ import java.util.concurrent.CopyOnWriteArraySet;
|
|||
if (timeline.isEmpty()) {
|
||||
return 0;
|
||||
}
|
||||
long bufferedPosition = getBufferedPosition();
|
||||
long position = getBufferedPosition();
|
||||
long duration = getDuration();
|
||||
return (bufferedPosition == C.TIME_UNSET || duration == C.TIME_UNSET) ? 0
|
||||
: (int) (duration == 0 ? 100 : (bufferedPosition * 100) / duration);
|
||||
return position == C.TIME_UNSET || duration == C.TIME_UNSET ? 0
|
||||
: (duration == 0 ? 100 : Util.constrainValue((int) ((position * 100) / duration), 0, 100));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Reference in a new issue