Agora Java API Reference for Android

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

## Public Member Functions
long | getNativeHandle ()
int | state ()
long | duration ()
| Get the duration time of the current media source. More...
int | streamCount ()
boolean | hasAudio ()
boolean | hasVideo ()
boolean | isAudioMuted ()
| Whether player stops receiving the audio stream. More...
boolean | isVideoMuted ()
| Whether player stops receiving the video stream. More...
int | videoHeight ()
| Get the video resolution height. More...
int | videoWidth ()
| Get the video resolution width. More...
Constants.AbrSubscriptionLayer | abrSubscriptionLayer ()
int | audioSampleRate ()
| Get the audio sample rate. More...
int | audioChannels ()
int | audioBitsPerSample ()
| Get the audio bits per sample. More...
String | currentUrl ()

## Protected Member Functions
void | finalize ()

## Detailed Description

Player information. When the playerInfo information changes, it will be notified through the PlayerObserver.onPlayerInfoUpdated callback. It can also be actively obtained through the Player.getInfo interface.

Since
  v4.4.0

## Member Function Documentation

## ◆ state()

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

Current player state.

## ◆ duration()

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

Get the duration time of the current media source.

Since
  v4.5.1

Note
  This is valid when playing local media files or on-demand streams.

Returns
  The duration time of the current media source, in milliseconds.

## ◆ streamCount()

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

Stream count. This field is only valid when opening a non-RTE URL.

## ◆ hasAudio()

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

Whether there is an audio stream. Indicates whether the url source contains the audio stream.

- true: The url source contains the audio stream.
- false: The url source does not contain the audio stream.

## ◆ hasVideo()

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

Whether there is a video stream. Indicates whether the url source contains the video stream.

- true: The url source contains the video stream.
- false: The url source does not contain the video stream.

## ◆ isAudioMuted()

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

Whether player stops receiving the audio stream.

Since
  v4.4.0

Indicates whether the player stops receiving the audio stream.

Returns
  bool Whether player stops receiving the audio stream.
  - true: Stop receiving the audio stream.
  - false: Continue receiving the audio stream.

## ◆ isVideoMuted()

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

Whether player stops receiving the video stream.

Since
  v4.4.0

Indicates whether the player stops receiving the video stream.

Returns
  bool Whether player stops receiving the video stream.
  - true: Stop receiving the video stream.
  - false: Continue receiving the video stream.

## ◆ videoHeight()

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

Get the video resolution height.

Since
  v4.5.1

Returns
  The video resolution height, in pixels.

## ◆ videoWidth()

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

Get the video resolution width.

Since
  v4.5.1

Returns
  The video resolution width, in pixels.

## ◆ abrSubscriptionLayer()

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

The currently subscribed video layer. This field is only valid when you open an RTE URL.

## ◆ audioSampleRate()

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

Get the audio sample rate.

Since
  v4.5.1

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 | ( |  | ) |

Get the audio bits per sample.

Since
  v4.5.1

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

Returns
  The audio bits per sample, in bits.

## ◆ currentUrl()

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

The URL being played.