Agora Java API Reference for Android

Public Member Functions | Protected Member Functions | List of all members
io.agora.rte.PlayerInfo Class Reference

Information about the player and media stream. More...

## Public Member Functions
long | getNativeHandle ()
int | state ()
long | duration ()
| Gets the duration of the current media resource. More...
int | streamCount ()
| Gets the stream count in the current playback source. More...
boolean | hasAudio ()
| Determines whether the media resource contains an audio stream. More...
boolean | hasVideo ()
| Determines whether a video stream is included. More...
boolean | isAudioMuted ()
| Determines whether the player has stopped receiving the remote audio stream. More...
boolean | isVideoMuted ()
| Determines whether the player has stopped receiving remote video streams. More...
int | videoHeight ()
| Gets the height of the video resolution. More...
int | videoWidth ()
| Gets the width of the video resolution. More...
Constants.AbrSubscriptionLayer | abrSubscriptionLayer ()
| Gets the current subscribed video layer. More...
int | audioSampleRate ()
| Gets the audio sample rate. More...
int | audioChannels ()
int | audioBitsPerSample ()
| Gets the number of bits per audio sampling point. More...
String | currentUrl ()
| Gets the URL that is currently being played. More...

## Protected Member Functions
void | finalize ()

## Detailed Description

Information about the player and media stream.

Since
  v4.4.0

## Member Function Documentation

## ◆ state()

int io.agora.rte.PlayerInfo.state | ( |  | ) |

Current player state.

## ◆ duration()

long io.agora.rte.PlayerInfo.duration | ( |  | ) |

Gets the duration of the current media resource.

Since
  v4.5.1

Note
  This method is only valid when playing local media files or Media Pull.

Returns
  If the method call succeeds, returns the duration of the current media resource in milliseconds.

## ◆ streamCount()

int io.agora.rte.PlayerInfo.streamCount | ( |  | ) |

Gets the stream count in the current playback source.

This method is only valid when opening a non-RTE URL.

Returns
  If the method call succeeds, returns the stream count.

## ◆ hasAudio()

boolean io.agora.rte.PlayerInfo.hasAudio | ( |  | ) |

Determines whether the media resource contains an audio stream.

Indicates whether the URL source contains an audio stream.

Returns
  - `true`: The URL source contains an audio stream.
  - `false`: The URL source does not contain an audio stream.

## ◆ hasVideo()

boolean io.agora.rte.PlayerInfo.hasVideo | ( |  | ) |

Determines whether a video stream is included.

Returns
  - `true`: The URL source contains a video stream.
  - `false`: The URL source does not contain a video stream.

## ◆ isAudioMuted()

boolean io.agora.rte.PlayerInfo.isAudioMuted | ( |  | ) |

Determines whether the player has stopped receiving the remote audio stream.

Since
  v4.4.0

This method determines whether the player has stopped receiving the remote audio stream.

Returns
  - `true`: The remote audio stream has stopped being received.
  - `false`: The remote audio stream is still being received.

## ◆ isVideoMuted()

boolean io.agora.rte.PlayerInfo.isVideoMuted | ( |  | ) |

Determines whether the player has stopped receiving remote video streams.

Since
  v4.4.0

Note
  The `IsVideoMuted` API is only effective when an RTE URL is opened.

Returns
  - `true`: Stops receiving remote video streams.
  - `false`: Continues receiving remote video streams.

## ◆ videoHeight()

int io.agora.rte.PlayerInfo.videoHeight | ( |  | ) |

Gets the height of the video resolution.

Since
  v4.5.1

Returns
  If the method call succeeds, returns the height of the video resolution in pixels.

## ◆ videoWidth()

int io.agora.rte.PlayerInfo.videoWidth | ( |  | ) |

Gets the width of the video resolution.

Since
  v4.5.1

Returns
  If the method call succeeds, returns the width of the video resolution in pixels.

## ◆ abrSubscriptionLayer()

Constants.AbrSubscriptionLayer io.agora.rte.PlayerInfo.abrSubscriptionLayer | ( |  | ) |

Gets the current subscribed video layer.

This field is only valid when opening an RTE URL.

Returns
  - If the method call succeeds, returns an `AbrSubscriptionLayer` object. See `AbrSubscriptionLayer` for details.

## ◆ audioSampleRate()

int io.agora.rte.PlayerInfo.audioSampleRate | ( |  | ) |

Gets the audio sample rate.

Since
  v4.5.1

Returns
  If the method call succeeds, returns the audio sample rate in Hz.

## ◆ audioChannels()

int io.agora.rte.PlayerInfo.audioChannels | ( |  | ) |

Number of audio channels.

## ◆ audioBitsPerSample()

int io.agora.rte.PlayerInfo.audioBitsPerSample | ( |  | ) |

Gets the number of bits per audio sampling point.

Since
  v4.5.1

Note
  This field is only valid when a non-RTE URL is opened.

Returns
  If the method call succeeds, returns the number of bits per audio sampling point, in bits.

## ◆ currentUrl()

String io.agora.rte.PlayerInfo.currentUrl | ( |  | ) |

Gets the URL that is currently being played.

Returns
  - If the method call succeeds, returns the URL that is currently being played.
  - If the method call fails, returns an empty string.