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
929b60e209
commit
e482aa2be8
@ -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,
|
||||
@ -1350,17 +1350,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.
|
||||
@ -1377,6 +1366,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.
|
||||
@ -1440,11 +1445,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