play method
The play function on HMSAudioFilePlayerNode to play a file on a local device in a meeting room.
Parameters:
fileUrl - Enter the path of file Refer example App
loop - Play audio in loop. Example background Music
interrupts - Set interrupts parameter to false to tell HMSAudioFilePlayerNode to not interrupt the current file playback, but schedule the file after the current file is finished.
Implementation
Future<HMSException?> play(
{required String fileUrl,
bool loop = false,
bool interrupts = true}) async {
var result = await PlatformService.invokeMethod(
PlatformMethod.playAudioShare,
arguments: {
"name": methodName,
"file_url": fileUrl,
"loops": loop,
"interrupts": interrupts
});
if (result["success"]) {
return null;
} else {
return HMSException.fromMap(result["data"]["error"]);
}
}