setMusicVolume method
@detail api
@author lihuan.wuti2ha
@brief Sets the volume of the playing music. The music must be playing when you set the volume.
@param musicId Music ID.
@param volume Volume. Adjustment range: 0,400.
- 0: Mute.
- 100: Original volume.
- 400: 4 times the original volume (with overflow protection).
@note
- The music must be playing when you call this API.
- If the set volume is greater than 400, it will be adjusted by the maximum value of 400; if the set volume is less than 0, it will be adjusted by the minimum value of 0.
- If the music ID is invalid, you will receive the ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback, with an errorCode of -3023 and a playState of 4.
- If you didn't join the room, you will receive the ktvPlayer:onPlayStateChanged:state:error:{@link #ByteRTCKTVPlayerDelegate#ktvPlayer:onPlayStateChanged:state:error} callback, with an errorCode of -3022 and a playState of 4.
Implementation
FutureOr<void> setMusicVolume(NSString musicId, int volume) async {
return await nativeCall('setMusicVolume:volume:', [musicId, volume]);
}