diff --git a/example/lib/chat_bubble.dart b/example/lib/chat_bubble.dart index 8489a19e..566c8bd0 100644 --- a/example/lib/chat_bubble.dart +++ b/example/lib/chat_bubble.dart @@ -104,9 +104,9 @@ class _WaveBubbleState extends State { } // Prepare player with extracting waveform if index is even. controller.preparePlayer( - path: widget.path ?? file!.path, - shouldExtractWaveform: widget.index?.isEven ?? true, - ); + path: widget.path ?? file!.path, + shouldExtractWaveform: widget.index?.isEven ?? true, + isLocal: true); // Extracting waveform separately if index is odd. if (widget.index?.isOdd ?? false) { controller diff --git a/lib/src/controllers/player_controller.dart b/lib/src/controllers/player_controller.dart index 73a5cfb4..df45ed7f 100644 --- a/lib/src/controllers/player_controller.dart +++ b/lib/src/controllers/player_controller.dart @@ -110,13 +110,13 @@ class PlayerController extends ChangeNotifier { /// number of bars in the waveform. /// /// Defaults to 100. - Future preparePlayer({ - required String path, - double? volume, - bool shouldExtractWaveform = true, - int noOfSamples = 100, - }) async { - path = Uri.parse(path).path; + Future preparePlayer( + {required String path, + double? volume, + bool shouldExtractWaveform = true, + int noOfSamples = 100, + bool isLocal = true}) async { + path = isLocal ? Uri.parse(path).path : path; final isPrepared = await AudioWaveformsInterface.instance.preparePlayer( path: path, key: playerKey,