playRemote static method

dynamic playRemote(
  1. String remotePath, {
  2. int? duration,
})

Implementation

static playRemote(String remotePath, {int? duration}) async {
  // url
  try {
    await advancedPlayer.play(UrlSource(remotePath));
    if (duration != null && duration > 0) {
      Future.delayed(
          Duration(seconds: duration), () => advancedPlayer.stop());
    }
  } catch (e) {
    Log().exception(e, caller: 'playRemote($remotePath)');
  }
}