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
fc22f89f
authored
Dec 22, 2022
by
bachinger
Committed by
Marc Baechinger
Jan 04, 2023
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Remove player listener on the application thread of the player
PiperOrigin-RevId: 497183220
parent
69583d0a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
RELEASENOTES.md
libraries/exoplayer_ima/src/main/java/androidx/media3/exoplayer/ima/ImaServerSideAdInsertionMediaSource.java
RELEASENOTES.md
View file @
fc22f89f
...
@@ -60,6 +60,8 @@ Release notes
...
@@ -60,6 +60,8 @@ Release notes
*
Cast extension
*
Cast extension
*
Bump Cast SDK version to 21.2.0.
*
Bump Cast SDK version to 21.2.0.
*
IMA extension
*
IMA extension
*
Remove player listener of the
`ImaServerSideAdInsertionMediaSource`
on
the application thread to avoid threading issues.
*
Bump IMA SDK version to 3.29.0.
*
Bump IMA SDK version to 3.29.0.
### 1.0.0-beta03 (2022-11-22)
### 1.0.0-beta03 (2022-11-22)
...
...
libraries/exoplayer_ima/src/main/java/androidx/media3/exoplayer/ima/ImaServerSideAdInsertionMediaSource.java
View file @
fc22f89f
...
@@ -36,6 +36,7 @@ import android.content.Context;
...
@@ -36,6 +36,7 @@ import android.content.Context;
import
android.net.Uri
;
import
android.net.Uri
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.os.Handler
;
import
android.os.Looper
;
import
android.util.Pair
;
import
android.util.Pair
;
import
android.view.ViewGroup
;
import
android.view.ViewGroup
;
import
androidx.annotation.IntDef
;
import
androidx.annotation.IntDef
;
...
@@ -495,7 +496,8 @@ public final class ImaServerSideAdInsertionMediaSource extends CompositeMediaSou
...
@@ -495,7 +496,8 @@ public final class ImaServerSideAdInsertionMediaSource extends CompositeMediaSou
this
.
applicationAdEventListener
=
applicationAdEventListener
;
this
.
applicationAdEventListener
=
applicationAdEventListener
;
this
.
applicationAdErrorListener
=
applicationAdErrorListener
;
this
.
applicationAdErrorListener
=
applicationAdErrorListener
;
componentListener
=
new
ComponentListener
();
componentListener
=
new
ComponentListener
();
mainHandler
=
Util
.
createHandlerForCurrentLooper
();
Assertions
.
checkArgument
(
player
.
getApplicationLooper
()
==
Looper
.
getMainLooper
());
mainHandler
=
new
Handler
(
Looper
.
getMainLooper
());
Uri
streamRequestUri
=
checkNotNull
(
mediaItem
.
localConfiguration
).
uri
;
Uri
streamRequestUri
=
checkNotNull
(
mediaItem
.
localConfiguration
).
uri
;
isLiveStream
=
ImaServerSideAdInsertionUriBuilder
.
isLiveStream
(
streamRequestUri
);
isLiveStream
=
ImaServerSideAdInsertionUriBuilder
.
isLiveStream
(
streamRequestUri
);
adsId
=
ImaServerSideAdInsertionUriBuilder
.
getAdsId
(
streamRequestUri
);
adsId
=
ImaServerSideAdInsertionUriBuilder
.
getAdsId
(
streamRequestUri
);
...
@@ -572,8 +574,11 @@ public final class ImaServerSideAdInsertionMediaSource extends CompositeMediaSou
...
@@ -572,8 +574,11 @@ public final class ImaServerSideAdInsertionMediaSource extends CompositeMediaSou
super
.
releaseSourceInternal
();
super
.
releaseSourceInternal
();
if
(
loader
!=
null
)
{
if
(
loader
!=
null
)
{
loader
.
release
();
loader
.
release
();
player
.
removeListener
(
componentListener
);
mainHandler
.
post
(
mainHandler
.
post
(()
->
setStreamManager
(
/* streamManager= */
null
));
()
->
{
player
.
removeListener
(
componentListener
);
setStreamManager
(
/* streamManager= */
null
);
});
loader
=
null
;
loader
=
null
;
}
}
}
}
...
...
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