MediaInfo | Android Developers

Quicknav Quicknav
Links

- Google Play Developer Console
- Android Developers Blog
- About Android

Android Sites

- Android.com
- Android Developers
- Android Open Source Project

Language
close

- - About
  - Wear
  - TV
  - Auto
- - Get Started
  - Devices
  - Style
  - Patterns
  - Building Blocks
  - Downloads
  - Videos
- - Training
  - API Guides
  - Reference
  - Tools
  - Google Services
  - Samples
- - Google Play
  - Essentials
  - Get Users
  - Engage & Retain
  - Monetize
  - Tools & Reference
  - Developer Stories

## Results

Loading...
Summary: Nested Classes | Constants | Methods | Inherited Methods | [Expand All]
public final class

# MediaInfo

extends Object

java.lang.Object
↳ | com.google.android.gms.cast.MediaInfo

## Class Overview

A class that aggregates information about a media item. Use `MediaInfo.Builder` to build an instance of this class. `MediaInfo` is used by `RemoteMediaPlayer` to load media on the receiver application.

## Summary

Nested Classes
class | MediaInfo.Builder | A builder for `MediaInfo` objects.

Constants
int | STREAM_TYPE_BUFFERED | A buffered stream type.
int | STREAM_TYPE_INVALID | An invalid (unknown) stream type.
int | STREAM_TYPE_LIVE | A live stream type.
int | STREAM_TYPE_NONE | A stream type of "none".

Public Methods
boolean | equals(Object other)
String | getContentId() Returns the content ID.
String | getContentType() Returns the content (MIME) type.
JSONObject | getCustomData() Returns the custom data, if any.
List<MediaTrack> | getMediaTracks() Returns the list of media tracks, or `null` if none have been specified.
MediaMetadata | getMetadata() Returns the media item metadata.
long | getStreamDuration() Returns the stream duration, in milliseconds.
int | getStreamType() Returns the stream type; one of the `STREAM_TYPE_` constants.
TextTrackStyle | getTextTrackStyle() Returns the text track style, or `null` if none has been specified.
int | hashCode()
void | setTextTrackStyle(TextTrackStyle textTrackStyle) Sets the text track style.

[Expand] Inherited Methods
From class java.lang.Object
Object | clone()
boolean | equals(Object arg0)
void | finalize()
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)

## Constants

#### public static final int STREAM_TYPE_BUFFERED

A buffered stream type.

Constant Value: 1 (0x00000001)

#### public static final int STREAM_TYPE_INVALID

An invalid (unknown) stream type.

Constant Value: -1 (0xffffffff)

#### public static final int STREAM_TYPE_LIVE

A live stream type.

Constant Value: 2 (0x00000002)

#### public static final int STREAM_TYPE_NONE

A stream type of "none".

Constant Value: 0 (0x00000000)

## Public Methods

#### public boolean equals (Object other)

#### public String getContentId ()

Returns the content ID.

#### public String getContentType ()

Returns the content (MIME) type.

#### public JSONObject getCustomData ()

Returns the custom data, if any.

#### public List<MediaTrack> getMediaTracks ()

Returns the list of media tracks, or `null` if none have been specified.

#### public MediaMetadata getMetadata ()

Returns the media item metadata.

#### public long getStreamDuration ()

Returns the stream duration, in milliseconds.

#### public int getStreamType ()

Returns the stream type; one of the `STREAM_TYPE_` constants.

#### public TextTrackStyle getTextTrackStyle ()

Returns the text track style, or `null` if none has been specified.

#### public int hashCode ()

#### public void setTextTrackStyle (TextTrackStyle textTrackStyle)

Sets the text track style.