mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Improve WakeLock/AudioBecomingNoisy Javadoc
PiperOrigin-RevId: 281764207
This commit is contained in:
parent
d82da93ec4
commit
de641380df
1 changed files with 16 additions and 9 deletions
|
|
@ -801,7 +801,10 @@ public class SimpleExoPlayer extends BasePlayer
|
||||||
* href="https://developer.android.com/guide/topics/media-apps/volume-and-earphones#becoming-noisy">audio
|
* href="https://developer.android.com/guide/topics/media-apps/volume-and-earphones#becoming-noisy">audio
|
||||||
* becoming noisy</a> documentation for more information.
|
* becoming noisy</a> documentation for more information.
|
||||||
*
|
*
|
||||||
* @param handleAudioBecomingNoisy True if the player should handle audio becoming noisy.
|
* <p>This feature is not enabled by default.
|
||||||
|
*
|
||||||
|
* @param handleAudioBecomingNoisy Whether the player should pause automatically when audio is
|
||||||
|
* rerouted from a headset to device speakers.
|
||||||
*/
|
*/
|
||||||
public void setHandleAudioBecomingNoisy(boolean handleAudioBecomingNoisy) {
|
public void setHandleAudioBecomingNoisy(boolean handleAudioBecomingNoisy) {
|
||||||
verifyApplicationThread();
|
verifyApplicationThread();
|
||||||
|
|
@ -1415,16 +1418,20 @@ public class SimpleExoPlayer extends BasePlayer
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets whether to enable the acquiring and releasing of a {@link
|
* Sets whether the player should use a {@link android.os.PowerManager.WakeLock} to ensure the
|
||||||
* android.os.PowerManager.WakeLock}.
|
* device stays awake for playback, even when the screen is off.
|
||||||
*
|
*
|
||||||
* <p>By default, automatic wake lock handling is not enabled. Enabling this on will acquire the
|
* <p>Enabling this feature requires the {@link android.Manifest.permission#WAKE_LOCK} permission.
|
||||||
* WakeLock if necessary. Disabling this will release the WakeLock if it is held.
|
* It should be used together with a foreground {@link android.app.Service} for use cases where
|
||||||
|
* playback can occur when the screen is off (e.g. background audio playback). It is not useful if
|
||||||
|
* the screen will always be on during playback (e.g. foreground video playback).
|
||||||
*
|
*
|
||||||
* @param handleWakeLock True if the player should handle a {@link
|
* <p>This feature is not enabled by default. If enabled, a WakeLock is held whenever the player
|
||||||
* android.os.PowerManager.WakeLock}, false otherwise. This is for use with a foreground
|
* is in the {@link #STATE_READY READY} or {@link #STATE_BUFFERING BUFFERING} states with {@code
|
||||||
* {@link android.app.Service}, for allowing audio playback with the screen off. Please note
|
* playWhenReady = true}.
|
||||||
* that enabling this requires the {@link android.Manifest.permission#WAKE_LOCK} permission.
|
*
|
||||||
|
* @param handleWakeLock Whether the player should use a {@link android.os.PowerManager.WakeLock}
|
||||||
|
* to ensure the device stays awake for playback, even when the screen is off.
|
||||||
*/
|
*/
|
||||||
public void setHandleWakeLock(boolean handleWakeLock) {
|
public void setHandleWakeLock(boolean handleWakeLock) {
|
||||||
wakeLockManager.setEnabled(handleWakeLock);
|
wakeLockManager.setEnabled(handleWakeLock);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue