Replace or suppress deprecated usages
Many usages are needed to support other deprecations and some can be replaced by the recommended direct alternative. Also replace links to deprecated/redirected dev site PiperOrigin-RevId: 601795998
This commit is contained in:
parent
7424cffce1
commit
ed5b7004b4
@ -44,6 +44,7 @@ import androidx.recyclerview.widget.RecyclerView.ViewHolder;
|
||||
import com.google.android.gms.cast.framework.CastButtonFactory;
|
||||
import com.google.android.gms.cast.framework.CastContext;
|
||||
import com.google.android.gms.dynamite.DynamiteModule;
|
||||
import com.google.common.util.concurrent.MoreExecutors;
|
||||
|
||||
/**
|
||||
* An activity that plays video using {@link ExoPlayer} and supports casting using ExoPlayer's Cast
|
||||
@ -65,7 +66,7 @@ public class MainActivity extends AppCompatActivity
|
||||
super.onCreate(savedInstanceState);
|
||||
// Getting the cast context later than onStart can cause device discovery not to take place.
|
||||
try {
|
||||
castContext = CastContext.getSharedInstance(this);
|
||||
castContext = CastContext.getSharedInstance(this, MoreExecutors.directExecutor()).getResult();
|
||||
} catch (RuntimeException e) {
|
||||
Throwable cause = e.getCause();
|
||||
while (cause != null) {
|
||||
|
@ -20,7 +20,8 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.net.Uri;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.widget.Toast;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.OptIn;
|
||||
@ -54,6 +55,9 @@ import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
/** Tracks media that has been downloaded. */
|
||||
@OptIn(markerClass = androidx.media3.common.util.UnstableApi.class)
|
||||
@ -182,7 +186,7 @@ public class DownloadTracker {
|
||||
trackSelectionDialog.dismiss();
|
||||
}
|
||||
if (widevineOfflineLicenseFetchTask != null) {
|
||||
widevineOfflineLicenseFetchTask.cancel(false);
|
||||
widevineOfflineLicenseFetchTask.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
@ -358,14 +362,16 @@ public class DownloadTracker {
|
||||
|
||||
/** Downloads a Widevine offline license in a background thread. */
|
||||
@RequiresApi(18)
|
||||
private static final class WidevineOfflineLicenseFetchTask extends AsyncTask<Void, Void, Void> {
|
||||
private static final class WidevineOfflineLicenseFetchTask {
|
||||
|
||||
private final Format format;
|
||||
private final MediaItem.DrmConfiguration drmConfiguration;
|
||||
private final DataSource.Factory dataSourceFactory;
|
||||
private final StartDownloadDialogHelper dialogHelper;
|
||||
private final DownloadHelper downloadHelper;
|
||||
private final ExecutorService executorService;
|
||||
|
||||
@Nullable Future<?> future;
|
||||
@Nullable private byte[] keySetId;
|
||||
@Nullable private DrmSession.DrmSessionException drmSessionException;
|
||||
|
||||
@ -375,6 +381,7 @@ public class DownloadTracker {
|
||||
DataSource.Factory dataSourceFactory,
|
||||
StartDownloadDialogHelper dialogHelper,
|
||||
DownloadHelper downloadHelper) {
|
||||
this.executorService = Executors.newSingleThreadExecutor();
|
||||
this.format = format;
|
||||
this.drmConfiguration = drmConfiguration;
|
||||
this.dataSourceFactory = dataSourceFactory;
|
||||
@ -382,32 +389,41 @@ public class DownloadTracker {
|
||||
this.downloadHelper = downloadHelper;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Void doInBackground(Void... voids) {
|
||||
OfflineLicenseHelper offlineLicenseHelper =
|
||||
OfflineLicenseHelper.newWidevineInstance(
|
||||
drmConfiguration.licenseUri.toString(),
|
||||
drmConfiguration.forceDefaultLicenseUri,
|
||||
dataSourceFactory,
|
||||
drmConfiguration.licenseRequestHeaders,
|
||||
new DrmSessionEventListener.EventDispatcher());
|
||||
try {
|
||||
keySetId = offlineLicenseHelper.downloadLicense(format);
|
||||
} catch (DrmSession.DrmSessionException e) {
|
||||
drmSessionException = e;
|
||||
} finally {
|
||||
offlineLicenseHelper.release();
|
||||
public void cancel() {
|
||||
if (future != null) {
|
||||
future.cancel(/* mayInterruptIfRunning= */ false);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(Void aVoid) {
|
||||
if (drmSessionException != null) {
|
||||
dialogHelper.onOfflineLicenseFetchedError(drmSessionException);
|
||||
} else {
|
||||
dialogHelper.onOfflineLicenseFetched(downloadHelper, checkNotNull(keySetId));
|
||||
}
|
||||
public void execute() {
|
||||
future =
|
||||
executorService.submit(
|
||||
() -> {
|
||||
OfflineLicenseHelper offlineLicenseHelper =
|
||||
OfflineLicenseHelper.newWidevineInstance(
|
||||
drmConfiguration.licenseUri.toString(),
|
||||
drmConfiguration.forceDefaultLicenseUri,
|
||||
dataSourceFactory,
|
||||
drmConfiguration.licenseRequestHeaders,
|
||||
new DrmSessionEventListener.EventDispatcher());
|
||||
try {
|
||||
keySetId = offlineLicenseHelper.downloadLicense(format);
|
||||
} catch (DrmSession.DrmSessionException e) {
|
||||
drmSessionException = e;
|
||||
} finally {
|
||||
offlineLicenseHelper.release();
|
||||
new Handler(Looper.getMainLooper())
|
||||
.post(
|
||||
() -> {
|
||||
if (drmSessionException != null) {
|
||||
dialogHelper.onOfflineLicenseFetchedError(drmSessionException);
|
||||
} else {
|
||||
dialogHelper.onOfflineLicenseFetched(
|
||||
downloadHelper, checkNotNull(keySetId));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -26,9 +26,10 @@ import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.AssetManager;
|
||||
import android.net.Uri;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.text.TextUtils;
|
||||
import android.util.JsonReader;
|
||||
import android.view.Menu;
|
||||
@ -72,6 +73,8 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
/** An activity for selecting from a list of media samples. */
|
||||
public class SampleChooserActivity extends AppCompatActivity
|
||||
@ -282,34 +285,42 @@ public class SampleChooserActivity extends AppCompatActivity
|
||||
return menuItem != null && menuItem.isChecked();
|
||||
}
|
||||
|
||||
private final class SampleListLoader extends AsyncTask<String, Void, List<PlaylistGroup>> {
|
||||
private final class SampleListLoader {
|
||||
|
||||
private final ExecutorService executorService;
|
||||
|
||||
private boolean sawError;
|
||||
|
||||
@OptIn(markerClass = androidx.media3.common.util.UnstableApi.class)
|
||||
@Override
|
||||
protected List<PlaylistGroup> doInBackground(String... uris) {
|
||||
List<PlaylistGroup> result = new ArrayList<>();
|
||||
Context context = getApplicationContext();
|
||||
DataSource dataSource = DemoUtil.getDataSourceFactory(context).createDataSource();
|
||||
for (String uri : uris) {
|
||||
DataSpec dataSpec = new DataSpec(Uri.parse(uri));
|
||||
InputStream inputStream = new DataSourceInputStream(dataSource, dataSpec);
|
||||
try {
|
||||
readPlaylistGroups(new JsonReader(new InputStreamReader(inputStream, "UTF-8")), result);
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "Error loading sample list: " + uri, e);
|
||||
sawError = true;
|
||||
} finally {
|
||||
DataSourceUtil.closeQuietly(dataSource);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
public SampleListLoader() {
|
||||
executorService = Executors.newSingleThreadExecutor();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(List<PlaylistGroup> result) {
|
||||
onPlaylistGroups(result, sawError);
|
||||
@OptIn(markerClass = androidx.media3.common.util.UnstableApi.class)
|
||||
public void execute(String... uris) {
|
||||
executorService.execute(
|
||||
() -> {
|
||||
List<PlaylistGroup> result = new ArrayList<>();
|
||||
Context context = getApplicationContext();
|
||||
DataSource dataSource = DemoUtil.getDataSourceFactory(context).createDataSource();
|
||||
for (String uri : uris) {
|
||||
DataSpec dataSpec = new DataSpec(Uri.parse(uri));
|
||||
InputStream inputStream = new DataSourceInputStream(dataSource, dataSpec);
|
||||
try {
|
||||
readPlaylistGroups(
|
||||
new JsonReader(new InputStreamReader(inputStream, "UTF-8")), result);
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "Error loading sample list: " + uri, e);
|
||||
sawError = true;
|
||||
} finally {
|
||||
DataSourceUtil.closeQuietly(dataSource);
|
||||
}
|
||||
}
|
||||
new Handler(Looper.getMainLooper())
|
||||
.post(
|
||||
() -> {
|
||||
onPlaylistGroups(result, sawError);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private void readPlaylistGroups(JsonReader reader, List<PlaylistGroup> groups)
|
||||
|
@ -61,6 +61,6 @@ manual steps.
|
||||
(this will only appear if the AAR is present), then build and run the demo
|
||||
app and select a MediaPipe-based effect.
|
||||
|
||||
[Transformer]: https://developer.android.com/guide/topics/media/transforming-media
|
||||
[Transformer]: https://developer.android.com/media/media3/transformer
|
||||
[MediaPipe]: https://google.github.io/mediapipe/
|
||||
[build an AAR]: https://google.github.io/mediapipe/getting_started/android_archive_library.html
|
||||
|
@ -109,6 +109,7 @@ public final class AdOverlayInfo {
|
||||
* @deprecated Use {@link Builder} instead.
|
||||
*/
|
||||
@UnstableApi
|
||||
@SuppressWarnings("deprecation") // Intentionally using deprecated constructor
|
||||
@Deprecated
|
||||
public AdOverlayInfo(View view, @Purpose int purpose) {
|
||||
this(view, purpose, /* detailedReason= */ null);
|
||||
|
@ -117,6 +117,7 @@ public final class AdPlaybackState implements Bundleable {
|
||||
/* isServerSideInserted= */ false);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally assigning deprecated field
|
||||
private AdGroup(
|
||||
long timeUs,
|
||||
int count,
|
||||
@ -502,8 +503,9 @@ public final class AdPlaybackState implements Bundleable {
|
||||
private static final String FIELD_ORIGINAL_COUNT = Util.intToStringMaxRadix(7);
|
||||
@VisibleForTesting static final String FIELD_MEDIA_ITEMS = Util.intToStringMaxRadix(8);
|
||||
|
||||
// Intentionally assigning deprecated field.
|
||||
// putParcelableArrayList actually supports null elements.
|
||||
@SuppressWarnings("nullness:argument")
|
||||
@SuppressWarnings({"deprecation", "nullness:argument"})
|
||||
@Override
|
||||
public Bundle toBundle() {
|
||||
Bundle bundle = new Bundle();
|
||||
|
@ -42,8 +42,8 @@ import java.util.UUID;
|
||||
*
|
||||
* <p>When building formats, populate all fields whose values are known and relevant to the type of
|
||||
* format being constructed. For information about different types of format, see ExoPlayer's <a
|
||||
* href="https://developer.android.com/guide/topics/media/exoplayer/supported-formats">Supported
|
||||
* formats page</a>.
|
||||
* href="https://developer.android.com/media/media3/exoplayer/supported-formats">Supported formats
|
||||
* page</a>.
|
||||
*
|
||||
* <h2>Fields commonly relevant to all formats</h2>
|
||||
*
|
||||
|
@ -860,6 +860,7 @@ public class ForwardingPlayer implements Player {
|
||||
/**
|
||||
* @deprecated Use {@link #setDeviceVolume(int, int)} instead.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Intentionally forwarding deprecated method
|
||||
@Deprecated
|
||||
@Override
|
||||
public void setDeviceVolume(int volume) {
|
||||
@ -875,6 +876,7 @@ public class ForwardingPlayer implements Player {
|
||||
/**
|
||||
* @deprecated Use {@link #increaseDeviceVolume(int)} instead.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Intentionally forwarding deprecated method
|
||||
@Deprecated
|
||||
@Override
|
||||
public void increaseDeviceVolume() {
|
||||
@ -890,6 +892,7 @@ public class ForwardingPlayer implements Player {
|
||||
/**
|
||||
* @deprecated Use {@link #decreaseDeviceVolume(int)} instead.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Intentionally forwarding deprecated method
|
||||
@Deprecated
|
||||
@Override
|
||||
public void decreaseDeviceVolume() {
|
||||
@ -905,6 +908,7 @@ public class ForwardingPlayer implements Player {
|
||||
/**
|
||||
* @deprecated Use {@link #setDeviceMuted(boolean, int)} instead.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Intentionally forwarding deprecated method
|
||||
@Deprecated
|
||||
@Override
|
||||
public void setDeviceMuted(boolean muted) {
|
||||
@ -1106,6 +1110,7 @@ public class ForwardingPlayer implements Player {
|
||||
listener.onSkipSilenceEnabledChanged(skipSilenceEnabled);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally forwarding deprecated method
|
||||
@Override
|
||||
public void onCues(List<Cue> cues) {
|
||||
listener.onCues(cues);
|
||||
|
@ -100,6 +100,8 @@ public final class MediaItem implements Bundleable {
|
||||
imageDurationMs = C.TIME_UNSET;
|
||||
}
|
||||
|
||||
// Using deprecated DrmConfiguration.Builder to support deprecated methods.
|
||||
@SuppressWarnings("deprecation")
|
||||
private Builder(MediaItem mediaItem) {
|
||||
this();
|
||||
clippingConfiguration = mediaItem.clippingConfiguration.buildUpon();
|
||||
@ -243,6 +245,8 @@ public final class MediaItem implements Bundleable {
|
||||
}
|
||||
|
||||
/** Sets the optional DRM configuration. */
|
||||
// Using deprecated DrmConfiguration.Builder to support deprecated methods.
|
||||
@SuppressWarnings("deprecation")
|
||||
@CanIgnoreReturnValue
|
||||
public Builder setDrmConfiguration(@Nullable DrmConfiguration drmConfiguration) {
|
||||
this.drmConfiguration =
|
||||
@ -294,6 +298,7 @@ public final class MediaItem implements Bundleable {
|
||||
* @deprecated Use {@link #setDrmConfiguration(DrmConfiguration)} and pass the {@code uuid} to
|
||||
* {@link DrmConfiguration.Builder#Builder(UUID)} instead.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Forwarding deprecated call
|
||||
@CanIgnoreReturnValue
|
||||
@UnstableApi
|
||||
@Deprecated
|
||||
@ -414,6 +419,7 @@ public final class MediaItem implements Bundleable {
|
||||
* #setSubtitleConfigurations(List)} doesn't accept null, use an empty list to clear the
|
||||
* contents.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Supporting deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@UnstableApi
|
||||
@Deprecated
|
||||
@ -450,6 +456,7 @@ public final class MediaItem implements Bundleable {
|
||||
* with {@link Uri#parse(String)} and pass the result to {@link
|
||||
* AdsConfiguration.Builder#Builder(Uri)} instead.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Forwarding to other deprecated setter
|
||||
@CanIgnoreReturnValue
|
||||
@UnstableApi
|
||||
@Deprecated
|
||||
@ -461,6 +468,7 @@ public final class MediaItem implements Bundleable {
|
||||
* @deprecated Use {@link #setAdsConfiguration(AdsConfiguration)} and pass the {@code adTagUri}
|
||||
* to {@link AdsConfiguration.Builder#Builder(Uri)} instead.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Forwarding to other deprecated setter
|
||||
@CanIgnoreReturnValue
|
||||
@UnstableApi
|
||||
@Deprecated
|
||||
@ -593,6 +601,7 @@ public final class MediaItem implements Bundleable {
|
||||
}
|
||||
|
||||
/** Returns a new {@link MediaItem} instance with the current builder values. */
|
||||
@SuppressWarnings("deprecation") // Building deprecated ClippingProperties type
|
||||
public MediaItem build() {
|
||||
// TODO: remove this check once all the deprecated individual DRM setters are removed.
|
||||
checkState(drmConfiguration.licenseUri == null || drmConfiguration.scheme != null);
|
||||
@ -1172,7 +1181,10 @@ public final class MediaItem implements Bundleable {
|
||||
/**
|
||||
* @deprecated Use {@link #subtitleConfigurations} instead.
|
||||
*/
|
||||
@UnstableApi @Deprecated public final List<Subtitle> subtitles;
|
||||
@SuppressWarnings("deprecation") // Using deprecated type in deprecated field
|
||||
@UnstableApi
|
||||
@Deprecated
|
||||
public final List<Subtitle> subtitles;
|
||||
|
||||
/**
|
||||
* Optional tag for custom attributes. The tag for the media source which will be published in
|
||||
@ -1577,12 +1589,18 @@ public final class MediaItem implements Bundleable {
|
||||
/** Restores a {@code LiveConfiguration} from a {@link Bundle}. */
|
||||
@UnstableApi
|
||||
public static LiveConfiguration fromBundle(Bundle bundle) {
|
||||
return new LiveConfiguration(
|
||||
bundle.getLong(FIELD_TARGET_OFFSET_MS, /* defaultValue= */ UNSET.targetOffsetMs),
|
||||
bundle.getLong(FIELD_MIN_OFFSET_MS, /* defaultValue= */ UNSET.minOffsetMs),
|
||||
bundle.getLong(FIELD_MAX_OFFSET_MS, /* defaultValue= */ UNSET.maxOffsetMs),
|
||||
bundle.getFloat(FIELD_MIN_PLAYBACK_SPEED, /* defaultValue= */ UNSET.minPlaybackSpeed),
|
||||
bundle.getFloat(FIELD_MAX_PLAYBACK_SPEED, /* defaultValue= */ UNSET.maxPlaybackSpeed));
|
||||
return new LiveConfiguration.Builder()
|
||||
.setTargetOffsetMs(
|
||||
bundle.getLong(FIELD_TARGET_OFFSET_MS, /* defaultValue= */ UNSET.targetOffsetMs))
|
||||
.setMinOffsetMs(
|
||||
bundle.getLong(FIELD_MIN_OFFSET_MS, /* defaultValue= */ UNSET.minOffsetMs))
|
||||
.setMaxOffsetMs(
|
||||
bundle.getLong(FIELD_MAX_OFFSET_MS, /* defaultValue= */ UNSET.maxOffsetMs))
|
||||
.setMinPlaybackSpeed(
|
||||
bundle.getFloat(FIELD_MIN_PLAYBACK_SPEED, /* defaultValue= */ UNSET.minPlaybackSpeed))
|
||||
.setMaxPlaybackSpeed(
|
||||
bundle.getFloat(FIELD_MAX_PLAYBACK_SPEED, /* defaultValue= */ UNSET.maxPlaybackSpeed))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1673,6 +1691,7 @@ public final class MediaItem implements Bundleable {
|
||||
return new SubtitleConfiguration(this);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Building deprecated type to support deprecated builder
|
||||
private Subtitle buildSubtitle() {
|
||||
return new Subtitle(this);
|
||||
}
|
||||
@ -1845,6 +1864,7 @@ public final class MediaItem implements Bundleable {
|
||||
/**
|
||||
* @deprecated Use {@link Builder} instead.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Forwarding to other deprecated constructor
|
||||
@UnstableApi
|
||||
@Deprecated
|
||||
public Subtitle(Uri uri, String mimeType, @Nullable String language) {
|
||||
@ -1854,6 +1874,7 @@ public final class MediaItem implements Bundleable {
|
||||
/**
|
||||
* @deprecated Use {@link Builder} instead.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Forwarding to other deprecated constructor
|
||||
@UnstableApi
|
||||
@Deprecated
|
||||
public Subtitle(
|
||||
@ -1989,12 +2010,13 @@ public final class MediaItem implements Bundleable {
|
||||
* builder.
|
||||
*/
|
||||
public ClippingConfiguration build() {
|
||||
return buildClippingProperties();
|
||||
return new ClippingConfiguration(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #build()} instead.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Building deprecated type to support deprecated methods
|
||||
@UnstableApi
|
||||
@Deprecated
|
||||
public ClippingProperties buildClippingProperties() {
|
||||
@ -2130,6 +2152,7 @@ public final class MediaItem implements Bundleable {
|
||||
public static final Creator<ClippingProperties> CREATOR = ClippingConfiguration::fromBundle;
|
||||
|
||||
/** Restores a {@code ClippingProperties} from a {@link Bundle}. */
|
||||
@SuppressWarnings("deprecation") // Building deprecated type for backwards compatibility
|
||||
@UnstableApi
|
||||
public static ClippingProperties fromBundle(Bundle bundle) {
|
||||
ClippingConfiguration.Builder clippingConfiguration =
|
||||
@ -2170,6 +2193,7 @@ public final class MediaItem implements Bundleable {
|
||||
@UnstableApi
|
||||
@Deprecated
|
||||
public static final class ClippingProperties extends ClippingConfiguration {
|
||||
@SuppressWarnings("deprecation") // Using deprecated type
|
||||
public static final ClippingProperties UNSET =
|
||||
new ClippingConfiguration.Builder().buildClippingProperties();
|
||||
|
||||
@ -2356,7 +2380,10 @@ public final class MediaItem implements Bundleable {
|
||||
/**
|
||||
* @deprecated Use {@link #clippingConfiguration} instead.
|
||||
*/
|
||||
@UnstableApi @Deprecated public final ClippingProperties clippingProperties;
|
||||
@SuppressWarnings("deprecation") // Keeping deprecated field with deprecated type
|
||||
@UnstableApi
|
||||
@Deprecated
|
||||
public final ClippingProperties clippingProperties;
|
||||
|
||||
/** The media {@link RequestMetadata}. */
|
||||
public final RequestMetadata requestMetadata;
|
||||
|
@ -219,6 +219,7 @@ public final class MimeTypes {
|
||||
* Returns whether the given string is a text MIME type, including known text types that use
|
||||
* "application" as their base type.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Supporting deprecated MIME types
|
||||
@UnstableApi
|
||||
@Pure
|
||||
public static boolean isText(@Nullable String mimeType) {
|
||||
|
@ -520,6 +520,7 @@ public interface Player {
|
||||
@UnstableApi
|
||||
public static final class Builder {
|
||||
|
||||
@SuppressWarnings("deprecation") // Includes deprecated commands
|
||||
private static final @Command int[] SUPPORTED_COMMANDS = {
|
||||
COMMAND_PLAY_PAUSE,
|
||||
COMMAND_PREPARE,
|
||||
@ -1315,6 +1316,7 @@ public interface Player {
|
||||
*/
|
||||
// @Target list includes both 'default' targets and TYPE_USE, to ensure backwards compatibility
|
||||
// with Kotlin usages from before TYPE_USE was added.
|
||||
@SuppressWarnings("deprecation") // Includes deprecated command
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@Target({FIELD, METHOD, PARAMETER, LOCAL_VARIABLE, TYPE_USE})
|
||||
|
@ -2767,6 +2767,7 @@ public abstract class SimpleBasePlayer extends BasePlayer {
|
||||
/**
|
||||
* @deprecated Use {@link #setDeviceVolume(int, int)} instead.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Using deprecated command code
|
||||
@Deprecated
|
||||
@Override
|
||||
public final void setDeviceVolume(int volume) {
|
||||
@ -2797,6 +2798,7 @@ public abstract class SimpleBasePlayer extends BasePlayer {
|
||||
/**
|
||||
* @deprecated Use {@link #increaseDeviceVolume(int)} instead.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Using deprecated command code
|
||||
@Deprecated
|
||||
@Override
|
||||
public final void increaseDeviceVolume() {
|
||||
@ -2829,6 +2831,7 @@ public abstract class SimpleBasePlayer extends BasePlayer {
|
||||
/**
|
||||
* @deprecated Use {@link #decreaseDeviceVolume(int)} instead.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Using deprecated command code
|
||||
@Deprecated
|
||||
@Override
|
||||
public final void decreaseDeviceVolume() {
|
||||
@ -2861,6 +2864,7 @@ public abstract class SimpleBasePlayer extends BasePlayer {
|
||||
/**
|
||||
* @deprecated Use {@link #setDeviceMuted(boolean, int)} instead.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Using deprecated command code
|
||||
@Deprecated
|
||||
@Override
|
||||
public final void setDeviceMuted(boolean muted) {
|
||||
|
@ -144,6 +144,7 @@ public final class NetworkTypeObserver {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Using deprecated NetworkInfo for compatibility to older APIs
|
||||
private static @C.NetworkType int getNetworkTypeFromConnectivityManager(Context context) {
|
||||
NetworkInfo networkInfo;
|
||||
@Nullable
|
||||
|
@ -27,6 +27,8 @@ import kotlin.annotations.jvm.UnderMigration;
|
||||
* Annotation to declare all type usages in the annotated instance as {@link Nonnull}, unless
|
||||
* explicitly marked with a nullable annotation.
|
||||
*/
|
||||
// MigrationStatus.STRICT is marked as deprecated because it's considered experimental
|
||||
@SuppressWarnings("deprecation")
|
||||
@Nonnull
|
||||
@TypeQualifierDefault(ElementType.TYPE_USE)
|
||||
@UnderMigration(status = MigrationStatus.STRICT)
|
||||
|
@ -2558,7 +2558,7 @@ public final class Util {
|
||||
return C.CONTENT_TYPE_HLS;
|
||||
case "ism":
|
||||
case "isml":
|
||||
return C.TYPE_SS;
|
||||
return C.CONTENT_TYPE_SS;
|
||||
default:
|
||||
return C.CONTENT_TYPE_OTHER;
|
||||
}
|
||||
|
@ -133,6 +133,7 @@ public class CronetDataSource extends BaseDataSource implements HttpDataSource {
|
||||
* CronetEngineWrapper#getCronetEngine()} would have returned {@code null}.
|
||||
*/
|
||||
@UnstableApi
|
||||
@SuppressWarnings("deprecation") // Intentionally using deprecated parameter
|
||||
@Deprecated
|
||||
public Factory(CronetEngineWrapper cronetEngineWrapper, Executor executor) {
|
||||
this.cronetEngine = cronetEngineWrapper.getCronetEngine();
|
||||
@ -325,6 +326,7 @@ public class CronetDataSource extends BaseDataSource implements HttpDataSource {
|
||||
* {@link CronetEngine} is not available. Use the fallback factory directly in such cases.
|
||||
*/
|
||||
@CanIgnoreReturnValue
|
||||
@SuppressWarnings("deprecation") // Intentionally referring to deprecated parameter
|
||||
@UnstableApi
|
||||
@Deprecated
|
||||
public Factory setFallbackFactory(@Nullable HttpDataSource.Factory fallbackFactory) {
|
||||
|
@ -41,7 +41,9 @@ public final class CronetDataSourceFactory extends BaseFactory {
|
||||
public static final int DEFAULT_READ_TIMEOUT_MILLIS =
|
||||
CronetDataSource.DEFAULT_READ_TIMEOUT_MILLIS;
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally using deprecated type
|
||||
private final CronetEngineWrapper cronetEngineWrapper;
|
||||
|
||||
private final Executor executor;
|
||||
@Nullable private final TransferListener transferListener;
|
||||
private final int connectTimeoutMs;
|
||||
@ -63,6 +65,7 @@ public final class CronetDataSourceFactory extends BaseFactory {
|
||||
* @param fallbackFactory A {@link HttpDataSource.Factory} which is used as a fallback in case no
|
||||
* suitable CronetEngine can be build.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Intentionally using deprecated parameter
|
||||
public CronetDataSourceFactory(
|
||||
CronetEngineWrapper cronetEngineWrapper,
|
||||
Executor executor,
|
||||
@ -89,6 +92,7 @@ public final class CronetDataSourceFactory extends BaseFactory {
|
||||
* @param cronetEngineWrapper A {@link CronetEngineWrapper}.
|
||||
* @param executor The {@link java.util.concurrent.Executor} that will perform the requests.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Intentionally using deprecated parameter
|
||||
public CronetDataSourceFactory(CronetEngineWrapper cronetEngineWrapper, Executor executor) {
|
||||
this(cronetEngineWrapper, executor, /* userAgent= */ (String) null);
|
||||
}
|
||||
@ -108,6 +112,7 @@ public final class CronetDataSourceFactory extends BaseFactory {
|
||||
* needed, or {@code null} for the fallback to use the default user agent of the underlying
|
||||
* platform.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Intentionally using deprecated parameter
|
||||
public CronetDataSourceFactory(
|
||||
CronetEngineWrapper cronetEngineWrapper, Executor executor, @Nullable String userAgent) {
|
||||
this(
|
||||
@ -135,6 +140,7 @@ public final class CronetDataSourceFactory extends BaseFactory {
|
||||
* needed, or {@code null} for the fallback to use the default user agent of the underlying
|
||||
* platform.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Intentionally using deprecated parameter
|
||||
public CronetDataSourceFactory(
|
||||
CronetEngineWrapper cronetEngineWrapper,
|
||||
Executor executor,
|
||||
@ -169,6 +175,7 @@ public final class CronetDataSourceFactory extends BaseFactory {
|
||||
* @param fallbackFactory A {@link HttpDataSource.Factory} which is used as a fallback in case no
|
||||
* suitable CronetEngine can be build.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Intentionally using deprecated parameter
|
||||
public CronetDataSourceFactory(
|
||||
CronetEngineWrapper cronetEngineWrapper,
|
||||
Executor executor,
|
||||
@ -201,6 +208,7 @@ public final class CronetDataSourceFactory extends BaseFactory {
|
||||
* @param fallbackFactory A {@link HttpDataSource.Factory} which is used as a fallback in case no
|
||||
* suitable CronetEngine can be build.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Intentionally using deprecated parameter
|
||||
public CronetDataSourceFactory(
|
||||
CronetEngineWrapper cronetEngineWrapper,
|
||||
Executor executor,
|
||||
@ -229,6 +237,7 @@ public final class CronetDataSourceFactory extends BaseFactory {
|
||||
* @param executor The {@link java.util.concurrent.Executor} that will perform the requests.
|
||||
* @param transferListener An optional listener.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Intentionally using deprecated parameter
|
||||
public CronetDataSourceFactory(
|
||||
CronetEngineWrapper cronetEngineWrapper,
|
||||
Executor executor,
|
||||
@ -252,6 +261,7 @@ public final class CronetDataSourceFactory extends BaseFactory {
|
||||
* needed, or {@code null} for the fallback to use the default user agent of the underlying
|
||||
* platform.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Intentionally using deprecated parameter
|
||||
public CronetDataSourceFactory(
|
||||
CronetEngineWrapper cronetEngineWrapper,
|
||||
Executor executor,
|
||||
@ -285,6 +295,7 @@ public final class CronetDataSourceFactory extends BaseFactory {
|
||||
* needed, or {@code null} for the fallback to use the default user agent of the underlying
|
||||
* platform.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Intentionally using deprecated parameter
|
||||
public CronetDataSourceFactory(
|
||||
CronetEngineWrapper cronetEngineWrapper,
|
||||
Executor executor,
|
||||
@ -322,6 +333,7 @@ public final class CronetDataSourceFactory extends BaseFactory {
|
||||
* @param fallbackFactory A {@link HttpDataSource.Factory} which is used as a fallback in case no
|
||||
* suitable CronetEngine can be build.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Intentionally using deprecated parameter
|
||||
public CronetDataSourceFactory(
|
||||
CronetEngineWrapper cronetEngineWrapper,
|
||||
Executor executor,
|
||||
|
@ -452,10 +452,10 @@ public class OkHttpDataSource extends BaseDataSource implements HttpDataSource {
|
||||
|
||||
@Nullable RequestBody requestBody = null;
|
||||
if (dataSpec.httpBody != null) {
|
||||
requestBody = RequestBody.create(null, dataSpec.httpBody);
|
||||
requestBody = RequestBody.create(dataSpec.httpBody);
|
||||
} else if (dataSpec.httpMethod == DataSpec.HTTP_METHOD_POST) {
|
||||
// OkHttp requires a non-null body for POST requests.
|
||||
requestBody = RequestBody.create(null, Util.EMPTY_BYTE_ARRAY);
|
||||
requestBody = RequestBody.create(Util.EMPTY_BYTE_ARRAY);
|
||||
}
|
||||
builder.method(dataSpec.getHttpMethodString(), requestBody);
|
||||
return builder.build();
|
||||
|
@ -128,4 +128,4 @@ GL rendering mode has better performance, so should be preferred
|
||||
|
||||
* [Troubleshooting using decoding extensions][]
|
||||
|
||||
[Troubleshooting using decoding extensions]: https://developer.android.com/guide/topics/media/exoplayer/troubleshooting#how-can-i-get-a-decoding-library-to-load-and-be-used-for-playbacks
|
||||
[Troubleshooting using decoding extensions]: https://developer.android.com/media/media3/exoplayer/troubleshooting#how-can-i-get-a-decoding-library-to-load-and-be-used-for-playback
|
||||
|
@ -124,10 +124,10 @@ then implement your own logic to use the renderer for a given track.
|
||||
[top level README]: ../../README.md
|
||||
[Android NDK]: https://developer.android.com/tools/sdk/ndk/index.html
|
||||
[ExoPlayer issue 2781]: https://github.com/google/ExoPlayer/issues/2781
|
||||
[Supported formats]: https://developer.android.com/guide/topics/media/exoplayer/supported-formats#ffmpeg-library
|
||||
[Supported formats]: https://developer.android.com/media/media3/exoplayer/supported-formats#ffmpeg-library
|
||||
|
||||
## Links
|
||||
|
||||
* [Troubleshooting using decoding extensions][]
|
||||
|
||||
[Troubleshooting using decoding extensions]: https://developer.android.com/guide/topics/media/exoplayer/troubleshooting#how-can-i-get-a-decoding-library-to-load-and-be-used-for-playback
|
||||
[Troubleshooting using decoding extensions]: https://developer.android.com/media/media3/exoplayer/troubleshooting#how-can-i-get-a-decoding-library-to-load-and-be-used-for-playback
|
||||
|
@ -100,4 +100,4 @@ player, then implement your own logic to use the renderer for a given track.
|
||||
|
||||
* [Troubleshooting using decoding extensions][]
|
||||
|
||||
[Troubleshooting using decoding extensions]: https://developer.android.com/guide/topics/media/exoplayer/troubleshooting#how-can-i-get-a-decoding-library-to-load-and-be-used-for-playback
|
||||
[Troubleshooting using decoding extensions]: https://developer.android.com/media/media3/exoplayer/troubleshooting#how-can-i-get-a-decoding-library-to-load-and-be-used-for-playback
|
||||
|
@ -104,4 +104,4 @@ player, then implement your own logic to use the renderer for a given track.
|
||||
|
||||
* [Troubleshooting using decoding extensions][]
|
||||
|
||||
[Troubleshooting using decoding extensions]: https://developer.android.com/guide/topics/media/exoplayer/troubleshooting#how-can-i-get-a-decoding-library-to-load-and-be-used-for-playback
|
||||
[Troubleshooting using decoding extensions]: https://developer.android.com/media/media3/exoplayer/troubleshooting#how-can-i-get-a-decoding-library-to-load-and-be-used-for-playback
|
||||
|
@ -141,4 +141,4 @@ GL rendering mode has better performance, so should be preferred.
|
||||
|
||||
* [Troubleshooting using decoding extensions][]
|
||||
|
||||
[Troubleshooting using decoding extensions]: https://developer.android.com/guide/topics/media/exoplayer/troubleshooting#how-can-i-get-a-decoding-library-to-load-and-be-used-for-playback
|
||||
[Troubleshooting using decoding extensions]: https://developer.android.com/media/media3/exoplayer/troubleshooting#how-can-i-get-a-decoding-library-to-load-and-be-used-for-playback
|
||||
|
@ -25,7 +25,7 @@ import androidx.media3.common.util.Size;
|
||||
import java.io.IOException;
|
||||
|
||||
/** Scales the alpha value for each pixel in the fragment shader. */
|
||||
/* package */ final class AlphaScaleShaderProgram extends SingleFrameGlShaderProgram {
|
||||
/* package */ final class AlphaScaleShaderProgram extends BaseGlShaderProgram {
|
||||
private static final String VERTEX_SHADER_PATH = "shaders/vertex_shader_transformation_es2.glsl";
|
||||
private static final String FRAGMENT_SHADER_PATH = "shaders/fragment_shader_alpha_scale_es2.glsl";
|
||||
|
||||
@ -42,7 +42,7 @@ import java.io.IOException;
|
||||
*/
|
||||
public AlphaScaleShaderProgram(Context context, boolean useHdr, float alphaScale)
|
||||
throws VideoFrameProcessingException {
|
||||
super(/* useHighPrecisionColorComponents= */ useHdr);
|
||||
super(/* useHighPrecisionColorComponents= */ useHdr, /* texturePoolCapacity= */ 1);
|
||||
|
||||
try {
|
||||
glProgram = new GlProgram(context, VERTEX_SHADER_PATH, FRAGMENT_SHADER_PATH);
|
||||
|
@ -16,6 +16,7 @@
|
||||
package androidx.media3.exoplayer;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.media3.common.PlaybackException;
|
||||
import androidx.media3.common.PlaybackParameters;
|
||||
import androidx.media3.common.util.Assertions;
|
||||
import androidx.media3.common.util.Clock;
|
||||
@ -93,7 +94,8 @@ import androidx.media3.common.util.Clock;
|
||||
if (rendererMediaClock != null && rendererMediaClock != rendererClock) {
|
||||
if (rendererClock != null) {
|
||||
throw ExoPlaybackException.createForUnexpected(
|
||||
new IllegalStateException("Multiple renderer media clocks enabled."));
|
||||
new IllegalStateException("Multiple renderer media clocks enabled."),
|
||||
PlaybackException.ERROR_CODE_UNSPECIFIED);
|
||||
}
|
||||
this.rendererClock = rendererMediaClock;
|
||||
this.rendererClockSource = renderer;
|
||||
|
@ -166,8 +166,7 @@ import java.util.List;
|
||||
public interface ExoPlayer extends Player {
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link ExoPlayer}, as the {@link AudioComponent} methods are defined by that
|
||||
* interface.
|
||||
* @deprecated Use {@link ExoPlayer}, as all methods are defined by that interface.
|
||||
*/
|
||||
@UnstableApi
|
||||
@Deprecated
|
||||
@ -235,8 +234,7 @@ public interface ExoPlayer extends Player {
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link ExoPlayer}, as the {@link VideoComponent} methods are defined by that
|
||||
* interface.
|
||||
* @deprecated Use {@link ExoPlayer}, as all methods are defined by that interface.
|
||||
*/
|
||||
@UnstableApi
|
||||
@Deprecated
|
||||
@ -357,8 +355,7 @@ public interface ExoPlayer extends Player {
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link Player}, as the {@link TextComponent} methods are defined by that
|
||||
* interface.
|
||||
* @deprecated Use {@link Player}, as all methods are defined by that interface.
|
||||
*/
|
||||
@UnstableApi
|
||||
@Deprecated
|
||||
@ -372,8 +369,7 @@ public interface ExoPlayer extends Player {
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link Player}, as the {@link DeviceComponent} methods are defined by that
|
||||
* interface.
|
||||
* @deprecated Use {@link Player}, as all methods are defined by that interface.
|
||||
*/
|
||||
@UnstableApi
|
||||
@Deprecated
|
||||
@ -905,8 +901,8 @@ public interface ExoPlayer extends Player {
|
||||
/**
|
||||
* Sets whether the player should pause automatically when audio is rerouted from a headset to
|
||||
* device speakers. See the <a
|
||||
* href="https://developer.android.com/guide/topics/media-apps/volume-and-earphones#becoming-noisy">
|
||||
* audio becoming noisy</a> documentation for more information.
|
||||
* href="https://developer.android.com/media/platform/output#becoming-noisy">audio becoming
|
||||
* noisy</a> documentation for more information.
|
||||
*
|
||||
* @param handleAudioBecomingNoisy Whether the player should pause automatically when audio is
|
||||
* rerouted from a headset to device speakers.
|
||||
@ -1230,6 +1226,7 @@ public interface ExoPlayer extends Player {
|
||||
* @deprecated Use {@link ExoPlayer}, as the {@link AudioComponent} methods are defined by that
|
||||
* interface.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@UnstableApi
|
||||
@Nullable
|
||||
@Deprecated
|
||||
@ -1239,6 +1236,7 @@ public interface ExoPlayer extends Player {
|
||||
* @deprecated Use {@link ExoPlayer}, as the {@link VideoComponent} methods are defined by that
|
||||
* interface.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@UnstableApi
|
||||
@Nullable
|
||||
@Deprecated
|
||||
@ -1248,6 +1246,7 @@ public interface ExoPlayer extends Player {
|
||||
* @deprecated Use {@link Player}, as the {@link TextComponent} methods are defined by that
|
||||
* interface.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@UnstableApi
|
||||
@Nullable
|
||||
@Deprecated
|
||||
@ -1257,6 +1256,7 @@ public interface ExoPlayer extends Player {
|
||||
* @deprecated Use {@link Player}, as the {@link DeviceComponent} methods are defined by that
|
||||
* interface.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@UnstableApi
|
||||
@Nullable
|
||||
@Deprecated
|
||||
|
@ -3150,6 +3150,7 @@ import java.util.concurrent.TimeoutException;
|
||||
}
|
||||
|
||||
// TextOutput implementation
|
||||
@SuppressWarnings("deprecation") // Intentionally forwarding deprecating callback
|
||||
@Override
|
||||
public void onCues(List<Cue> cues) {
|
||||
listeners.sendEvent(EVENT_CUES, listener -> listener.onCues(cues));
|
||||
|
@ -66,6 +66,7 @@ public interface LoadControl {
|
||||
* @deprecated Implement {@link #onTracksSelected(Timeline, MediaPeriodId, Renderer[],
|
||||
* TrackGroupArray, ExoTrackSelection[])} instead.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Intentionally referencing deprecated constant
|
||||
@Deprecated
|
||||
default void onTracksSelected(
|
||||
Renderer[] renderers, TrackGroupArray trackGroups, ExoTrackSelection[] trackSelections) {
|
||||
@ -168,6 +169,7 @@ public interface LoadControl {
|
||||
* @deprecated Implement {@link #shouldStartPlayback(Timeline, MediaPeriodId, long, float,
|
||||
* boolean, long)} instead.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Intentionally referencing deprecated constant
|
||||
@Deprecated
|
||||
default boolean shouldStartPlayback(
|
||||
long bufferedDurationUs, float playbackSpeed, boolean rebuffering, long targetLiveOffsetUs) {
|
||||
|
@ -70,6 +70,7 @@ import java.util.List;
|
||||
*/
|
||||
@UnstableApi
|
||||
@Deprecated
|
||||
@SuppressWarnings("deprecation") // Supporting deprecated base classes
|
||||
public class SimpleExoPlayer extends BasePlayer
|
||||
implements ExoPlayer,
|
||||
ExoPlayer.AudioComponent,
|
||||
|
@ -147,21 +147,15 @@ public class MediaCodecAudioRenderer extends MediaCodecRenderer implements Media
|
||||
mediaCodecSelector,
|
||||
eventHandler,
|
||||
eventListener,
|
||||
AudioCapabilities.DEFAULT_AUDIO_CAPABILITIES);
|
||||
new DefaultAudioSink.Builder(context).build());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context A context.
|
||||
* @param mediaCodecSelector A decoder selector.
|
||||
* @param eventHandler A handler to use when delivering events to {@code eventListener}. May be
|
||||
* null if delivery of events is not required.
|
||||
* @param eventListener A listener of events. May be null if delivery of events is not required.
|
||||
* @param audioCapabilities The audio capabilities for playback on this device. Use {@link
|
||||
* AudioCapabilities#DEFAULT_AUDIO_CAPABILITIES} if default capabilities (no encoded audio
|
||||
* passthrough support) should be assumed.
|
||||
* @param audioProcessors Optional {@link AudioProcessor}s that will process PCM audio before
|
||||
* output.
|
||||
* @deprecated Use a constructor without {@link AudioCapabilities}. These are obtained
|
||||
* automatically from the {@link Context}.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Calling deprecated method for compatibility
|
||||
@Deprecated
|
||||
public MediaCodecAudioRenderer(
|
||||
Context context,
|
||||
MediaCodecSelector mediaCodecSelector,
|
||||
|
@ -424,6 +424,7 @@ public class ImageRenderer extends BaseRenderer {
|
||||
* current iteration of the rendering loop.
|
||||
* @return Whether we can feed more input data to the decoder.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Clearing C.BUFFER_FLAG_DECODE_ONLY for compatibility
|
||||
private boolean feedInputBuffer(long positionUs) throws ImageDecoderException {
|
||||
if (readyToOutputTiles && tileInfo != null) {
|
||||
return false;
|
||||
|
@ -163,6 +163,7 @@ public final class Requirements implements Parcelable {
|
||||
return notMetRequirements;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Using deprecated NetworkInfo for compatibility with older APIs
|
||||
private @RequirementFlags int getNotMetNetworkRequirements(Context context) {
|
||||
if (!isNetworkRequired()) {
|
||||
return 0;
|
||||
|
@ -76,17 +76,17 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
* <li>{@code DashMediaSource.Factory} if the item's {@link MediaItem.LocalConfiguration#uri uri}
|
||||
* ends in '.mpd' or if its {@link MediaItem.LocalConfiguration#mimeType mimeType field} is
|
||||
* explicitly set to {@link MimeTypes#APPLICATION_MPD} (Requires the <a
|
||||
* href="https://developer.android.com/guide/topics/media/exoplayer/hello-world#add-exoplayer-modules">exoplayer-dash
|
||||
* href="https://developer.android.com/media/media3/exoplayer/hello-world#add-exoplayer-modules">exoplayer-dash
|
||||
* module to be added</a> to the app).
|
||||
* <li>{@code HlsMediaSource.Factory} if the item's {@link MediaItem.LocalConfiguration#uri uri}
|
||||
* ends in '.m3u8' or if its {@link MediaItem.LocalConfiguration#mimeType mimeType field} is
|
||||
* explicitly set to {@link MimeTypes#APPLICATION_M3U8} (Requires the <a
|
||||
* href="https://developer.android.com/guide/topics/media/exoplayer/hello-world#add-exoplayer-modules">exoplayer-hls
|
||||
* href="https://developer.android.com/media/media3/exoplayer/hello-world#add-exoplayer-modules">exoplayer-hls
|
||||
* module to be added</a> to the app).
|
||||
* <li>{@code SsMediaSource.Factory} if the item's {@link MediaItem.LocalConfiguration#uri uri}
|
||||
* ends in '.ism', '.ism/Manifest' or if its {@link MediaItem.LocalConfiguration#mimeType
|
||||
* mimeType field} is explicitly set to {@link MimeTypes#APPLICATION_SS} (Requires the <a
|
||||
* href="https://developer.android.com/guide/topics/media/exoplayer/hello-world#add-exoplayer-modules">
|
||||
* href="https://developer.android.com/media/media3/exoplayer/hello-world#add-exoplayer-modules">
|
||||
* exoplayer-smoothstreaming module to be added</a> to the app).
|
||||
* <li>{@link ProgressiveMediaSource.Factory} serves as a fallback if the item's {@link
|
||||
* MediaItem.LocalConfiguration#uri uri} doesn't match one of the above. It tries to infer the
|
||||
|
@ -33,6 +33,7 @@ public interface MediaSourceFactory extends MediaSource.Factory {
|
||||
* An instance that throws {@link UnsupportedOperationException} from {@link #createMediaSource}
|
||||
* and {@link #getSupportedTypes()}.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Creating instance of deprecated type
|
||||
@UnstableApi
|
||||
MediaSourceFactory UNSUPPORTED =
|
||||
new MediaSourceFactory() {
|
||||
|
@ -347,6 +347,7 @@ public final class TextRenderer extends BaseRenderer implements Callback {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Using deprecated C.BUFFER_FLAG_DECODE_ONLY for compatibility
|
||||
private void renderFromSubtitles(long positionUs) {
|
||||
lastRendererPositionUs = positionUs;
|
||||
if (nextSubtitle == null) {
|
||||
|
@ -151,10 +151,12 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
*
|
||||
* @param context Any context.
|
||||
*/
|
||||
@SuppressWarnings({"deprecation"}) // Supporting deprecated builder pattern
|
||||
public ParametersBuilder(Context context) {
|
||||
delegate = new Parameters.Builder(context);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Override
|
||||
protected ParametersBuilder set(TrackSelectionParameters parameters) {
|
||||
@ -164,6 +166,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
|
||||
// Video
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Override
|
||||
public DefaultTrackSelector.ParametersBuilder setMaxVideoSizeSd() {
|
||||
@ -171,6 +174,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Override
|
||||
public DefaultTrackSelector.ParametersBuilder clearVideoSizeConstraints() {
|
||||
@ -178,6 +182,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Override
|
||||
public DefaultTrackSelector.ParametersBuilder setMaxVideoSize(
|
||||
@ -186,6 +191,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Override
|
||||
public DefaultTrackSelector.ParametersBuilder setMaxVideoFrameRate(int maxVideoFrameRate) {
|
||||
@ -193,6 +199,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Override
|
||||
public DefaultTrackSelector.ParametersBuilder setMaxVideoBitrate(int maxVideoBitrate) {
|
||||
@ -200,6 +207,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Override
|
||||
public DefaultTrackSelector.ParametersBuilder setMinVideoSize(
|
||||
@ -208,6 +216,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Override
|
||||
public DefaultTrackSelector.ParametersBuilder setMinVideoFrameRate(int minVideoFrameRate) {
|
||||
@ -215,6 +224,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Override
|
||||
public DefaultTrackSelector.ParametersBuilder setMinVideoBitrate(int minVideoBitrate) {
|
||||
@ -230,6 +240,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
* selection can be made otherwise.
|
||||
* @return This builder.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
public ParametersBuilder setExceedVideoConstraintsIfNecessary(
|
||||
boolean exceedVideoConstraintsIfNecessary) {
|
||||
@ -248,6 +259,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
* containing mixed MIME types.
|
||||
* @return This builder.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
public ParametersBuilder setAllowVideoMixedMimeTypeAdaptiveness(
|
||||
boolean allowVideoMixedMimeTypeAdaptiveness) {
|
||||
@ -263,6 +275,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
* adaptation may not be completely seamless.
|
||||
* @return This builder.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
public ParametersBuilder setAllowVideoNonSeamlessAdaptiveness(
|
||||
boolean allowVideoNonSeamlessAdaptiveness) {
|
||||
@ -279,6 +292,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
* with mixed levels of decoder and hardware acceleration support.
|
||||
* @return This builder.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
public ParametersBuilder setAllowVideoMixedDecoderSupportAdaptiveness(
|
||||
boolean allowVideoMixedDecoderSupportAdaptiveness) {
|
||||
@ -287,6 +301,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Override
|
||||
public ParametersBuilder setViewportSizeToPhysicalDisplaySize(
|
||||
@ -295,6 +310,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Override
|
||||
public ParametersBuilder clearViewportSizeConstraints() {
|
||||
@ -302,6 +318,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Override
|
||||
public ParametersBuilder setViewportSize(
|
||||
@ -310,6 +327,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Override
|
||||
public ParametersBuilder setPreferredVideoMimeType(@Nullable String mimeType) {
|
||||
@ -317,6 +335,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Override
|
||||
public ParametersBuilder setPreferredVideoMimeTypes(String... mimeTypes) {
|
||||
@ -324,6 +343,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Override
|
||||
public DefaultTrackSelector.ParametersBuilder setPreferredVideoRoleFlags(
|
||||
@ -334,6 +354,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
|
||||
// Audio
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Override
|
||||
public ParametersBuilder setPreferredAudioLanguage(@Nullable String preferredAudioLanguage) {
|
||||
@ -341,6 +362,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Override
|
||||
public ParametersBuilder setPreferredAudioLanguages(String... preferredAudioLanguages) {
|
||||
@ -348,6 +370,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Override
|
||||
public ParametersBuilder setPreferredAudioRoleFlags(@C.RoleFlags int preferredAudioRoleFlags) {
|
||||
@ -355,6 +378,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Override
|
||||
public ParametersBuilder setMaxAudioChannelCount(int maxAudioChannelCount) {
|
||||
@ -362,6 +386,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Override
|
||||
public ParametersBuilder setMaxAudioBitrate(int maxAudioBitrate) {
|
||||
@ -377,6 +402,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
* selection can be made otherwise.
|
||||
* @return This builder.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
public ParametersBuilder setExceedAudioConstraintsIfNecessary(
|
||||
boolean exceedAudioConstraintsIfNecessary) {
|
||||
@ -395,6 +421,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
* containing mixed MIME types.
|
||||
* @return This builder.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
public ParametersBuilder setAllowAudioMixedMimeTypeAdaptiveness(
|
||||
boolean allowAudioMixedMimeTypeAdaptiveness) {
|
||||
@ -411,6 +438,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
* containing mixed sample rates.
|
||||
* @return This builder.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
public ParametersBuilder setAllowAudioMixedSampleRateAdaptiveness(
|
||||
boolean allowAudioMixedSampleRateAdaptiveness) {
|
||||
@ -427,6 +455,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
* containing mixed channel counts.
|
||||
* @return This builder.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
public ParametersBuilder setAllowAudioMixedChannelCountAdaptiveness(
|
||||
boolean allowAudioMixedChannelCountAdaptiveness) {
|
||||
@ -443,6 +472,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
* with mixed levels of decoder and hardware acceleration support.
|
||||
* @return This builder.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
public ParametersBuilder setAllowAudioMixedDecoderSupportAdaptiveness(
|
||||
boolean allowAudioMixedDecoderSupportAdaptiveness) {
|
||||
@ -451,6 +481,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Override
|
||||
public ParametersBuilder setPreferredAudioMimeType(@Nullable String mimeType) {
|
||||
@ -458,6 +489,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Override
|
||||
public ParametersBuilder setPreferredAudioMimeTypes(String... mimeTypes) {
|
||||
@ -465,6 +497,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Override
|
||||
public ParametersBuilder setAudioOffloadPreferences(
|
||||
@ -475,6 +508,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
|
||||
// Text
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Override
|
||||
public ParametersBuilder setPreferredTextLanguageAndRoleFlagsToCaptioningManagerSettings(
|
||||
@ -483,6 +517,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Override
|
||||
public ParametersBuilder setPreferredTextLanguage(@Nullable String preferredTextLanguage) {
|
||||
@ -490,6 +525,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Override
|
||||
public ParametersBuilder setPreferredTextLanguages(String... preferredTextLanguages) {
|
||||
@ -497,6 +533,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Override
|
||||
public ParametersBuilder setPreferredTextRoleFlags(@C.RoleFlags int preferredTextRoleFlags) {
|
||||
@ -504,6 +541,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Override
|
||||
public ParametersBuilder setIgnoredTextSelectionFlags(
|
||||
@ -512,6 +550,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Override
|
||||
public ParametersBuilder setSelectUndeterminedTextLanguage(
|
||||
@ -523,6 +562,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
/**
|
||||
* @deprecated Use {@link #setIgnoredTextSelectionFlags}.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Deprecated
|
||||
public ParametersBuilder setDisabledTextTrackSelectionFlags(
|
||||
@ -532,7 +572,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
}
|
||||
|
||||
// Image
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Override
|
||||
public ParametersBuilder setPrioritizeImageOverVideoEnabled(
|
||||
@ -543,6 +583,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
|
||||
// General
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Override
|
||||
public ParametersBuilder setForceLowestBitrate(boolean forceLowestBitrate) {
|
||||
@ -550,6 +591,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Override
|
||||
public ParametersBuilder setForceHighestSupportedBitrate(boolean forceHighestSupportedBitrate) {
|
||||
@ -557,6 +599,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Override
|
||||
public ParametersBuilder addOverride(TrackSelectionOverride override) {
|
||||
@ -564,6 +607,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Override
|
||||
public ParametersBuilder clearOverride(TrackGroup trackGroup) {
|
||||
@ -571,6 +615,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Override
|
||||
public ParametersBuilder setOverrideForType(TrackSelectionOverride override) {
|
||||
@ -578,6 +623,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Override
|
||||
public ParametersBuilder clearOverridesOfType(@C.TrackType int trackType) {
|
||||
@ -585,6 +631,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Override
|
||||
public ParametersBuilder clearOverrides() {
|
||||
@ -598,12 +645,13 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
@CanIgnoreReturnValue
|
||||
@Override
|
||||
@Deprecated
|
||||
@SuppressWarnings("deprecation")
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
public ParametersBuilder setDisabledTrackTypes(Set<@C.TrackType Integer> disabledTrackTypes) {
|
||||
delegate.setDisabledTrackTypes(disabledTrackTypes);
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Override
|
||||
public ParametersBuilder setTrackTypeDisabled(@C.TrackType int trackType, boolean disabled) {
|
||||
@ -623,6 +671,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
* selection can be made otherwise.
|
||||
* @return This builder.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
public ParametersBuilder setExceedRendererCapabilitiesIfNecessary(
|
||||
boolean exceedRendererCapabilitiesIfNecessary) {
|
||||
@ -644,6 +693,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
* @param tunnelingEnabled Whether to enable tunneling if possible.
|
||||
* @return This builder.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
public ParametersBuilder setTunnelingEnabled(boolean tunnelingEnabled) {
|
||||
delegate.setTunnelingEnabled(tunnelingEnabled);
|
||||
@ -656,6 +706,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
* @param allowMultipleAdaptiveSelections Whether multiple adaptive selections are allowed.
|
||||
* @return This builder.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
public ParametersBuilder setAllowMultipleAdaptiveSelections(
|
||||
boolean allowMultipleAdaptiveSelections) {
|
||||
@ -673,6 +724,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
* @param disabled Whether the renderer is disabled.
|
||||
* @return This builder.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
public ParametersBuilder setRendererDisabled(int rendererIndex, boolean disabled) {
|
||||
delegate.setRendererDisabled(rendererIndex, disabled);
|
||||
@ -703,6 +755,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
* @return This builder.
|
||||
* @deprecated Use {@link TrackSelectionParameters.Builder#addOverride(TrackSelectionOverride)}.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Deprecated
|
||||
public ParametersBuilder setSelectionOverride(
|
||||
@ -719,6 +772,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
* @return This builder.
|
||||
* @deprecated Use {@link TrackSelectionParameters.Builder#clearOverride(TrackGroup)}.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Deprecated
|
||||
public ParametersBuilder clearSelectionOverride(int rendererIndex, TrackGroupArray groups) {
|
||||
@ -733,6 +787,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
* @return This builder.
|
||||
* @deprecated Use {@link TrackSelectionParameters.Builder#clearOverridesOfType(int)}.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Deprecated
|
||||
public ParametersBuilder clearSelectionOverrides(int rendererIndex) {
|
||||
@ -746,6 +801,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
* @return This builder.
|
||||
* @deprecated Use {@link TrackSelectionParameters.Builder#clearOverrides()}.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Intentionally returning deprecated type
|
||||
@CanIgnoreReturnValue
|
||||
@Deprecated
|
||||
public ParametersBuilder clearSelectionOverrides() {
|
||||
@ -1637,6 +1693,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
return clone;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Filling deprecated field from Bundle
|
||||
private void setSelectionOverridesFromBundle(Bundle bundle) {
|
||||
@Nullable
|
||||
int[] rendererIndices =
|
||||
|
@ -82,16 +82,10 @@ public final class TrackSelectionUtil {
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates {@link DefaultTrackSelector.Parameters} with an override.
|
||||
*
|
||||
* @param parameters The current {@link DefaultTrackSelector.Parameters} to build upon.
|
||||
* @param rendererIndex The renderer index to update.
|
||||
* @param trackGroupArray The {@link TrackGroupArray} of the renderer.
|
||||
* @param isDisabled Whether the renderer should be set disabled.
|
||||
* @param override An optional override for the renderer. If null, no override will be set and an
|
||||
* existing override for this renderer will be cleared.
|
||||
* @return The updated {@link DefaultTrackSelector.Parameters}.
|
||||
* @deprecated Use {@link DefaultTrackSelector.Parameters.Builder#addOverride} instead.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Forwarding to deprecated methods
|
||||
@Deprecated
|
||||
public static DefaultTrackSelector.Parameters updateParametersWithOverride(
|
||||
DefaultTrackSelector.Parameters parameters,
|
||||
int rendererIndex,
|
||||
|
@ -39,5 +39,5 @@ instances and pass them directly to the player. For advanced download use cases,
|
||||
* [Developer Guide][]
|
||||
* [Javadoc][]
|
||||
|
||||
[Developer Guide]: https://developer.android.com/guide/topics/media/exoplayer/dash
|
||||
[Developer Guide]: https://developer.android.com/media/media3/exoplayer/dash
|
||||
[Javadoc]: https://developer.android.com/reference/androidx/media3/exoplayer/dash/package-summary
|
||||
|
@ -37,6 +37,7 @@ import androidx.media3.extractor.ChunkIndex;
|
||||
import androidx.media3.extractor.Extractor;
|
||||
import androidx.media3.extractor.mkv.MatroskaExtractor;
|
||||
import androidx.media3.extractor.mp4.FragmentedMp4Extractor;
|
||||
import androidx.media3.extractor.text.SubtitleParser;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
@ -342,7 +343,13 @@ public final class DashUtil {
|
||||
mimeType != null
|
||||
&& (mimeType.startsWith(MimeTypes.VIDEO_WEBM)
|
||||
|| mimeType.startsWith(MimeTypes.AUDIO_WEBM));
|
||||
Extractor extractor = isWebm ? new MatroskaExtractor() : new FragmentedMp4Extractor();
|
||||
Extractor extractor =
|
||||
isWebm
|
||||
? new MatroskaExtractor(
|
||||
SubtitleParser.Factory.UNSUPPORTED, MatroskaExtractor.FLAG_EMIT_RAW_SUBTITLE_DATA)
|
||||
: new FragmentedMp4Extractor(
|
||||
SubtitleParser.Factory.UNSUPPORTED,
|
||||
FragmentedMp4Extractor.FLAG_EMIT_RAW_SUBTITLE_DATA);
|
||||
return new BundledChunkExtractor(extractor, trackType, format);
|
||||
}
|
||||
|
||||
|
@ -38,5 +38,5 @@ instances and pass them directly to the player. For advanced download use cases,
|
||||
* [Developer Guide][]
|
||||
* [Javadoc][]
|
||||
|
||||
[Developer Guide]: https://developer.android.com/guide/topics/media/exoplayer/hls
|
||||
[Developer Guide]: https://developer.android.com/media/media3/exoplayer/hls
|
||||
[Javadoc]: https://developer.android.com/reference/androidx/media3/exoplayer/hls/package-summary
|
||||
|
@ -45,6 +45,7 @@ import androidx.media3.exoplayer.source.mediaparser.MediaParserUtil;
|
||||
import androidx.media3.exoplayer.source.mediaparser.OutputConsumerAdapterV30;
|
||||
import androidx.media3.extractor.ExtractorInput;
|
||||
import androidx.media3.extractor.ExtractorOutput;
|
||||
import androidx.media3.extractor.text.SubtitleParser;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import java.io.IOException;
|
||||
|
||||
@ -70,7 +71,13 @@ public final class MediaParserHlsMediaChunkExtractor implements HlsMediaChunkExt
|
||||
// The segment contains WebVTT. MediaParser does not support WebVTT parsing, so we use the
|
||||
// bundled extractor.
|
||||
return new BundledHlsMediaChunkExtractor(
|
||||
new WebvttExtractor(format.language, timestampAdjuster), format, timestampAdjuster);
|
||||
new WebvttExtractor(
|
||||
format.language,
|
||||
timestampAdjuster,
|
||||
SubtitleParser.Factory.UNSUPPORTED,
|
||||
/* parseSubtitlesDuringExtraction= */ false),
|
||||
format,
|
||||
timestampAdjuster);
|
||||
}
|
||||
|
||||
boolean overrideInBandCaptionDeclarations = muxedCaptionFormats != null;
|
||||
|
@ -26,7 +26,7 @@ locally. Instructions for doing this can be found in the [top level README][].
|
||||
## Using the module
|
||||
|
||||
To use the module, follow the instructions on the
|
||||
[Ad insertion page](https://developer.android.com/guide/topics/media/exoplayer/ad-insertion#declarative-ad-support)
|
||||
[Ad insertion page](https://developer.android.com/media/media3/exoplayer/ad-insertion#declarative-ad-support)
|
||||
of the developer guide. The `AdsLoaderProvider` passed to the player's
|
||||
`DefaultMediaSourceFactory` should return an `ImaAdsLoader`. Note that the IMA
|
||||
module only supports players that are accessed on the application's main thread.
|
||||
@ -56,7 +56,6 @@ player position when backgrounded during ad playback.
|
||||
* [Javadoc][]
|
||||
* [Supported platforms][]
|
||||
|
||||
[Developer Guide]: https://developer.android.com/guide/topics/media/exoplayer/ad-insertion
|
||||
[Developer Guide]: https://developer.android.com/media/media3/exoplayer/ad-insertion
|
||||
[Javadoc]: https://developer.android.com/reference/androidx/media3/exoplayer/ima/package-summary
|
||||
[Supported platforms]: https://developers.google.com/interactive-media-ads/docs/sdks/other
|
||||
|
||||
|
@ -823,6 +823,7 @@ public final class ImaServerSideAdInsertionMediaSource extends CompositeMediaSou
|
||||
|
||||
// Static methods.
|
||||
|
||||
@SuppressWarnings("deprecation") // b/192231683 prevents using non-deprecated method
|
||||
private static AdPlaybackState setVodAdGroupPlaceholders(
|
||||
List<CuePoint> cuePoints, AdPlaybackState adPlaybackState) {
|
||||
// TODO(b/192231683) Use getEndTimeMs()/getStartTimeMs() after jar target was removed
|
||||
|
@ -33,5 +33,5 @@ instances and pass them directly to the player.
|
||||
* [Developer Guide][]
|
||||
* [Javadoc][]
|
||||
|
||||
[Developer Guide]: https://developer.android.com/guide/topics/media/exoplayer/rtsp
|
||||
[Developer Guide]: https://developer.android.com/media/media3/exoplayer/rtsp
|
||||
[Javadoc]: https://developer.android.com/reference/androidx/media3/exoplayer/rtsp/package-summary
|
||||
|
@ -38,5 +38,5 @@ instances and pass them directly to the player. For advanced download use cases,
|
||||
* [Developer Guide][]
|
||||
* [Javadoc][]
|
||||
|
||||
[Developer Guide]: https://developer.android.com/guide/topics/media/exoplayer/smoothstreaming
|
||||
[Developer Guide]: https://developer.android.com/media/media3/exoplayer/smoothstreaming
|
||||
[Javadoc]: https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/package-summary
|
||||
|
@ -28,6 +28,7 @@ import com.google.common.base.Ascii;
|
||||
/**
|
||||
* @deprecated Use {@link androidx.media3.extractor.metadata.vorbis.VorbisComment} instead.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Internal references to own class
|
||||
@Deprecated
|
||||
@UnstableApi
|
||||
public class VorbisComment implements Metadata.Entry {
|
||||
|
@ -43,6 +43,7 @@ public final class TextInformationFrame extends Id3Frame {
|
||||
/** The text values of this frame. Will always have at least one element. */
|
||||
public final ImmutableList<String> values;
|
||||
|
||||
@SuppressWarnings("deprecation") // Assigning deprecated public field
|
||||
public TextInformationFrame(String id, @Nullable String description, List<String> values) {
|
||||
super(id);
|
||||
checkArgument(!values.isEmpty());
|
||||
|
@ -82,12 +82,6 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
@UnstableApi
|
||||
public class MatroskaExtractor implements Extractor {
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #newFactory(SubtitleParser.Factory)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public static final ExtractorsFactory FACTORY = () -> new Extractor[] {new MatroskaExtractor()};
|
||||
|
||||
/**
|
||||
* Creates a factory for {@link MatroskaExtractor} instances with the provided {@link
|
||||
* SubtitleParser.Factory}.
|
||||
@ -124,6 +118,16 @@ public class MatroskaExtractor implements Extractor {
|
||||
*/
|
||||
public static final int FLAG_EMIT_RAW_SUBTITLE_DATA = 1 << 1; // 2
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #newFactory(SubtitleParser.Factory)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public static final ExtractorsFactory FACTORY =
|
||||
() ->
|
||||
new Extractor[] {
|
||||
new MatroskaExtractor(SubtitleParser.Factory.UNSUPPORTED, FLAG_EMIT_RAW_SUBTITLE_DATA)
|
||||
};
|
||||
|
||||
private static final String TAG = "MatroskaExtractor";
|
||||
|
||||
private static final int UNSET_ENTRY_ID = -1;
|
||||
|
@ -74,13 +74,6 @@ import java.util.UUID;
|
||||
@UnstableApi
|
||||
public class FragmentedMp4Extractor implements Extractor {
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #newFactory(SubtitleParser.Factory)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public static final ExtractorsFactory FACTORY =
|
||||
() -> new Extractor[] {new FragmentedMp4Extractor()};
|
||||
|
||||
/**
|
||||
* Creates a factory for {@link FragmentedMp4Extractor} instances with the provided {@link
|
||||
* SubtitleParser.Factory}.
|
||||
@ -135,6 +128,17 @@ public class FragmentedMp4Extractor implements Extractor {
|
||||
*/
|
||||
public static final int FLAG_EMIT_RAW_SUBTITLE_DATA = 1 << 5; // 32
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #newFactory(SubtitleParser.Factory)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public static final ExtractorsFactory FACTORY =
|
||||
() ->
|
||||
new Extractor[] {
|
||||
new FragmentedMp4Extractor(
|
||||
SubtitleParser.Factory.UNSUPPORTED, /* flags= */ FLAG_EMIT_RAW_SUBTITLE_DATA)
|
||||
};
|
||||
|
||||
private static final String TAG = "FragmentedMp4Extractor";
|
||||
|
||||
@SuppressWarnings("ConstantCaseForConstants")
|
||||
|
@ -66,12 +66,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
@UnstableApi
|
||||
public final class Mp4Extractor implements Extractor, SeekMap {
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #newFactory(SubtitleParser.Factory)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public static final ExtractorsFactory FACTORY = () -> new Extractor[] {new Mp4Extractor()};
|
||||
|
||||
/**
|
||||
* Creates a factory for {@link Mp4Extractor} instances with the provided {@link
|
||||
* SubtitleParser.Factory}.
|
||||
@ -125,6 +119,16 @@ public final class Mp4Extractor implements Extractor, SeekMap {
|
||||
|
||||
public static final int FLAG_EMIT_RAW_SUBTITLE_DATA = 1 << 4;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #newFactory(SubtitleParser.Factory)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public static final ExtractorsFactory FACTORY =
|
||||
() ->
|
||||
new Extractor[] {
|
||||
new Mp4Extractor(SubtitleParser.Factory.UNSUPPORTED, FLAG_EMIT_RAW_SUBTITLE_DATA)
|
||||
};
|
||||
|
||||
/** Parser states. */
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
|
@ -61,12 +61,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
@UnstableApi
|
||||
public final class TsExtractor implements Extractor {
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #newFactory(SubtitleParser.Factory)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public static final ExtractorsFactory FACTORY = () -> new Extractor[] {new TsExtractor()};
|
||||
|
||||
/**
|
||||
* Creates a factory for {@link TsExtractor} instances with the provided {@link
|
||||
* SubtitleParser.Factory}.
|
||||
@ -115,6 +109,16 @@ public final class TsExtractor implements Extractor {
|
||||
*/
|
||||
public static final int FLAG_EMIT_RAW_SUBTITLE_DATA = 1;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #newFactory(SubtitleParser.Factory)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public static final ExtractorsFactory FACTORY =
|
||||
() ->
|
||||
new Extractor[] {
|
||||
new TsExtractor(FLAG_EMIT_RAW_SUBTITLE_DATA, SubtitleParser.Factory.UNSUPPORTED)
|
||||
};
|
||||
|
||||
public static final int TS_PACKET_SIZE = 188;
|
||||
public static final int DEFAULT_TIMESTAMP_SEARCH_BYTES = 600 * TS_PACKET_SIZE;
|
||||
|
||||
|
@ -17,7 +17,6 @@ package androidx.media3.session;
|
||||
|
||||
import static android.support.v4.media.session.MediaSessionCompat.FLAG_HANDLES_QUEUE_COMMANDS;
|
||||
import static androidx.media.utils.MediaConstants.BROWSER_ROOT_HINTS_KEY_ROOT_CHILDREN_SUPPORTED_FLAGS;
|
||||
import static androidx.media3.common.Player.COMMAND_ADJUST_DEVICE_VOLUME;
|
||||
import static androidx.media3.common.Player.COMMAND_ADJUST_DEVICE_VOLUME_WITH_FLAGS;
|
||||
import static androidx.media3.common.Player.COMMAND_CHANGE_MEDIA_ITEMS;
|
||||
import static androidx.media3.common.Player.COMMAND_GET_AUDIO_ATTRIBUTES;
|
||||
@ -36,7 +35,6 @@ import static androidx.media3.common.Player.COMMAND_SEEK_TO_NEXT;
|
||||
import static androidx.media3.common.Player.COMMAND_SEEK_TO_NEXT_MEDIA_ITEM;
|
||||
import static androidx.media3.common.Player.COMMAND_SEEK_TO_PREVIOUS;
|
||||
import static androidx.media3.common.Player.COMMAND_SEEK_TO_PREVIOUS_MEDIA_ITEM;
|
||||
import static androidx.media3.common.Player.COMMAND_SET_DEVICE_VOLUME;
|
||||
import static androidx.media3.common.Player.COMMAND_SET_DEVICE_VOLUME_WITH_FLAGS;
|
||||
import static androidx.media3.common.Player.COMMAND_SET_MEDIA_ITEM;
|
||||
import static androidx.media3.common.Player.COMMAND_SET_REPEAT_MODE;
|
||||
@ -1169,12 +1167,12 @@ import java.util.concurrent.TimeoutException;
|
||||
}
|
||||
if (volumeControlType == VolumeProviderCompat.VOLUME_CONTROL_RELATIVE) {
|
||||
playerCommandsBuilder.addAll(
|
||||
COMMAND_ADJUST_DEVICE_VOLUME, COMMAND_ADJUST_DEVICE_VOLUME_WITH_FLAGS);
|
||||
Player.COMMAND_ADJUST_DEVICE_VOLUME, COMMAND_ADJUST_DEVICE_VOLUME_WITH_FLAGS);
|
||||
} else if (volumeControlType == VolumeProviderCompat.VOLUME_CONTROL_ABSOLUTE) {
|
||||
playerCommandsBuilder.addAll(
|
||||
COMMAND_ADJUST_DEVICE_VOLUME,
|
||||
Player.COMMAND_ADJUST_DEVICE_VOLUME,
|
||||
COMMAND_ADJUST_DEVICE_VOLUME_WITH_FLAGS,
|
||||
COMMAND_SET_DEVICE_VOLUME,
|
||||
Player.COMMAND_SET_DEVICE_VOLUME,
|
||||
COMMAND_SET_DEVICE_VOLUME_WITH_FLAGS);
|
||||
}
|
||||
playerCommandsBuilder.addAll(
|
||||
|
@ -129,7 +129,7 @@ public class MediaButtonReceiver extends BroadcastReceiver {
|
||||
// button intents to this receiver only when the session is released or not active, meaning
|
||||
// the service is not running. Hence we only accept a PLAY command here that ensures that
|
||||
// playback is started and the MediaSessionService/MediaLibraryService is put into the
|
||||
// foreground (see https://developer.android.com/guide/topics/media-apps/mediabuttons and
|
||||
// foreground (see https://developer.android.com/media/legacy/media-buttons and
|
||||
// https://developer.android.com/about/versions/oreo/android-8.0-changes#back-all).
|
||||
android.util.Log.w(
|
||||
TAG,
|
||||
|
@ -1525,6 +1525,7 @@ import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
/**
|
||||
* @deprecated Use {@link #setDeviceVolume(int, int)} instead.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Checking deprecated command codes
|
||||
@Deprecated
|
||||
@Override
|
||||
public void setDeviceVolume(int volume) {
|
||||
@ -1573,6 +1574,7 @@ import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
/**
|
||||
* @deprecated Use {@link #increaseDeviceVolume(int)} instead.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Checking deprecated command codes
|
||||
@Deprecated
|
||||
@Override
|
||||
public void increaseDeviceVolume() {
|
||||
@ -1617,6 +1619,7 @@ import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
/**
|
||||
* @deprecated Use {@link #decreaseDeviceVolume(int)} instead.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Checking deprecated command codes
|
||||
@Deprecated
|
||||
@Override
|
||||
public void decreaseDeviceVolume() {
|
||||
@ -1659,6 +1662,7 @@ import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
/**
|
||||
* @deprecated Use {@link #setDeviceMuted(boolean, int)} instead.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Checking deprecated command codes
|
||||
@Deprecated
|
||||
@Override
|
||||
public void setDeviceMuted(boolean muted) {
|
||||
|
@ -202,10 +202,10 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
* <p>Generally, multiple sessions aren't necessary for most media apps. One exception is if your
|
||||
* app can play multiple media content at the same time, but only for the playback of video-only
|
||||
* media or remote playback, since the <a
|
||||
* href="https://developer.android.com/guide/topics/media-apps/audio-focus">audio focus policy</a>
|
||||
* recommends not playing multiple audio content at the same time. Also, keep in mind that multiple
|
||||
* media sessions would make Android Auto and Bluetooth devices with display to show your app
|
||||
* multiple times, because they list up media sessions, not media apps.
|
||||
* href="https://developer.android.com/media/optimize/audio-focus">audio focus policy</a> recommends
|
||||
* not playing multiple audio content at the same time. Also, keep in mind that multiple media
|
||||
* sessions would make Android Auto and Bluetooth devices with display to show your app multiple
|
||||
* times, because they list up media sessions, not media apps.
|
||||
*
|
||||
* <h2 id="BackwardCompatibility">Backward Compatibility with Legacy Session APIs</h2>
|
||||
*
|
||||
@ -1328,7 +1328,7 @@ public class MediaSession {
|
||||
|
||||
/**
|
||||
* Called when a controller requested to add new {@linkplain MediaItem media items} to the
|
||||
* playlist via one of the {@code Player.addMediaItem(s)} methods. Unless overriden, {@link
|
||||
* playlist via one of the {@code Player.addMediaItem(s)} methods. Unless overridden, {@link
|
||||
* Callback#onSetMediaItems} will direct {@code Player.setMediaItem(s)} to this method as well.
|
||||
*
|
||||
* <p>In addition, unless {@link Callback#onSetMediaItems} is overridden, this callback is also
|
||||
|
@ -598,20 +598,6 @@ import org.checkerframework.checker.initialization.qual.Initialized;
|
||||
sessionCompat.getCurrentControllerInfo());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRemoveQueueItemAt(int index) {
|
||||
dispatchSessionTaskWithPlayerCommand(
|
||||
COMMAND_CHANGE_MEDIA_ITEMS,
|
||||
controller -> {
|
||||
if (index < 0) {
|
||||
Log.w(TAG, "onRemoveQueueItem(): index shouldn't be negative");
|
||||
return;
|
||||
}
|
||||
sessionImpl.getPlayerWrapper().removeMediaItem(index);
|
||||
},
|
||||
sessionCompat.getCurrentControllerInfo());
|
||||
}
|
||||
|
||||
public ControllerCb getControllerLegacyCbForBroadcast() {
|
||||
return controllerLegacyCbForBroadcast;
|
||||
}
|
||||
|
@ -124,10 +124,10 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
* <p>Generally, multiple sessions aren't necessary for most media apps. One exception is if your
|
||||
* app can play multiple media contents at the same time, but only for playback of video-only media
|
||||
* or remote playback, since the <a
|
||||
* href="https://developer.android.com/guide/topics/media-apps/audio-focus">audio focus policy</a>
|
||||
* recommends not playing multiple audio contents at the same time. Also, keep in mind that multiple
|
||||
* media sessions would make Android Auto and Bluetooth devices with a display to show your apps
|
||||
* multiple times, because they list up media sessions, not media apps.
|
||||
* href="https://developer.android.com/media/optimize/audio-focus">audio focus policy</a> recommends
|
||||
* not playing multiple audio contents at the same time. Also, keep in mind that multiple media
|
||||
* sessions would make Android Auto and Bluetooth devices with a display to show your apps multiple
|
||||
* times, because they list up media sessions, not media apps.
|
||||
*
|
||||
* <p>However, if you're capable of handling multiple playbacks and want to keep their sessions
|
||||
* while the app is in the background, create multiple sessions and add them to this service with
|
||||
|
@ -15,7 +15,6 @@
|
||||
*/
|
||||
package androidx.media3.session;
|
||||
|
||||
import static androidx.media3.common.Player.COMMAND_ADJUST_DEVICE_VOLUME;
|
||||
import static androidx.media3.common.Player.COMMAND_ADJUST_DEVICE_VOLUME_WITH_FLAGS;
|
||||
import static androidx.media3.common.Player.COMMAND_CHANGE_MEDIA_ITEMS;
|
||||
import static androidx.media3.common.Player.COMMAND_PLAY_PAUSE;
|
||||
@ -30,7 +29,6 @@ import static androidx.media3.common.Player.COMMAND_SEEK_TO_NEXT_MEDIA_ITEM;
|
||||
import static androidx.media3.common.Player.COMMAND_SEEK_TO_PREVIOUS;
|
||||
import static androidx.media3.common.Player.COMMAND_SEEK_TO_PREVIOUS_MEDIA_ITEM;
|
||||
import static androidx.media3.common.Player.COMMAND_SET_AUDIO_ATTRIBUTES;
|
||||
import static androidx.media3.common.Player.COMMAND_SET_DEVICE_VOLUME;
|
||||
import static androidx.media3.common.Player.COMMAND_SET_DEVICE_VOLUME_WITH_FLAGS;
|
||||
import static androidx.media3.common.Player.COMMAND_SET_MEDIA_ITEM;
|
||||
import static androidx.media3.common.Player.COMMAND_SET_PLAYLIST_METADATA;
|
||||
@ -1529,7 +1527,7 @@ import java.util.concurrent.ExecutionException;
|
||||
queueSessionTaskWithPlayerCommand(
|
||||
caller,
|
||||
sequenceNumber,
|
||||
COMMAND_SET_DEVICE_VOLUME,
|
||||
Player.COMMAND_SET_DEVICE_VOLUME,
|
||||
sendSessionResultSuccess(player -> player.setDeviceVolume(volume)));
|
||||
}
|
||||
|
||||
@ -1555,7 +1553,7 @@ import java.util.concurrent.ExecutionException;
|
||||
queueSessionTaskWithPlayerCommand(
|
||||
caller,
|
||||
sequenceNumber,
|
||||
COMMAND_ADJUST_DEVICE_VOLUME,
|
||||
Player.COMMAND_ADJUST_DEVICE_VOLUME,
|
||||
sendSessionResultSuccess(player -> player.increaseDeviceVolume()));
|
||||
}
|
||||
|
||||
@ -1581,7 +1579,7 @@ import java.util.concurrent.ExecutionException;
|
||||
queueSessionTaskWithPlayerCommand(
|
||||
caller,
|
||||
sequenceNumber,
|
||||
COMMAND_ADJUST_DEVICE_VOLUME,
|
||||
Player.COMMAND_ADJUST_DEVICE_VOLUME,
|
||||
sendSessionResultSuccess(player -> player.decreaseDeviceVolume()));
|
||||
}
|
||||
|
||||
@ -1607,7 +1605,7 @@ import java.util.concurrent.ExecutionException;
|
||||
queueSessionTaskWithPlayerCommand(
|
||||
caller,
|
||||
sequenceNumber,
|
||||
COMMAND_ADJUST_DEVICE_VOLUME,
|
||||
Player.COMMAND_ADJUST_DEVICE_VOLUME,
|
||||
sendSessionResultSuccess(player -> player.setDeviceMuted(muted)));
|
||||
}
|
||||
|
||||
|
@ -34,6 +34,7 @@ import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.annotation.RequiresPermission;
|
||||
import androidx.core.app.NotificationBuilderWithBuilderAccessor;
|
||||
import androidx.core.graphics.drawable.IconCompat;
|
||||
import androidx.media3.common.util.NullableType;
|
||||
import androidx.media3.common.util.UnstableApi;
|
||||
import androidx.media3.common.util.Util;
|
||||
@ -303,7 +304,10 @@ public class MediaStyleNotificationHelper {
|
||||
new RemoteViews(
|
||||
mBuilder.mContext.getPackageName(),
|
||||
androidx.media.R.layout.notification_media_action);
|
||||
button.setImageViewResource(androidx.media.R.id.action0, action.getIcon());
|
||||
IconCompat iconCompat = action.getIconCompat();
|
||||
if (iconCompat != null) {
|
||||
button.setImageViewResource(androidx.media.R.id.action0, iconCompat.getResId());
|
||||
}
|
||||
if (!tombstone) {
|
||||
button.setOnClickPendingIntent(androidx.media.R.id.action0, action.getActionIntent());
|
||||
}
|
||||
|
@ -526,6 +526,7 @@ import java.util.List;
|
||||
super.replaceMediaItems(fromIndex, toIndex, mediaItems);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Forwarding deprecated call
|
||||
@Deprecated
|
||||
@Override
|
||||
public boolean hasPrevious() {
|
||||
@ -533,6 +534,7 @@ import java.util.List;
|
||||
return super.hasPrevious();
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Forwarding deprecated call
|
||||
@Deprecated
|
||||
@Override
|
||||
public boolean hasNext() {
|
||||
@ -540,6 +542,7 @@ import java.util.List;
|
||||
return super.hasNext();
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Forwarding deprecated call
|
||||
@Deprecated
|
||||
@Override
|
||||
public boolean hasPreviousWindow() {
|
||||
@ -547,6 +550,7 @@ import java.util.List;
|
||||
return super.hasPreviousWindow();
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Forwarding deprecated call
|
||||
@Deprecated
|
||||
@Override
|
||||
public boolean hasNextWindow() {
|
||||
@ -566,6 +570,7 @@ import java.util.List;
|
||||
return super.hasNextMediaItem();
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Forwarding deprecated call
|
||||
@Deprecated
|
||||
@Override
|
||||
public void previous() {
|
||||
@ -573,6 +578,7 @@ import java.util.List;
|
||||
super.previous();
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Forwarding deprecated call
|
||||
@Deprecated
|
||||
@Override
|
||||
public void next() {
|
||||
@ -580,6 +586,7 @@ import java.util.List;
|
||||
super.next();
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Forwarding deprecated call
|
||||
@Deprecated
|
||||
@Override
|
||||
public void seekToPreviousWindow() {
|
||||
@ -587,6 +594,7 @@ import java.util.List;
|
||||
super.seekToPreviousWindow();
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Forwarding deprecated call
|
||||
@Deprecated
|
||||
@Override
|
||||
public void seekToNextWindow() {
|
||||
@ -687,6 +695,7 @@ import java.util.List;
|
||||
return super.getMediaItemAt(index);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Forwarding deprecated call
|
||||
@Deprecated
|
||||
@Override
|
||||
public int getCurrentWindowIndex() {
|
||||
@ -700,6 +709,7 @@ import java.util.List;
|
||||
return super.getCurrentMediaItemIndex();
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Forwarding deprecated call
|
||||
@Deprecated
|
||||
@Override
|
||||
public int getPreviousWindowIndex() {
|
||||
@ -713,6 +723,7 @@ import java.util.List;
|
||||
return super.getPreviousMediaItemIndex();
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Forwarding deprecated call
|
||||
@Deprecated
|
||||
@Override
|
||||
public int getNextWindowIndex() {
|
||||
|
@ -630,6 +630,7 @@ public class MediaControllerProviderService extends Service {
|
||||
});
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Forwarding deprecated method call
|
||||
@Override
|
||||
public void setDeviceVolume(String controllerId, int volume) throws RemoteException {
|
||||
runOnHandler(
|
||||
@ -649,6 +650,7 @@ public class MediaControllerProviderService extends Service {
|
||||
});
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Forwarding deprecated method call
|
||||
@Override
|
||||
public void increaseDeviceVolume(String controllerId) throws RemoteException {
|
||||
runOnHandler(
|
||||
@ -668,6 +670,7 @@ public class MediaControllerProviderService extends Service {
|
||||
});
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Forwarding deprecated method call
|
||||
@Override
|
||||
public void decreaseDeviceVolume(String controllerId) throws RemoteException {
|
||||
runOnHandler(
|
||||
@ -687,6 +690,7 @@ public class MediaControllerProviderService extends Service {
|
||||
});
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Forwarding deprecated method call
|
||||
@Override
|
||||
public void setDeviceMuted(String controllerId, boolean muted) throws RemoteException {
|
||||
runOnHandler(
|
||||
|
@ -185,7 +185,11 @@ public final class FakeExoMediaDrm implements ExoMediaDrm {
|
||||
*/
|
||||
@Deprecated
|
||||
public FakeExoMediaDrm() {
|
||||
this(/* maxConcurrentSessions= */ Integer.MAX_VALUE);
|
||||
this(
|
||||
/* enforceValidKeyResponses= */ true,
|
||||
/* provisionsRequired= */ 0,
|
||||
/* throwNotProvisionedExceptionFromGetKeyRequest= */ false,
|
||||
/* maxConcurrentSessions= */ Integer.MAX_VALUE);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -55,6 +55,7 @@ public class StubExoPlayer extends StubPlayer implements ExoPlayer {
|
||||
* @deprecated Use {@link ExoPlayer}, as the {@link AudioComponent} methods are defined by that
|
||||
* interface.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Returning deprecated type
|
||||
@Override
|
||||
@Deprecated
|
||||
public AudioComponent getAudioComponent() {
|
||||
@ -65,6 +66,7 @@ public class StubExoPlayer extends StubPlayer implements ExoPlayer {
|
||||
* @deprecated Use {@link ExoPlayer}, as the {@link VideoComponent} methods are defined by that
|
||||
* interface.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Returning deprecated type
|
||||
@Override
|
||||
@Deprecated
|
||||
public VideoComponent getVideoComponent() {
|
||||
@ -75,6 +77,7 @@ public class StubExoPlayer extends StubPlayer implements ExoPlayer {
|
||||
* @deprecated Use {@link Player}, as the {@link TextComponent} methods are defined by that
|
||||
* interface.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Returning deprecated type
|
||||
@Override
|
||||
@Deprecated
|
||||
public TextComponent getTextComponent() {
|
||||
@ -85,6 +88,7 @@ public class StubExoPlayer extends StubPlayer implements ExoPlayer {
|
||||
* @deprecated Use {@link Player}, as the {@link DeviceComponent} methods are defined by that
|
||||
* interface.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Returning deprecated type
|
||||
@Override
|
||||
@Deprecated
|
||||
public DeviceComponent getDeviceComponent() {
|
||||
|
@ -77,6 +77,7 @@ public final class PlaybackOutput implements Dumper.Dumpable {
|
||||
metadatas.add(metadata);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Intentionally testing deprecated output
|
||||
@Override
|
||||
public void onCues(List<Cue> cues) {
|
||||
subtitlesFromDeprecatedTextOutput.add(cues);
|
||||
|
@ -23,5 +23,5 @@ locally. Instructions for doing this can be found in the [top level README][].
|
||||
* [Developer Guide][]
|
||||
* [Javadoc][]
|
||||
|
||||
[Developer Guide]: https://developer.android.com/guide/topics/media/transformer
|
||||
[Developer Guide]: https://developer.android.com/media/media3/transformer
|
||||
[Javadoc]: https://developer.android.com/reference/androidx/media3/transformer/package-summary
|
||||
|
@ -541,7 +541,7 @@ public final class DefaultEncoderFactory implements Codec.EncoderFactory {
|
||||
|
||||
/**
|
||||
* Applying suggested profile/level settings from
|
||||
* https://developer.android.com/guide/topics/media/sharing-video#b-frames_and_encoding_profiles
|
||||
* https://developer.android.com/media/optimize/sharing#b-frames_and_encoding_profiles
|
||||
*
|
||||
* <p>The adjustment is applied in-place to {@code mediaFormat}.
|
||||
*/
|
||||
|
@ -50,7 +50,7 @@ import java.util.concurrent.ScheduledExecutorService;
|
||||
* An {@link AssetLoader} implementation that loads images into {@link Bitmap} instances.
|
||||
*
|
||||
* <p>Supports the image formats listed <a
|
||||
* href="https://developer.android.com/guide/topics/media/media-formats#image-formats">here</a>
|
||||
* href="https://developer.android.com/media/platform/supported-formats#image-formats">here</a>
|
||||
* except from GIFs, which could exhibit unexpected behavior.
|
||||
*/
|
||||
@UnstableApi
|
||||
|
@ -34,6 +34,7 @@ import androidx.media3.extractor.PositionHolder;
|
||||
import androidx.media3.extractor.SeekMap;
|
||||
import androidx.media3.extractor.TrackOutput;
|
||||
import androidx.media3.extractor.mp4.Mp4Extractor;
|
||||
import androidx.media3.extractor.text.SubtitleParser;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@ -104,7 +105,9 @@ import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
* @throws IOException If an error occurs during metadata extraction.
|
||||
*/
|
||||
public static Mp4Info create(Context context, String filePath, long timeUs) throws IOException {
|
||||
Mp4Extractor mp4Extractor = new Mp4Extractor();
|
||||
Mp4Extractor mp4Extractor =
|
||||
new Mp4Extractor(
|
||||
SubtitleParser.Factory.UNSUPPORTED, Mp4Extractor.FLAG_EMIT_RAW_SUBTITLE_DATA);
|
||||
ExtractorOutputImpl extractorOutput = new ExtractorOutputImpl();
|
||||
DefaultDataSource dataSource =
|
||||
new DefaultDataSource(context, /* allowCrossProtocolRedirects= */ false);
|
||||
|
@ -36,6 +36,7 @@ import java.lang.annotation.Target;
|
||||
/**
|
||||
* @deprecated Use {@link ExportException} instead.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Deprecated usages of own type
|
||||
@Deprecated
|
||||
@UnstableApi
|
||||
public final class TransformationException extends Exception {
|
||||
|
@ -30,6 +30,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
/**
|
||||
* @deprecated Use {@link ExportResult} instead.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Deprecated usages of own type
|
||||
@Deprecated
|
||||
@UnstableApi
|
||||
public final class TransformationResult {
|
||||
|
@ -597,6 +597,7 @@ public final class Transformer {
|
||||
/**
|
||||
* @deprecated Use {@link #onCompleted(Composition, ExportResult)} instead.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Using deprecated type in callback
|
||||
@Deprecated
|
||||
default void onTransformationCompleted(MediaItem inputMediaItem, TransformationResult result) {
|
||||
onTransformationCompleted(inputMediaItem);
|
||||
@ -623,6 +624,7 @@ public final class Transformer {
|
||||
/**
|
||||
* @deprecated Use {@link #onError(Composition, ExportResult, ExportException)} instead.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Using deprecated type in callback
|
||||
@Deprecated
|
||||
default void onTransformationError(
|
||||
MediaItem inputMediaItem, TransformationException exception) {
|
||||
@ -632,6 +634,7 @@ public final class Transformer {
|
||||
/**
|
||||
* @deprecated Use {@link #onError(Composition, ExportResult, ExportException)} instead.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Using deprecated type in callback
|
||||
@Deprecated
|
||||
default void onTransformationError(
|
||||
MediaItem inputMediaItem, TransformationResult result, TransformationException exception) {
|
||||
|
@ -23,5 +23,5 @@ locally. Instructions for doing this can be found in the [top level README][].
|
||||
* [Developer Guide][]
|
||||
* [Javadoc][]
|
||||
|
||||
[Developer Guide]: https://developer.android.com/guide/topics/media/ui/playerview
|
||||
[Developer Guide]: https://developer.android.com/media/media3/ui/playerview
|
||||
[Javadoc]: https://developer.android.com/reference/androidx/media3/ui/package-summary
|
||||
|
@ -331,7 +331,10 @@ public class PlayerControlView extends FrameLayout {
|
||||
@Nullable private Player player;
|
||||
@Nullable private ProgressUpdateListener progressUpdateListener;
|
||||
|
||||
@Nullable private OnFullScreenModeChangedListener onFullScreenModeChangedListener;
|
||||
@SuppressWarnings("deprecation") // Supporting deprecated listener
|
||||
@Nullable
|
||||
private OnFullScreenModeChangedListener onFullScreenModeChangedListener;
|
||||
|
||||
private boolean isFullScreen;
|
||||
private boolean isAttachedToWindow;
|
||||
private boolean showMultiWindowTimeBar;
|
||||
@ -1847,7 +1850,7 @@ public class PlayerControlView extends FrameLayout {
|
||||
mainTextView = itemView.findViewById(R.id.exo_main_text);
|
||||
subTextView = itemView.findViewById(R.id.exo_sub_text);
|
||||
iconView = itemView.findViewById(R.id.exo_icon);
|
||||
itemView.setOnClickListener(v -> onSettingViewClicked(getAdapterPosition()));
|
||||
itemView.setOnClickListener(v -> onSettingViewClicked(getBindingAdapterPosition()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -147,8 +147,8 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
* {@code video_decoder_gl_surface_view} and {@code none}. Using {@code none} is recommended
|
||||
* for audio only applications, since creating the surface can be expensive. Using {@code
|
||||
* surface_view} is recommended for video applications. See <a
|
||||
* href="https://developer.android.com/guide/topics/media/ui/playerview#surfacetype">Choosing
|
||||
* a surface type</a> for more information.
|
||||
* href="https://developer.android.com/media/media3/ui/playerview#surfacetype">Choosing a
|
||||
* surface type</a> for more information.
|
||||
* <ul>
|
||||
* <li>Corresponding method: None
|
||||
* <li>Default: {@code surface_view}
|
||||
@ -306,7 +306,8 @@ public class PlayerView extends FrameLayout implements AdViewProvider {
|
||||
this(context, attrs, /* defStyleAttr= */ 0);
|
||||
}
|
||||
|
||||
@SuppressWarnings({"nullness:argument", "nullness:method.invocation"})
|
||||
// Using deprecated PlayerControlView.VisibilityListener internally
|
||||
@SuppressWarnings({"nullness:argument", "nullness:method.invocation", "deprecation"})
|
||||
public PlayerView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
|
||||
@ -1021,6 +1022,7 @@ public class PlayerView extends FrameLayout implements AdViewProvider {
|
||||
* @deprecated Use {@link #setFullscreenButtonClickListener(FullscreenButtonClickListener)}
|
||||
* instead.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Forwarding deprecated call
|
||||
@Deprecated
|
||||
@UnstableApi
|
||||
public void setControllerOnFullScreenModeChangedListener(
|
||||
@ -1292,13 +1294,13 @@ public class PlayerView extends FrameLayout implements AdViewProvider {
|
||||
List<AdOverlayInfo> overlayViews = new ArrayList<>();
|
||||
if (overlayFrameLayout != null) {
|
||||
overlayViews.add(
|
||||
new AdOverlayInfo(
|
||||
overlayFrameLayout,
|
||||
AdOverlayInfo.PURPOSE_NOT_VISIBLE,
|
||||
/* detailedReason= */ "Transparent overlay does not impact viewability"));
|
||||
new AdOverlayInfo.Builder(overlayFrameLayout, AdOverlayInfo.PURPOSE_NOT_VISIBLE)
|
||||
.setDetailedReason("Transparent overlay does not impact viewability")
|
||||
.build());
|
||||
}
|
||||
if (controller != null) {
|
||||
overlayViews.add(new AdOverlayInfo(controller, AdOverlayInfo.PURPOSE_CONTROLS));
|
||||
overlayViews.add(
|
||||
new AdOverlayInfo.Builder(controller, AdOverlayInfo.PURPOSE_CONTROLS).build());
|
||||
}
|
||||
return ImmutableList.copyOf(overlayViews);
|
||||
}
|
||||
|
@ -50,8 +50,8 @@ import java.util.List;
|
||||
* for non-Wear OS devices.
|
||||
*
|
||||
* <p>The system dialog will be the <a
|
||||
* href="https://developer.android.com/guide/topics/media/media-routing#output-switcher">Media
|
||||
* Output Switcher</a> if it is available on the device, or otherwise the Bluetooth settings screen.
|
||||
* href="https://developer.android.com/media/routing#output-switcher">Media Output Switcher</a> if
|
||||
* it is available on the device, or otherwise the Bluetooth settings screen.
|
||||
*
|
||||
* <p>This implementation also pauses playback when launching the system dialog. The underlying
|
||||
* {@link Player} implementation (e.g. ExoPlayer) is expected to resume playback automatically when
|
||||
|
Loading…
x
Reference in New Issue
Block a user