mirror of
https://github.com/androidx/media.git
synced 2025-05-18 13:09:56 +08:00
Fix method ordering in ImaAdsLoader
Put static methods at the end. Also add a couple of missing parameter name comments. PiperOrigin-RevId: 311077684
This commit is contained in:
parent
3478ef3108
commit
8ed82e7621
@ -237,7 +237,7 @@ public final class ImaAdsLoader
|
||||
context,
|
||||
adTagUri,
|
||||
imaSdkSettings,
|
||||
null,
|
||||
/* adsResponse= */ null,
|
||||
vastLoadTimeoutMs,
|
||||
mediaLoadTimeoutMs,
|
||||
mediaBitrate,
|
||||
@ -257,7 +257,7 @@ public final class ImaAdsLoader
|
||||
public ImaAdsLoader buildForAdsResponse(String adsResponse) {
|
||||
return new ImaAdsLoader(
|
||||
context,
|
||||
null,
|
||||
/* adTagUri= */ null,
|
||||
imaSdkSettings,
|
||||
adsResponse,
|
||||
vastLoadTimeoutMs,
|
||||
@ -1359,17 +1359,6 @@ public final class ImaAdsLoader
|
||||
}
|
||||
}
|
||||
|
||||
private static DataSpec getAdsDataSpec(@Nullable Uri adTagUri) {
|
||||
return new DataSpec(adTagUri != null ? adTagUri : Uri.EMPTY);
|
||||
}
|
||||
|
||||
private static long getContentPeriodPositionMs(
|
||||
Player player, Timeline timeline, Timeline.Period period) {
|
||||
long contentWindowPositionMs = player.getContentPosition();
|
||||
return contentWindowPositionMs
|
||||
- timeline.getPeriod(/* periodIndex= */ 0, period).getPositionInWindowMs();
|
||||
}
|
||||
|
||||
private int getAdGroupIndex(AdPodInfo adPodInfo) {
|
||||
if (adPodInfo.getPodIndex() == -1) {
|
||||
// This is a postroll ad.
|
||||
@ -1386,6 +1375,22 @@ public final class ImaAdsLoader
|
||||
throw new IllegalStateException("Failed to find cue point");
|
||||
}
|
||||
|
||||
private String getAdMediaInfoString(AdMediaInfo adMediaInfo) {
|
||||
@Nullable AdInfo adInfo = adInfoByAdMediaInfo.get(adMediaInfo);
|
||||
return "AdMediaInfo[" + adMediaInfo.getUrl() + (adInfo != null ? ", " + adInfo : "") + "]";
|
||||
}
|
||||
|
||||
private static DataSpec getAdsDataSpec(@Nullable Uri adTagUri) {
|
||||
return new DataSpec(adTagUri != null ? adTagUri : Uri.EMPTY);
|
||||
}
|
||||
|
||||
private static long getContentPeriodPositionMs(
|
||||
Player player, Timeline timeline, Timeline.Period period) {
|
||||
long contentWindowPositionMs = player.getContentPosition();
|
||||
return contentWindowPositionMs
|
||||
- timeline.getPeriod(/* periodIndex= */ 0, period).getPositionInWindowMs();
|
||||
}
|
||||
|
||||
private static long[] getAdGroupTimesUs(List<Float> cuePoints) {
|
||||
if (cuePoints.isEmpty()) {
|
||||
// If no cue points are specified, there is a preroll ad.
|
||||
@ -1449,11 +1454,6 @@ public final class ImaAdsLoader
|
||||
Context context, ImaSdkSettings imaSdkSettings, AdDisplayContainer adDisplayContainer);
|
||||
}
|
||||
|
||||
private String getAdMediaInfoString(AdMediaInfo adMediaInfo) {
|
||||
@Nullable AdInfo adInfo = adInfoByAdMediaInfo.get(adMediaInfo);
|
||||
return "AdMediaInfo[" + adMediaInfo.getUrl() + (adInfo != null ? ", " + adInfo : "") + "]";
|
||||
}
|
||||
|
||||
// TODO: Consider moving this into AdPlaybackState.
|
||||
private static final class AdInfo {
|
||||
public final int adGroupIndex;
|
||||
|
Loading…
x
Reference in New Issue
Block a user