playLocal static method

dynamic playLocal(
  1. String localPath, {
  2. int? duration,
})

Implementation

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