【问题标题】:Audio Players is not working, AVPlayerItem.Status.failed iOS音频播放器不工作,AVPlayerItem.Status.failed iOS
【发布时间】:2022-12-29 00:20:40
【问题描述】:

我正在尝试将插件音频播放器用于我录制的音频(它在 android 上运行得很好)但是当我尝试播放音频时出现此错误:

"iOS => call setVolume, playerId 57c0b5cc-3c75-4f8f-bf99-ad8ddbcb7709"
"iOS => call setUrl, playerId 57c0b5cc-3c75-4f8f-bf99-ad8ddbcb7709"
""
2022-06-23 18:27:00.168194-0300 Runner[16264:695114] flutter: AVPlayerItem.Status.failed

知道我能做些什么来解决这个问题吗?

await audioPlayer2.setVolume(1.0);
      await audioPlayer2.setUrl(filepath, isLocal: true);
      await audioPlayer2.play(filepath, isLocal: true);
      audioPlayer2.onPlayerStateChanged.listen((event) {
        setState(() {
          _isPlaying = false;
        });

【问题讨论】:

    标签: flutter avaudioplayer


    【解决方案1】:

    而不是使用setUrl然后玩我只用了这个:

    final _audioPlayer = AudioPlayer()..setReleaseMode(ReleaseMode.stop);
    await _audioPlayer.play(UrlSource(widget.postData.audioURL));
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-03-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-04-30
      • 1970-01-01
      相关资源
      最近更新 更多