Back to Exoplayer

RequirementsWatcher (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/scheduler/RequirementsWatcher.html

latest4.2 KB
Original Source

Package com.google.android.exoplayer2.scheduler

Class RequirementsWatcher


[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final classRequirementsWatcherextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")

Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.

Watches whether the Requirements are met and notifies the RequirementsWatcher.Listener on changes.

Nested Class Summary

Nested Classes | Modifier and Type | Class | Description | | --- | --- | --- | | static interface | RequirementsWatcher.Listener | Deprecated.

Notified when RequirementsWatcher instance first created and on changes whether the Requirements are met. |

Constructor Summary

Constructors | Constructor | Description | | --- | --- | | RequirementsWatcher​(Context context, RequirementsWatcher.Listener listener, Requirements requirements) | Deprecated. |

Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description | | --- | --- | --- | | Requirements | getRequirements() | Deprecated.

Returns watched Requirements. | | @com.google.android.exoplayer2.scheduler.Requirements.RequirementFlags int | start() | Deprecated.

Starts watching for changes. | | void | stop() | Deprecated.

Stops watching for changes. |

- 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

- 

RequirementsWatcher

public RequirementsWatcher​([Context](https://developer.android.com/reference/android/content/Context.html "class or interface in android.content")context,[RequirementsWatcher.Listener](RequirementsWatcher.Listener.html "interface in com.google.android.exoplayer2.scheduler")listener,[Requirements](Requirements.html "class in com.google.android.exoplayer2.scheduler")requirements)

Deprecated. Parameters:context - Any context.listener - Notified whether the Requirements are met.requirements - The requirements to watch.

Method Detail

- 

start

[@RequirementFlags](Requirements.RequirementFlags.html "annotation in com.google.android.exoplayer2.scheduler")public @com.google.android.exoplayer2.scheduler.Requirements.RequirementFlags int start()

Deprecated.

Starts watching for changes. Must be called from a thread that has an associated Looper. Listener methods are called on the caller thread. Returns:Initial RequirementFlags that are not met, or 0.

- 

stop

public void stop()

Deprecated.

Stops watching for changes.

- 

getRequirements

public[Requirements](Requirements.html "class in com.google.android.exoplayer2.scheduler")getRequirements()

Deprecated.

Returns watched Requirements.