StuckPlayerDetector


@UnstableApi
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

Callback notified when the player appears stuck.

Public constructors

StuckPlayerDetector(
    player: Player!,
    callback: StuckPlayerDetector.Callback!,
    clock: Clock!,
    stuckBufferingTimeoutMs: Int,
    stuckPlayingTimeoutMs: Int,
    stuckPlayingNotEndingTimeoutMs: Int,
    stuckSuppressedTimeoutMs: Int
)

Creates the stuck player detector.

Public functions

Unit

Releases the stuck player detector.

Public constructors

StuckPlayerDetector

StuckPlayerDetector(
    player: Player!,
    callback: StuckPlayerDetector.Callback!,
    clock: Clock!,
    stuckBufferingTimeoutMs: Int,
    stuckPlayingTimeoutMs: Int,
    stuckPlayingNotEndingTimeoutMs: Int,
    stuckSuppressedTimeoutMs: Int
)

Creates the stuck player detector.

Must be called on the player's getApplicationLooper.

Parameters
player: Player!

The Player to monitor.

callback: StuckPlayerDetector.Callback!

The Callback to notify of stuck playbacks.

clock: Clock!

The Clock.

stuckBufferingTimeoutMs: Int

The timeout after which the player is assumed stuck buffering if it's buffering and no loading progress is made, in milliseconds.

stuckPlayingTimeoutMs: Int

The timeout after which the player is assumed stuck playing if it's playing and no position progress is made, in milliseconds.

stuckPlayingNotEndingTimeoutMs: Int

The timeout after which the player is assumed stuck playing if it's playing and it should have ended, in milliseconds.

stuckSuppressedTimeoutMs: Int

The timeout after which the player is assumed stuck in a suppression state, in milliseconds.

Public functions

release

fun release(): Unit

Releases the stuck player detector.