Suppress player error during ad playback
Open
@tonihei is already working on this.
Since Jan 24, 2025.
enhancement
- Dominant language
- Java
- Stars
- 3k
- Forks
- 955
- Avg merge
- 12d 14h
- Merged PRs (30d)
- 2
Description
Version
Media3 1.5.1
More version details
No response
Devices that reproduce the issue
Any device
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Yes
Reproduction steps
When playing a content with ads (handled by IMA SDK and media3-exoplayer-ima), and a playback error occurs during an ad playback, then the player stops instead of playing next ads and/or content.
Code example:
String vmapPayload = "<?xml version='1.0' encoding='utf-8'?>\n"
+ "<vmap:VMAP\n"
+ " xmlns:vmap=\"http://www.iab.net/vmap-1.0\" version=\"1.0\">\n"
+ " <vmap:AdBreak breakId=\"0.0.0.2097493962\" breakType=\"linear\" timeOffset=\"start\">\n"
+ " <vmap:AdSource allowMultipleAds=\"true\" followRedirects=\"true\" id=\"1\">\n"
+ " <vmap:VASTAdData>\n"
+ " <VAST\n"
+ " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" version=\"3.0\" xsi:noNamespaceSchemaLocation=\"vast.xsd\">\n"
+ " <Ad id=\"preroll_1_10s\" sequence=\"1\">\n"
+ " <InLine>\n"
+ " <AdTitle>Preroll 1 10s</AdTitle>\n"
+ " <Creatives>\n"
+ " <Creative>\n"
+ " <Linear>\n"
+ " <Duration>00:00:10</Duration>\n"
+ " <MediaFiles>\n"
+ " <MediaFile delivery=\"progressive\" width=\"1920\" height=\"1080\" type=\"video/mp4\">https://redirector.gvt1.com/videoplayback/id/5bad011a1282b323/itag/15/source/gfp_video_ads/requiressl/yes/xpc/EgVovf3BOg%3D%3D/acao/yes/mime/video%2Fmp4/ctier/L/ip/0.0.0.0/ipbits/0/expire/1737562261/sparams/ip,ipbits,expire,id,itag,source,requiressl,xpc,acao,mime,ctier/signature/14D60A0FBE5C83B49C4F42C64F092762E1C4E5E4.629F613FC722416BE01AC39AEEF4C75D044752C4/key/ck2/file/file.mp4</MediaFile>\n"
+ " </MediaFiles>\n"
+ " </Linear>\n"
+ " </Creative>\n"
+ " </Creatives>\n"
+ " </InLine>\n"
+ " </Ad>\n"
+ " <Ad id=\"failing_playback\" sequence=\"2\">\n"
+ " <InLine>\n"
+ " <AdTitle>Failing playback</AdTitle>\n"
+ " <Creatives>\n"
+ " <Creative>\n"
+ " <Linear>\n"
+ " <Duration>00:10:00</Duration>\n"
+ " <MediaFiles>\n"
+ " <MediaFile bitrate=\"3551\" delivery=\"progressive\" height=\"720\" type=\"video/mp4\" width=\"1280\">https://storage.googleapis.com/wvmedia/cenc/h264/tears/tears.mpd</MediaFile>\n"
+ " </MediaFiles>\n"
+ " </Linear>\n"
+ " </Creative>\n"
+ " </Creatives>\n"
+ " </InLine>\n"
+ " </Ad>\n"
+ " <Ad id=\"bumper_5s\" sequence=\"3\">\n"
+ " <InLine>\n"
+ " <AdTitle>Bumper 5s</AdTitle>\n"
+ " <Creatives>\n"
+ " <Creative>\n"
+ " <Linear>\n"
+ " <Duration>00:00:05</Duration>\n"
+ " <MediaFiles>\n"
+ " <MediaFile bitrate=\"3579\" delivery=\"progressive\" height=\"720\" type=\"video/mp4\" width=\"1280\">https://redirector.gvt1.com/videoplayback/id/74a5ae2cc4775d2a/itag/15/source/gfp_video_ads/requiressl/yes/xpc/EgVovf3BOg%3D%3D/acao/yes/mime/video%2Fmp4/ctier/L/ip/0.0.0.0/ipbits/0/expire/1737562262/sparams/ip,ipbits,expire,id,itag,source,requiressl,xpc,acao,mime,ctier/signature/7B2E333F108DC54595B3E668E084900C5947352E.1230133A2A6C78A4976A3FA3F8051A091E6F7DE5/key/ck2/file/file.mp4</MediaFile>\n"
+ " </MediaFiles>\n"
+ " </Linear>\n"
+ " </Creative>\n"
+ " </Creatives>\n"
+ " </InLine>\n"
+ " </Ad>\n"
+ " </VAST>\n"
+ " </vmap:VASTAdData>\n"
+ " </vmap:AdSource>\n"
+ " </vmap:AdBreak>\n"
+ "</vmap:VMAP>";
player.setMediaItem(
new MediaItem.Builder()
.setUri("https://storage.googleapis.com/wvmedia/clear/h264/tears/tears.mpd")
.setDrmConfiguration(
new MediaItem.DrmConfiguration.Builder(C.WIDEVINE_UUID)
.setLicenseUri("https://www.google.com/") // causes ad 2 to fail
.build()
)
.setAdsConfiguration(
new MediaItem.AdsConfiguration.Builder(Util.getDataUriForString("text/xml", vmapPayload))
.build()
)
.build()
);
In this example, the 2nd ad fails to play because it is DRM protected and the given license URL is wrong.
Expected result
Ads following the failed ad play, then the content plays.
Actual result
The player stops with an error.
Media
Not applicable
Bug Report
- You will email the zip file produced by
adb bugreportto android-media-github@google.com after filing this issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.