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
e296bf91
authored
Feb 16, 2022
by
bachinger
Committed by
Ian Baker
Feb 17, 2022
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Clear ad playback state map when AdsLoader is released
#minor-release PiperOrigin-RevId: 429067634
parent
2bc65f94
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
extensions/ima/src/main/java/com/google/android/exoplayer2/ext/ima/ImaServerSideAdInsertionMediaSource.java
extensions/ima/src/main/java/com/google/android/exoplayer2/ext/ima/ImaServerSideAdInsertionMediaSource.java
View file @
e296bf91
...
@@ -291,7 +291,7 @@ public final class ImaServerSideAdInsertionMediaSource extends CompositeMediaSou
...
@@ -291,7 +291,7 @@ public final class ImaServerSideAdInsertionMediaSource extends CompositeMediaSou
}
}
}
}
/** The state of the {@link AdsLoader}. */
/** The state of the {@link AdsLoader}
that can be used when resuming from the background
. */
public
static
class
State
implements
Bundleable
{
public
static
class
State
implements
Bundleable
{
private
final
ImmutableMap
<
String
,
AdPlaybackState
>
adPlaybackStates
;
private
final
ImmutableMap
<
String
,
AdPlaybackState
>
adPlaybackStates
;
...
@@ -387,7 +387,7 @@ public final class ImaServerSideAdInsertionMediaSource extends CompositeMediaSou
...
@@ -387,7 +387,7 @@ public final class ImaServerSideAdInsertionMediaSource extends CompositeMediaSou
/**
/**
* Releases resources.
* Releases resources.
*
*
* @return The {@link State} that can be used
to resume with
.
* @return The {@link State} that can be used
when resuming from the background
.
*/
*/
public
State
release
()
{
public
State
release
()
{
for
(
MediaSourceResourceHolder
resourceHolder
:
mediaSourceResources
.
values
())
{
for
(
MediaSourceResourceHolder
resourceHolder
:
mediaSourceResources
.
values
())
{
...
@@ -396,9 +396,11 @@ public final class ImaServerSideAdInsertionMediaSource extends CompositeMediaSou
...
@@ -396,9 +396,11 @@ public final class ImaServerSideAdInsertionMediaSource extends CompositeMediaSou
resourceHolder
.
imaServerSideAdInsertionMediaSource
.
setStreamManager
(
resourceHolder
.
imaServerSideAdInsertionMediaSource
.
setStreamManager
(
/* streamManager= */
null
);
/* streamManager= */
null
);
}
}
State
state
=
new
State
(
ImmutableMap
.
copyOf
(
adPlaybackStateMap
));
adPlaybackStateMap
.
clear
();
mediaSourceResources
.
clear
();
mediaSourceResources
.
clear
();
player
=
null
;
player
=
null
;
return
new
State
(
ImmutableMap
.
copyOf
(
adPlaybackStateMap
))
;
return
state
;
}
}
// Internal methods.
// Internal methods.
...
...
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