Deleted AudioScenario.HIGH_DEFINITION
and uses AudioScenario.GAME_STREAMING
of v3.x, which are exactly the same.
Modifies the option
naming to clarify the control definition for microphone track. Changes publishAudioTrack
in ChannelMediaOptions
to publishMicrophoneTrack
.
In order to enrich the diversity of multi-stream functions, the video source type parameter is added to the video stream callback events. For example: onFirstLocalVideoFrame
, onFirstLocalVideoFramePublished
, onVideoSizeChanged
, onVideoPublishStateChanged
, onLocalVideoStats
, onLocalVideoStateChanged
.
Media Push APIs improvement:
To reduce the difficulty of integrating Media Push, this release optimizes the API design of Media Push and improves the handling of network issues within Media Push clients and servers. You can experience the optimized Media Push functionality with the following new methods:
startRtmpStreamWithoutTranscoding
: Starts pushing media streams to a CDN without transcoding. This method works the same as the old method addPublishStreamUrl(false)
.
startRtmpStreamWithTranscoding
: Starts pushing media streams to a CDN and sets the transcoding configuration. This method works the same as calling the old methods setLiveTranscoding
and addPublishStreamUrl(true)
in sequence.
updateRtmpTranscoding
: Updates the transcoding configuration. This method works the same as the non-first call to the old method setLiveTranscoding
.
stopRtmpStream
: Stop Media Push. This method works the same as the old method removePublishStreamUrl
.
On Android platform, all parameter types inonRtmpStreamingStateChanged
callback are changed to int type.
This release deprecates three old methods for Media Push: addPublishStreamUrl
, setLiveTranscoding
, and removePublishStreamUrl
. Agora recommends that you use the new methods for Media Push.
Deleted the replace
parameter (Bool type) in startAudioMixing
method. By default, the microphone audio and media player audio are sent. If you need to stop sending the microphone audio, you can call the following methods according to whether you want to continue recording:
updateChannelMediaOptions
and set publishMicrophoneTrack
to false
, while the microphone is still on.enableLocalAudio
to turn off the microphone.On Android platform, all parameter types inonRemoteAudioStateChanged
callback are changed to Int type.
IAudioFrameObserver
adds these callbacks: getObservedAudioFramePosition
, getRecordAudioParams
, getPlaybackAudioParams
, getMixedAudioParams
. The setRecordingAudioFrameParameters
and other series of interfaces of 3.x are deprecated.
Extensions are used for screen sharing. See Share Screen.
enableVirtualBackground
addeds SegmentationProperty
and segProperty
parameters.
The following table lists the different behaviors of some commonly used APIs in different versions.
Common API | Legacy 3.x | v4.0.0 Preview & v4.0.0 Beta | v4.0.0 |
---|---|---|---|
muteLocalAudioStream |
The joinChannel method with options parameter overrides the setting of muteLocalAudioStream . |
Equivalent to ChannelMediaOptions.publishAudioTrack , if the host in the channel calls this method and set the parameter to false , the microphone will be turned on. |
|
muteLocalVideoStream |
The joinChannel method with options parameter overrides the setting ofmuteLocalVideoStream . |
Equivalent to ChannelMediaOptions.publishCameraTrack . |
|
setClientRole |
Same as v4.0.0 (multiple upstreams are not supported, and cannot be set as the host in multiple channels at the same time) | The result of setClientRole can be affected by muteLocalAudioStream /muteLocalVideoStream . That is: if you call muteLocalAudioStream(true) /muteLocalVideoStream(true) first, and then call setClientRole to switch to host, the stream still cannot be published. |
|
startPreview |
Same as v4.0.0. | Call startPreview /stopPreview to turn on/off the local preview. |
When joining a channel, when the host publishes the video stream captured by the camera, the local preview will be automatically enabled. If you call startPreview , you will also have to call stopPreview to close the local preview when leaving the channel. |
enableLocalAudio |
Same as v4.0.0. | If the host call this method ( inside or outside the channel), the microphone will be on/off; if the audience call this method, SDK returns an error code. If you call ChannelMediaOptions.publishAudioTrack in the channel, it takes effect. |
If you call this method outside the channel, the microphone will not be turned on/off, and the microphone will be turned on/off automatically after you joining the channel. If you call this method in a channel, the microphone is turned on/off. |
enableLocalVideo |
Same as v4.0.0. | If the host call this method ( inside or outside the channel), the camera is turned on/off; if the audience call this method, SDK returns an error code. If you call ChannelMediaOptions.publishCameraTrack in the channel, it takes effect. |
If you call this method outside the channel, the camera cannot be turned on/off, and the camera will be turned on/off automatically after you joining the channel. |