Add method to check if tunneling is enabled.
Issue: google/ExoPlayer#2518 PiperOrigin-RevId: 460482615
This commit is contained in:
parent
d6659e92df
commit
ab1fff404c
@ -1602,4 +1602,13 @@ public interface ExoPlayer extends Player {
|
||||
* @see AudioOffloadListener#onExperimentalSleepingForOffloadChanged(boolean)
|
||||
*/
|
||||
boolean experimentalIsSleepingForOffload();
|
||||
|
||||
/**
|
||||
* Returns whether <a
|
||||
* href="https://source.android.com/devices/tv/multimedia-tunneling">tunneling</a> is enabled for
|
||||
* the currently selected tracks.
|
||||
*
|
||||
* @see Player.Listener#onTracksChanged(Tracks)
|
||||
*/
|
||||
boolean isTunnelingEnabled();
|
||||
}
|
||||
|
@ -1671,6 +1671,17 @@ import java.util.concurrent.TimeoutException;
|
||||
streamVolumeManager.setMuted(muted);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTunnelingEnabled() {
|
||||
verifyApplicationThread();
|
||||
for (RendererConfiguration config : playbackInfo.trackSelectorResult.rendererConfigurations) {
|
||||
if (config.tunneling) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* package */ void setThrowsWhenUsingWrongThread(boolean throwsWhenUsingWrongThread) {
|
||||
this.throwsWhenUsingWrongThread = throwsWhenUsingWrongThread;
|
||||
}
|
||||
|
@ -1247,6 +1247,12 @@ public class SimpleExoPlayer extends BasePlayer
|
||||
player.setDeviceMuted(muted);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTunnelingEnabled() {
|
||||
blockUntilConstructorFinished();
|
||||
return player.isTunnelingEnabled();
|
||||
}
|
||||
|
||||
/* package */ void setThrowsWhenUsingWrongThread(boolean throwsWhenUsingWrongThread) {
|
||||
blockUntilConstructorFinished();
|
||||
player.setThrowsWhenUsingWrongThread(throwsWhenUsingWrongThread);
|
||||
|
@ -410,4 +410,9 @@ public class StubExoPlayer extends StubPlayer implements ExoPlayer {
|
||||
public boolean experimentalIsSleepingForOffload() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTunnelingEnabled() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user