mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00: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
1 changed files with 18 additions and 18 deletions
|
|
@ -237,7 +237,7 @@ public final class ImaAdsLoader
|
||||||
context,
|
context,
|
||||||
adTagUri,
|
adTagUri,
|
||||||
imaSdkSettings,
|
imaSdkSettings,
|
||||||
null,
|
/* adsResponse= */ null,
|
||||||
vastLoadTimeoutMs,
|
vastLoadTimeoutMs,
|
||||||
mediaLoadTimeoutMs,
|
mediaLoadTimeoutMs,
|
||||||
mediaBitrate,
|
mediaBitrate,
|
||||||
|
|
@ -257,7 +257,7 @@ public final class ImaAdsLoader
|
||||||
public ImaAdsLoader buildForAdsResponse(String adsResponse) {
|
public ImaAdsLoader buildForAdsResponse(String adsResponse) {
|
||||||
return new ImaAdsLoader(
|
return new ImaAdsLoader(
|
||||||
context,
|
context,
|
||||||
null,
|
/* adTagUri= */ null,
|
||||||
imaSdkSettings,
|
imaSdkSettings,
|
||||||
adsResponse,
|
adsResponse,
|
||||||
vastLoadTimeoutMs,
|
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) {
|
private int getAdGroupIndex(AdPodInfo adPodInfo) {
|
||||||
if (adPodInfo.getPodIndex() == -1) {
|
if (adPodInfo.getPodIndex() == -1) {
|
||||||
// This is a postroll ad.
|
// This is a postroll ad.
|
||||||
|
|
@ -1386,6 +1375,22 @@ public final class ImaAdsLoader
|
||||||
throw new IllegalStateException("Failed to find cue point");
|
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) {
|
private static long[] getAdGroupTimesUs(List<Float> cuePoints) {
|
||||||
if (cuePoints.isEmpty()) {
|
if (cuePoints.isEmpty()) {
|
||||||
// If no cue points are specified, there is a preroll ad.
|
// 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);
|
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.
|
// TODO: Consider moving this into AdPlaybackState.
|
||||||
private static final class AdInfo {
|
private static final class AdInfo {
|
||||||
public final int adGroupIndex;
|
public final int adGroupIndex;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue