startPlayMusic method
Start background music
You must assign an ID to each music track, through which you can start, stop, or set the volume of the music track.
Note: to play back multiple music tracks at the same time, assign different IDs to them. If you use the same ID for different music tracks, the SDK cannot play them back at the same time. Instead, it stops playing back the old music track and then starts playing back the new one.
Parameters:
musicParam
Music parameter. For more information, please see the definition of the AudioMusicParam parameter
Return:
true
: success; false
: failure
Implementation
Future<bool?> startPlayMusic(AudioMusicParam musicParam) async {
var result = _channel
.invokeMethod('startPlayMusic', {"musicParam": jsonEncode(musicParam)});
return V2TXLiveFlutterResult.boolValue(result);
}