public class

MediaConstants

extends java.lang.Object

 java.lang.Object

↳androidx.media2.session.MediaConstants

Gradle dependencies

compile group: 'androidx.media2', name: 'media2-session', version: '1.3.0'

  • groupId: androidx.media2
  • artifactId: media2-session
  • version: 1.3.0

Artifact androidx.media2:media2-session:1.3.0 it located at Google repository (https://maven.google.com/)

Overview

Media constants for sharing constants between media provider and consumer apps

Summary

Fields
public static final java.lang.StringMEDIA_URI_AUTHORITY

A authority used in a media Uri.

public static final java.lang.StringMEDIA_URI_PATH_PLAY_FROM_MEDIA_ID

A path used by .MediaControllerCompat.TransportControls#playFromMediaId See MediaController.setMediaUri(Uri, Bundle) and MediaSession.SessionCallback.onSetMediaUri(MediaSession, MediaSession.ControllerInfo, Uri, Bundle) for more details.

public static final java.lang.StringMEDIA_URI_PATH_PLAY_FROM_SEARCH

A path used by .MediaControllerCompat.TransportControls#playFromSearch See MediaController.setMediaUri(Uri, Bundle) and MediaSession.SessionCallback.onSetMediaUri(MediaSession, MediaSession.ControllerInfo, Uri, Bundle) for more details.

public static final java.lang.StringMEDIA_URI_PATH_PREPARE_FROM_MEDIA_ID

A path used by .MediaControllerCompat.TransportControls#prepareFromMediaId See MediaController.setMediaUri(Uri, Bundle) and MediaSession.SessionCallback.onSetMediaUri(MediaSession, MediaSession.ControllerInfo, Uri, Bundle) for more details.

public static final java.lang.StringMEDIA_URI_PATH_PREPARE_FROM_SEARCH

A path used by .MediaControllerCompat.TransportControls#prepareFromSearch See MediaController.setMediaUri(Uri, Bundle) and MediaSession.SessionCallback.onSetMediaUri(MediaSession, MediaSession.ControllerInfo, Uri, Bundle) for more details.

public static final java.lang.StringMEDIA_URI_PATH_SET_MEDIA_URI

A path for encoding how the Uri will be translated when connected to android.support.v4.media.session.MediaSessionCompat.

public static final java.lang.StringMEDIA_URI_QUERY_ID

A query for media ID.

public static final java.lang.StringMEDIA_URI_QUERY_QUERY

A query for search query.

public static final java.lang.StringMEDIA_URI_QUERY_URI

A query for media Uri.

public static final java.lang.StringMEDIA_URI_SCHEME

A scheme used in a media Uri.

Methods
from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Fields

public static final java.lang.String MEDIA_URI_SCHEME

A scheme used in a media Uri. See MediaController.setMediaUri(Uri, Bundle) and MediaSession.SessionCallback.onSetMediaUri(MediaSession, MediaSession.ControllerInfo, Uri, Bundle) for more details.

public static final java.lang.String MEDIA_URI_AUTHORITY

A authority used in a media Uri. See MediaController.setMediaUri(Uri, Bundle) and MediaSession.SessionCallback.onSetMediaUri(MediaSession, MediaSession.ControllerInfo, Uri, Bundle) for more details.

public static final java.lang.String MEDIA_URI_PATH_PLAY_FROM_MEDIA_ID

A path used by .MediaControllerCompat.TransportControls#playFromMediaId See MediaController.setMediaUri(Uri, Bundle) and MediaSession.SessionCallback.onSetMediaUri(MediaSession, MediaSession.ControllerInfo, Uri, Bundle) for more details.

public static final java.lang.String MEDIA_URI_PATH_PLAY_FROM_SEARCH

A path used by .MediaControllerCompat.TransportControls#playFromSearch See MediaController.setMediaUri(Uri, Bundle) and MediaSession.SessionCallback.onSetMediaUri(MediaSession, MediaSession.ControllerInfo, Uri, Bundle) for more details.

public static final java.lang.String MEDIA_URI_PATH_PREPARE_FROM_MEDIA_ID

A path used by .MediaControllerCompat.TransportControls#prepareFromMediaId See MediaController.setMediaUri(Uri, Bundle) and MediaSession.SessionCallback.onSetMediaUri(MediaSession, MediaSession.ControllerInfo, Uri, Bundle) for more details.

public static final java.lang.String MEDIA_URI_PATH_PREPARE_FROM_SEARCH

A path used by .MediaControllerCompat.TransportControls#prepareFromSearch See MediaController.setMediaUri(Uri, Bundle) and MediaSession.SessionCallback.onSetMediaUri(MediaSession, MediaSession.ControllerInfo, Uri, Bundle) for more details.

public static final java.lang.String MEDIA_URI_PATH_SET_MEDIA_URI

A path for encoding how the Uri will be translated when connected to android.support.v4.media.session.MediaSessionCompat. See MediaController.setMediaUri(Uri, Bundle) for more details.

public static final java.lang.String MEDIA_URI_QUERY_ID

A query for media ID.

See also: MediaSession.SessionCallback.onSetMediaUri(MediaSession, MediaSession.ControllerInfo, Uri, Bundle), MediaController.setMediaUri(Uri, Bundle)

public static final java.lang.String MEDIA_URI_QUERY_QUERY

A query for search query.

See also: MediaSession.SessionCallback.onSetMediaUri(MediaSession, MediaSession.ControllerInfo, Uri, Bundle), MediaController.setMediaUri(Uri, Bundle)

public static final java.lang.String MEDIA_URI_QUERY_URI

A query for media Uri.

See also: MediaController.setMediaUri(Uri, Bundle)

Source

/*
 * Copyright 2019 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package androidx.media2.session;

import android.net.Uri;

/**
 * Media constants for sharing constants between media provider and consumer apps
 *
 * @deprecated androidx.media2 is deprecated. Please migrate to <a
 *     href="https://developer.android.com/guide/topics/media/media3">androidx.media3</a>.
 */
@Deprecated
public class MediaConstants {
    /**
     * A {@link android.net.Uri} scheme used in a media Uri.
     *
     * See {@link MediaController#setMediaUri} and
     * {@link MediaSession.SessionCallback#onSetMediaUri} for more details.
     */
    public static final String MEDIA_URI_SCHEME = "androidx";

    /**
     * A {@link android.net.Uri} authority used in a media Uri.
     *
     * See {@link MediaController#setMediaUri} and
     * {@link MediaSession.SessionCallback#onSetMediaUri} for more details.
     */
    public static final String MEDIA_URI_AUTHORITY = "media2-session";

    /**
     * A {@link android.net.Uri} path used by {@link android.support.v4.media.session
     * .MediaControllerCompat.TransportControls#playFromMediaId}
     *
     * See {@link MediaController#setMediaUri} and
     * {@link MediaSession.SessionCallback#onSetMediaUri} for more details.
     */
    public static final String MEDIA_URI_PATH_PLAY_FROM_MEDIA_ID = "playFromMediaId";

    /**
     * A {@link android.net.Uri} path used by {@link android.support.v4.media.session
     * .MediaControllerCompat.TransportControls#playFromSearch}
     *
     * See {@link MediaController#setMediaUri} and
     * {@link MediaSession.SessionCallback#onSetMediaUri} for more details.
     */
    public static final String MEDIA_URI_PATH_PLAY_FROM_SEARCH = "playFromSearch";

    /**
     * A {@link android.net.Uri} path used by {@link android.support.v4.media.session
     * .MediaControllerCompat.TransportControls#prepareFromMediaId}
     *
     * See {@link MediaController#setMediaUri} and
     * {@link MediaSession.SessionCallback#onSetMediaUri} for more details.
     */
    public static final String MEDIA_URI_PATH_PREPARE_FROM_MEDIA_ID = "prepareFromMediaId";

    /**
     * A {@link android.net.Uri} path used by {@link android.support.v4.media.session
     * .MediaControllerCompat.TransportControls#prepareFromSearch}
     *
     * See {@link MediaController#setMediaUri} and
     * {@link MediaSession.SessionCallback#onSetMediaUri} for more details.
     */
    public static final String MEDIA_URI_PATH_PREPARE_FROM_SEARCH = "prepareFromSearch";

    /**
     * A {@link android.net.Uri} path for encoding how the Uri will be translated when connected
     * to {@link android.support.v4.media.session.MediaSessionCompat}.
     *
     * See {@link MediaController#setMediaUri} for more details.
     */
    public static final String MEDIA_URI_PATH_SET_MEDIA_URI = "setMediaUri";

    // From scheme to path, plus path delimiter
    static final String MEDIA_URI_SET_MEDIA_URI_PREFIX =
            new Uri.Builder()
                    .scheme(MEDIA_URI_SCHEME)
                    .authority(MEDIA_URI_AUTHORITY)
                    .path(MEDIA_URI_PATH_SET_MEDIA_URI).build().toString() + "?";

    /**
     * A {@link android.net.Uri} query for media ID.
     *
     * @see MediaSession.SessionCallback#onSetMediaUri
     * @see MediaController#setMediaUri
     */
    public static final String MEDIA_URI_QUERY_ID = "id";

    /**
     * A {@link android.net.Uri} query for search query.
     *
     * @see MediaSession.SessionCallback#onSetMediaUri
     * @see MediaController#setMediaUri
     */
    public static final String MEDIA_URI_QUERY_QUERY = "query";

    /**
     * A {@link android.net.Uri} query for media Uri.
     *
     * @see MediaController#setMediaUri
     */
    public static final String MEDIA_URI_QUERY_URI = "uri";

    static final String ARGUMENT_CAPTIONING_ENABLED = "androidx.media2.argument.CAPTIONING_ENABLED";

    private MediaConstants() {
    }
}