StuckPlayerDetector
@UnstableApi
public final class StuckPlayerDetector
A utility class to detect whether a Player is stuck.
The class must be used on the thread associated with the getApplicationLooper.
Summary
Nested types |
|---|
public interface StuckPlayerDetector.CallbackCallback notified when the player appears stuck. |
Public constructors |
|---|
StuckPlayerDetector(Creates the stuck player detector. |
Public methods |
|
|---|---|
void |
release()Releases the stuck player detector. |
Public constructors
StuckPlayerDetector
public StuckPlayerDetector(
Player player,
StuckPlayerDetector.Callback callback,
Clock clock,
int stuckBufferingTimeoutMs,
int stuckPlayingTimeoutMs,
int stuckPlayingNotEndingTimeoutMs,
int stuckSuppressedTimeoutMs
)
Creates the stuck player detector.
Must be called on the player's getApplicationLooper.
| Parameters | |
|---|---|
Player player |
The |
StuckPlayerDetector.Callback callback |
The |
Clock clock |
The |
int stuckBufferingTimeoutMs |
The timeout after which the player is assumed stuck buffering if it's buffering and no loading progress is made, in milliseconds. |
int stuckPlayingTimeoutMs |
The timeout after which the player is assumed stuck playing if it's playing and no position progress is made, in milliseconds. |
int stuckPlayingNotEndingTimeoutMs |
The timeout after which the player is assumed stuck playing if it's playing and it should have ended, in milliseconds. |
int stuckSuppressedTimeoutMs |
The timeout after which the player is assumed stuck in a suppression state, in milliseconds. |