Home | History | Annotate | Download | only in media
      1 /*
      2  * Copyright 2018 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 package com.android.support.mediarouter.media;
     18 
     19 import android.os.Bundle;
     20 
     21 /**
     22  * Constants for specifying metadata about a media item as a {@link Bundle}.
     23  * <p>
     24  * This class is part of the remote playback protocol described by the
     25  * {@link MediaControlIntent MediaControlIntent} class.
     26  * </p><p>
     27  * Media item metadata is described as a bundle of key/value pairs as defined
     28  * in this class.  The documentation specifies the type of value associated
     29  * with each key.
     30  * </p><p>
     31  * An application may specify additional custom metadata keys but there is no guarantee
     32  * that they will be recognized by the destination.
     33  * </p>
     34  */
     35 public final class MediaItemMetadata {
     36     /*
     37      * Note: MediaMetadataRetriever also defines a collection of metadata keys that can be
     38      * retrieved from a content stream although the representation is somewhat different here
     39      * since we are sending the data to a remote endpoint.
     40      */
     41 
     42     private MediaItemMetadata() {
     43     }
     44 
     45     /**
     46      * String key: Album artist name.
     47      * <p>
     48      * The value is a string suitable for display.
     49      * </p>
     50      */
     51     public static final String KEY_ALBUM_ARTIST = "android.media.metadata.ALBUM_ARTIST";
     52 
     53     /**
     54      * String key: Album title.
     55      * <p>
     56      * The value is a string suitable for display.
     57      * </p>
     58      */
     59     public static final String KEY_ALBUM_TITLE = "android.media.metadata.ALBUM_TITLE";
     60 
     61     /**
     62      * String key: Artwork Uri.
     63      * <p>
     64      * The value is a string URI for an image file associated with the media item,
     65      * such as album or cover art.
     66      * </p>
     67      */
     68     public static final String KEY_ARTWORK_URI = "android.media.metadata.ARTWORK_URI";
     69 
     70     /**
     71      * String key: Artist name.
     72      * <p>
     73      * The value is a string suitable for display.
     74      * </p>
     75      */
     76     public static final String KEY_ARTIST = "android.media.metadata.ARTIST";
     77 
     78     /**
     79      * String key: Author name.
     80      * <p>
     81      * The value is a string suitable for display.
     82      * </p>
     83      */
     84     public static final String KEY_AUTHOR = "android.media.metadata.AUTHOR";
     85 
     86     /**
     87      * String key: Composer name.
     88      * <p>
     89      * The value is a string suitable for display.
     90      * </p>
     91      */
     92     public static final String KEY_COMPOSER = "android.media.metadata.COMPOSER";
     93 
     94     /**
     95      * String key: Track title.
     96      * <p>
     97      * The value is a string suitable for display.
     98      * </p>
     99      */
    100     public static final String KEY_TITLE = "android.media.metadata.TITLE";
    101 
    102     /**
    103      * Integer key: Year of publication.
    104      * <p>
    105      * The value is an integer year number.
    106      * </p>
    107      */
    108     public static final String KEY_YEAR = "android.media.metadata.YEAR";
    109 
    110     /**
    111      * Integer key: Track number (such as a track on a CD).
    112      * <p>
    113      * The value is a one-based integer track number.
    114      * </p>
    115      */
    116     public static final String KEY_TRACK_NUMBER = "android.media.metadata.TRACK_NUMBER";
    117 
    118     /**
    119      * Integer key: Disc number within a collection.
    120      * <p>
    121      * The value is a one-based integer disc number.
    122      * </p>
    123      */
    124     public static final String KEY_DISC_NUMBER = "android.media.metadata.DISC_NUMBER";
    125 
    126     /**
    127      * Long key: Item playback duration in milliseconds.
    128      * <p>
    129      * The value is a <code>long</code> number of milliseconds.
    130      * </p><p>
    131      * The duration metadata is only a hint to enable a remote media player to
    132      * guess the duration of the content before it actually opens the media stream.
    133      * The remote media player should still determine the actual content duration from
    134      * the media stream itself independent of the value that may be specified by this key.
    135      * </p>
    136      */
    137     public static final String KEY_DURATION = "android.media.metadata.DURATION";
    138 }
    139