mirror of
https://github.com/androidx/media.git
synced 2025-05-10 00:59:51 +08:00
Add a test for preroll ad playback with ImaAdsLoader
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=202080962
This commit is contained in:
parent
a1f89bec0d
commit
57b7e18b23
@ -41,9 +41,11 @@ dependencies {
|
||||
// |-- com.android.support:customtabs:26.1.0
|
||||
implementation 'com.android.support:support-v4:' + supportLibraryVersion
|
||||
implementation 'com.android.support:customtabs:' + supportLibraryVersion
|
||||
testImplementation 'com.google.truth:truth:' + truthVersion
|
||||
testImplementation 'junit:junit:' + junitVersion
|
||||
testImplementation 'org.mockito:mockito-core:' + mockitoVersion
|
||||
testImplementation 'org.robolectric:robolectric:' + robolectricVersion
|
||||
testImplementation project(modulePrefix + 'testutils-robolectric')
|
||||
}
|
||||
|
||||
ext {
|
||||
|
@ -169,8 +169,6 @@ public final class AdsMediaSource extends CompositeMediaSource<MediaPeriodId> {
|
||||
|
||||
}
|
||||
|
||||
private static final String TAG = "AdsMediaSource";
|
||||
|
||||
private final MediaSource contentMediaSource;
|
||||
private final MediaSourceFactory adMediaSourceFactory;
|
||||
private final AdsLoader adsLoader;
|
||||
@ -338,7 +336,7 @@ public final class AdsMediaSource extends CompositeMediaSource<MediaPeriodId> {
|
||||
Arrays.fill(adDurationsUs[adGroupIndex], oldAdCount, adCount, C.TIME_UNSET);
|
||||
}
|
||||
adGroupMediaSources[adGroupIndex][adIndexInAdGroup] = adMediaSource;
|
||||
deferredMediaPeriodByAdMediaSource.put(adMediaSource, new ArrayList<DeferredMediaPeriod>());
|
||||
deferredMediaPeriodByAdMediaSource.put(adMediaSource, new ArrayList<>());
|
||||
prepareChildSource(id, adMediaSource);
|
||||
}
|
||||
MediaSource mediaSource = adGroupMediaSources[adGroupIndex][adIndexInAdGroup];
|
||||
|
@ -15,15 +15,15 @@
|
||||
*/
|
||||
package com.google.android.exoplayer2.source.ads;
|
||||
|
||||
import android.support.annotation.VisibleForTesting;
|
||||
import com.google.android.exoplayer2.C;
|
||||
import com.google.android.exoplayer2.Timeline;
|
||||
import com.google.android.exoplayer2.source.ForwardingTimeline;
|
||||
import com.google.android.exoplayer2.util.Assertions;
|
||||
|
||||
/**
|
||||
* A {@link Timeline} for sources that have ads.
|
||||
*/
|
||||
/* package */ final class SinglePeriodAdTimeline extends ForwardingTimeline {
|
||||
/** A {@link Timeline} for sources that have ads. */
|
||||
@VisibleForTesting(otherwise = VisibleForTesting.PACKAGE_PRIVATE)
|
||||
public final class SinglePeriodAdTimeline extends ForwardingTimeline {
|
||||
|
||||
private final AdPlaybackState adPlaybackState;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user