Search in sources :

Example 1 with ImaServerSideAdInsertionMediaSource

use of androidx.media3.exoplayer.ima.ImaServerSideAdInsertionMediaSource in project media by androidx.

the class ImaServerSideAdInsertionMediaSource method prepareSourceInternal.

@Override
public void prepareSourceInternal(@Nullable TransferListener mediaTransferListener) {
    mainHandler.post(() -> assertSingleInstanceInPlaylist(checkNotNull(player)));
    super.prepareSourceInternal(mediaTransferListener);
    if (loader == null) {
        Loader loader = new Loader("ImaServerSideAdInsertionMediaSource");
        player.addListener(componentListener);
        StreamManagerLoadable streamManagerLoadable = new StreamManagerLoadable(sdkAdsLoader, streamRequest, streamPlayer, applicationAdErrorListener, loadVideoTimeoutMs);
        loader.startLoading(streamManagerLoadable, new StreamManagerLoadableCallback(), /* defaultMinRetryCount= */
        0);
        this.loader = loader;
    }
}
Also used : Loader(androidx.media3.exoplayer.upstream.Loader)

Aggregations

Loader (androidx.media3.exoplayer.upstream.Loader)1