use of androidx.media3.common.util.UnstableApi in project media by androidx.
the class PlaybackParameters method toBundle.
@UnstableApi
@Override
public Bundle toBundle() {
Bundle bundle = new Bundle();
bundle.putFloat(keyForField(FIELD_SPEED), speed);
bundle.putFloat(keyForField(FIELD_PITCH), pitch);
return bundle;
}
use of androidx.media3.common.util.UnstableApi in project media by androidx.
the class SessionCommand method toBundle.
@UnstableApi
@Override
public Bundle toBundle() {
Bundle bundle = new Bundle();
bundle.putInt(keyForField(FIELD_COMMAND_CODE), commandCode);
bundle.putString(keyForField(FIELD_CUSTOM_ACTION), customAction);
bundle.putBundle(keyForField(FIELD_CUSTOM_EXTRAS), customExtras);
return bundle;
}
use of androidx.media3.common.util.UnstableApi in project media by androidx.
the class SessionToken method toBundle.
@UnstableApi
@Override
public Bundle toBundle() {
Bundle bundle = new Bundle();
if (impl instanceof SessionTokenImplBase) {
bundle.putInt(keyForField(FIELD_IMPL_TYPE), IMPL_TYPE_BASE);
} else {
bundle.putInt(keyForField(FIELD_IMPL_TYPE), IMPL_TYPE_LEGACY);
}
bundle.putBundle(keyForField(FIELD_IMPL), impl.toBundle());
return bundle;
}
use of androidx.media3.common.util.UnstableApi in project media by androidx.
the class ImaAdsLoader method start.
@UnstableApi
@Override
public void start(AdsMediaSource adsMediaSource, DataSpec adTagDataSpec, Object adsId, AdViewProvider adViewProvider, EventListener eventListener) {
checkState(wasSetPlayerCalled, "Set player using adsLoader.setPlayer before preparing the player.");
if (adTagLoaderByAdsMediaSource.isEmpty()) {
player = nextPlayer;
@Nullable Player player = this.player;
if (player == null) {
return;
}
player.addListener(playerListener);
}
@Nullable AdTagLoader adTagLoader = adTagLoaderByAdsId.get(adsId);
if (adTagLoader == null) {
requestAds(adTagDataSpec, adsId, adViewProvider.getAdViewGroup());
adTagLoader = adTagLoaderByAdsId.get(adsId);
}
adTagLoaderByAdsMediaSource.put(adsMediaSource, checkNotNull(adTagLoader));
adTagLoader.addListenerWithAdView(eventListener, adViewProvider);
maybeUpdateCurrentAdTagLoader();
}
Aggregations