Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
9198dd6f
authored
Jan 13, 2021
by
olly
Committed by
Ian Baker
Jan 15, 2021
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Update AudioListener to reflect new audio session ID logic
PiperOrigin-RevId: 351597144
parent
73114e39
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
5 deletions
RELEASENOTES.md
library/common/src/main/java/com/google/android/exoplayer2/audio/AudioListener.java
library/core/src/main/java/com/google/android/exoplayer2/SimpleExoPlayer.java
library/core/src/main/java/com/google/android/exoplayer2/analytics/AnalyticsCollector.java
RELEASENOTES.md
View file @
9198dd6f
...
@@ -136,6 +136,11 @@
...
@@ -136,6 +136,11 @@
which can be immediately queried by calling
which can be immediately queried by calling
`SimpleExoPlayer.getAudioSessionId`
. The audio session ID will only
`SimpleExoPlayer.getAudioSessionId`
. The audio session ID will only
change if application code calls
`SimpleExoPlayer.setAudioSessionId`
.
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:
*
Text:
*
Gracefully handle null-terminated subtitle content in Matroska
*
Gracefully handle null-terminated subtitle content in Matroska
containers.
containers.
...
...
library/common/src/main/java/com/google/android/exoplayer2/audio/AudioListener.java
View file @
9198dd6f
...
@@ -19,11 +19,11 @@ package com.google.android.exoplayer2.audio;
...
@@ -19,11 +19,11 @@ package com.google.android.exoplayer2.audio;
public
interface
AudioListener
{
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
onAudioSessionId
Changed
(
int
audioSessionId
)
{}
/**
/**
* Called when the audio attributes change.
* Called when the audio attributes change.
...
...
library/core/src/main/java/com/google/android/exoplayer2/SimpleExoPlayer.java
View file @
9198dd6f
...
@@ -983,7 +983,7 @@ public class SimpleExoPlayer extends BasePlayer
...
@@ -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_AUDIO
,
Renderer
.
MSG_SET_AUDIO_SESSION_ID
,
audioSessionId
);
sendRendererMessage
(
C
.
TRACK_TYPE_VIDEO
,
Renderer
.
MSG_SET_AUDIO_SESSION_ID
,
audioSessionId
);
sendRendererMessage
(
C
.
TRACK_TYPE_VIDEO
,
Renderer
.
MSG_SET_AUDIO_SESSION_ID
,
audioSessionId
);
for
(
AudioListener
audioListener
:
audioListeners
)
{
for
(
AudioListener
audioListener
:
audioListeners
)
{
audioListener
.
onAudioSessionId
(
audioSessionId
);
audioListener
.
onAudioSessionId
Changed
(
audioSessionId
);
}
}
}
}
...
...
library/core/src/main/java/com/google/android/exoplayer2/analytics/AnalyticsCollector.java
View file @
9198dd6f
...
@@ -300,7 +300,7 @@ public class AnalyticsCollector
...
@@ -300,7 +300,7 @@ public class AnalyticsCollector
// AudioListener implementation.
// AudioListener implementation.
@Override
@Override
public
final
void
onAudioSessionId
(
int
audioSessionId
)
{
public
final
void
onAudioSessionId
Changed
(
int
audioSessionId
)
{
EventTime
eventTime
=
generateReadingMediaPeriodEventTime
();
EventTime
eventTime
=
generateReadingMediaPeriodEventTime
();
sendEvent
(
sendEvent
(
eventTime
,
eventTime
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment