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
87598749
authored
Oct 26, 2020
by
andrewlewis
Committed by
Ian Baker
Nov 18, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Improve handling of VPAID ads
Issue: #7832 PiperOrigin-RevId: 339087555
parent
44c2ddb0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
5 deletions
RELEASENOTES.md
extensions/ima/src/main/java/com/google/android/exoplayer2/ext/ima/ImaAdsLoader.java
RELEASENOTES.md
View file @
87598749
...
@@ -11,6 +11,8 @@
...
@@ -11,6 +11,8 @@
*
IMA extension:
*
IMA extension:
*
Upgrade IMA SDK dependency to 3.21.0, and release the
`AdsLoader`
*
Upgrade IMA SDK dependency to 3.21.0, and release the
`AdsLoader`
(
[
#7344
](
https://github.com/google/ExoPlayer/issues/7344
)
).
(
[
#7344
](
https://github.com/google/ExoPlayer/issues/7344
)
).
*
Improve handling of ad tags with unsupported VPAID ads
(
[
#7832
](
https://github.com/google/ExoPlayer/issues/7832
)
).
### 2.12.1 (2020-10-23) ###
### 2.12.1 (2020-10-23) ###
...
...
extensions/ima/src/main/java/com/google/android/exoplayer2/ext/ima/ImaAdsLoader.java
View file @
87598749
...
@@ -1212,11 +1212,24 @@ public final class ImaAdsLoader
...
@@ -1212,11 +1212,24 @@ public final class ImaAdsLoader
if
(
imaAdInfo
!=
null
)
{
if
(
imaAdInfo
!=
null
)
{
adPlaybackState
=
adPlaybackState
.
withSkippedAdGroup
(
imaAdInfo
.
adGroupIndex
);
adPlaybackState
=
adPlaybackState
.
withSkippedAdGroup
(
imaAdInfo
.
adGroupIndex
);
updateAdPlaybackState
();
updateAdPlaybackState
();
}
else
if
(
adPlaybackState
.
adGroupCount
==
1
&&
adPlaybackState
.
adGroupTimesUs
[
0
]
==
0
)
{
}
else
{
// For incompatible VPAID ads with one preroll, content is resumed immediately. In this case
// Mark any ads for the current/reported player position that haven't loaded as being in the
// we haven't received ad info (the ad never loaded), but there is only one ad group to skip.
// error state, to force resuming content. This includes VPAID ads that never load.
adPlaybackState
=
adPlaybackState
.
withSkippedAdGroup
(
/* adGroupIndex= */
0
);
long
playerPositionUs
;
updateAdPlaybackState
();
if
(
player
!=
null
)
{
playerPositionUs
=
C
.
msToUs
(
getContentPeriodPositionMs
(
player
,
timeline
,
period
));
}
else
if
(!
VideoProgressUpdate
.
VIDEO_TIME_NOT_READY
.
equals
(
lastContentProgress
))
{
// Playback is backgrounded so use the last reported content position.
playerPositionUs
=
C
.
msToUs
(
lastContentProgress
.
getCurrentTimeMs
());
}
else
{
return
;
}
int
adGroupIndex
=
adPlaybackState
.
getAdGroupIndexForPositionUs
(
playerPositionUs
,
C
.
msToUs
(
contentDurationMs
));
if
(
adGroupIndex
!=
C
.
INDEX_UNSET
)
{
markAdGroupInErrorStateAndClearPendingContentPosition
(
adGroupIndex
);
}
}
}
}
}
...
...
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