mirror of
https://github.com/samsonjs/media.git
synced 2026-04-08 11:45:51 +00:00
Update AudioListener to reflect new audio session ID logic
PiperOrigin-RevId: 351597144
This commit is contained in:
parent
73114e3987
commit
9198dd6f5a
4 changed files with 10 additions and 5 deletions
|
|
@ -136,6 +136,11 @@
|
|||
which can be immediately queried by calling
|
||||
`SimpleExoPlayer.getAudioSessionId`. The audio session ID will only
|
||||
change if application code calls `SimpleExoPlayer.setAudioSessionId`.
|
||||
* `AudioListener.onAudioSessionId` is replaced with
|
||||
`AudioListener.onAudioSessionIdChanged`. Note that
|
||||
`onAudioSessionIdChanged` is called in fewer cases than
|
||||
`onAudioSessionId` was called, due to the improved handling of audio
|
||||
session IDs as described above.
|
||||
* Text:
|
||||
* Gracefully handle null-terminated subtitle content in Matroska
|
||||
containers.
|
||||
|
|
|
|||
|
|
@ -19,11 +19,11 @@ package com.google.android.exoplayer2.audio;
|
|||
public interface AudioListener {
|
||||
|
||||
/**
|
||||
* Called when the audio session is set.
|
||||
* Called when the audio session ID changes.
|
||||
*
|
||||
* @param audioSessionId The audio session id.
|
||||
* @param audioSessionId The audio session ID.
|
||||
*/
|
||||
default void onAudioSessionId(int audioSessionId) {}
|
||||
default void onAudioSessionIdChanged(int audioSessionId) {}
|
||||
|
||||
/**
|
||||
* Called when the audio attributes change.
|
||||
|
|
|
|||
|
|
@ -983,7 +983,7 @@ public class SimpleExoPlayer extends BasePlayer
|
|||
sendRendererMessage(C.TRACK_TYPE_AUDIO, Renderer.MSG_SET_AUDIO_SESSION_ID, audioSessionId);
|
||||
sendRendererMessage(C.TRACK_TYPE_VIDEO, Renderer.MSG_SET_AUDIO_SESSION_ID, audioSessionId);
|
||||
for (AudioListener audioListener : audioListeners) {
|
||||
audioListener.onAudioSessionId(audioSessionId);
|
||||
audioListener.onAudioSessionIdChanged(audioSessionId);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -300,7 +300,7 @@ public class AnalyticsCollector
|
|||
// AudioListener implementation.
|
||||
|
||||
@Override
|
||||
public final void onAudioSessionId(int audioSessionId) {
|
||||
public final void onAudioSessionIdChanged(int audioSessionId) {
|
||||
EventTime eventTime = generateReadingMediaPeriodEventTime();
|
||||
sendEvent(
|
||||
eventTime,
|
||||
|
|
|
|||
Loading…
Reference in a new issue