#include <NGIAgoraRtmpUser.h>
The IRtmpUser class defines the behavior and state of the RTMP user.
Once connected, a RTMP connection has its own user. Apps can get the user object using IRtmpConnection::getUser.
◆ setAudioStreamConfiguration()
Configures the RTMP audio stream.
- Parameters
-
config | The reference to the audio stream configurations: AudioStreamConfiguration. |
- Returns
- 0: Success.
- < 0: Failure.
◆ setVideoStreamConfiguration()
Configures the RTMP video stream.
- Parameters
-
config | The reference to the video stream configurations: VideoStreamConfiguration. |
- Returns
- 0: Success.
- < 0: Failure.
◆ publishAudio()
virtual int agora::rtmp::IRtmpUser::publishAudio |
( |
agora_refptr< rtc::ILocalAudioTrack > |
audioTrack | ) |
|
|
pure virtual |
Publishes a local audio track to the RTMP connection.
- Parameters
-
audioTrack | The local audio track to be published: ILocalAudioTrack. |
- Returns
- 0: Success.
- < 0: Failure.
◆ unpublishAudio()
virtual int agora::rtmp::IRtmpUser::unpublishAudio |
( |
agora_refptr< rtc::ILocalAudioTrack > |
audioTrack | ) |
|
|
pure virtual |
Stops publishing the local audio track to the RTMP connection.
- Parameters
-
audioTrack | The local audio track that you want to stop publishing: ILocalAudioTrack. |
- Returns
- 0: Success.
- < 0: Failure.
◆ publishVideo()
virtual int agora::rtmp::IRtmpUser::publishVideo |
( |
agora_refptr< rtc::ILocalVideoTrack > |
videoTrack | ) |
|
|
pure virtual |
Publishes a local video track to the RTMP connection.
- Parameters
-
videoTrack | The local video track to be published: ILocalVideoTrack. |
- Returns
- 0: Success.
- < 0: Failure.
◆ unpublishVideo()
virtual int agora::rtmp::IRtmpUser::unpublishVideo |
( |
agora_refptr< rtc::ILocalVideoTrack > |
videoTrack | ) |
|
|
pure virtual |
Stops publishing the local video track to the RTMP connection.
- Parameters
-
videoTrack | The local video track that you want to stop publishing: ILocalVideoTrack.
- 0: Success.
- < 0: Failure.
|
◆ registerRtmpUserObserver()
virtual int agora::rtmp::IRtmpUser::registerRtmpUserObserver |
( |
IRtmpUserObserver * |
observer | ) |
|
|
pure virtual |
Registers a RTMP user observer object.
You need to implement the IRtmpUserObserver class in this method. Once registered, the IRtmpUserObserver receives events sent by the IRtmpUser object.
- Parameters
-
- Returns
- 0: Success.
- < 0: Failure.
◆ unregisteRtmpUserObserver()
virtual int agora::rtmp::IRtmpUser::unregisteRtmpUserObserver |
( |
IRtmpUserObserver * |
observer | ) |
|
|
pure virtual |
◆ registerAudioFrameObserver()
virtual int agora::rtmp::IRtmpUser::registerAudioFrameObserver |
( |
media::base::IAudioFrameObserver * |
observer | ) |
|
|
pure virtual |
Registers an audio frame observer object.
- Parameters
-
observer | A pointer to the audio frame observer object: IAudioFrameObserver. |
- Returns
- 0: Success.
- < 0: Failure.
◆ unregisterAudioFrameObserver()
virtual void agora::rtmp::IRtmpUser::unregisterAudioFrameObserver |
( |
media::base::IAudioFrameObserver * |
observer | ) |
|
|
pure virtual |
Unregisters an audio frame observer object.
- Parameters
-
observer | A pointer to the audio frame observer object: IAudioFrameObserver. |
◆ registerVideoFrameObserver()
virtual int agora::rtmp::IRtmpUser::registerVideoFrameObserver |
( |
media::base::IVideoFrameObserver * |
observer | ) |
|
|
pure virtual |
Registers a video frame observer object.
- Parameters
-
observer | A pointer to the video frame observer: IVideoFrameObserver. |
- Returns
- 0: Success.
- < 0: Failure.
◆ unregisterVideoFrameObserver()
virtual void agora::rtmp::IRtmpUser::unregisterVideoFrameObserver |
( |
media::base::IVideoFrameObserver * |
observer | ) |
|
|
pure virtual |
Unregisters a video frame observer object.
- Parameters
-
observer | A pointer to the video frame observer: IVideoFrameObserver. |
◆ snapshot()
Registers a ISnapshotCallback object.
- Parameters
-
callback | A pointer to the snapshot callback: ISnapshotCallback. This callback is just only called once |
- Returns
- 0: Success.
- < 0: Failure.