开发者

Too many positional arguments: 0 expected, but 1 found. flutter

开发者 https://www.devze.com 2022-12-07 22:48 出处:网络
i have a methode that loaded me the data from server on Json format data , also im using audioPlayer library to play music got it from server , when i want to pass the path insideaudioPlayer.play like

i have a methode that loaded me the data from server on Json format data , also im using audioPlayer library to play music got it from server , when i want to pass the path inside audioPlayer.play like that :

String Url = _loadedAudio[index]['file'];
await audioPlayer.play(Url);

it display to me this开发者_开发问答 error :

Too many positional arguments: 0 expected, but 1 found.

how can i solve it


You can try these two options:

await player.setSourceUrl(Url);
await player.resume();

Or

await player.play(UrlSource(Url));
0

精彩评论

暂无评论...
验证码 换一张
取 消