From 2d022a21b367848bdfe0d324c0722f5652bef8d7 Mon Sep 17 00:00:00 2001 From: andrewlewis Date: Mon, 2 Nov 2020 11:06:17 +0000 Subject: [PATCH] Fix buildForAdsResponse PiperOrigin-RevId: 340198099 --- RELEASENOTES.md | 1 + .../com/google/android/exoplayer2/ext/ima/ImaAdsLoader.java | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 387fb247a8..b1115d5c39 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -15,6 +15,7 @@ ([#7832](https://github.com/google/ExoPlayer/issues/7832)). * Fix a bug that caused multiple ads in an ad pod to be skipped when one ad in the ad pod was skipped. + * Fix passing an ads response to the `ImaAdsLoader` builder. ### 2.12.1 (2020-10-23) ### diff --git a/extensions/ima/src/main/java/com/google/android/exoplayer2/ext/ima/ImaAdsLoader.java b/extensions/ima/src/main/java/com/google/android/exoplayer2/ext/ima/ImaAdsLoader.java index 265ffe585b..65c8920971 100644 --- a/extensions/ima/src/main/java/com/google/android/exoplayer2/ext/ima/ImaAdsLoader.java +++ b/extensions/ima/src/main/java/com/google/android/exoplayer2/ext/ima/ImaAdsLoader.java @@ -705,7 +705,9 @@ public final class ImaAdsLoader if (adTagUri != null) { adTagDataSpec = new DataSpec(adTagUri); } else if (adsResponse != null) { - adTagDataSpec = new DataSpec(Util.getDataUriForString(adsResponse, "text/xml")); + adTagDataSpec = + new DataSpec( + Util.getDataUriForString(/* mimeType= */ "text/xml", /* data= */ adsResponse)); } else { throw new IllegalStateException(); }