just_audio not working on ios flutter Unhandled Exception: (-11800) The operation could not be completed

815

Solution 1

If you wish to connect to non-HTTPS URLS, add the following to your Info.plist file:

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
    <key>NSAllowsArbitraryLoadsForMedia</key>
    <true/>
</dict>

Solution 2

You might need to test just_audio on a real iOS device.

It seems like the exception only gets thrown on a Simulator. 🤔


Also, don't forget to allow arbitrary loads as shown here by Reham 🙌🏽

Share:
815
Sina Safari
Author by

Sina Safari

Updated on December 06, 2022

Comments

  • Sina Safari
    Sina Safari over 1 year

    I am trying to run the just_audio sample project from its own repository https://github.com/ryanheise/just_audio/tree/master/just_audio/example

    It is working fine on android but when I clone the project using a mac and run it on the simulator it throws this error :

    [VERBOSE-2:ui_dart_state.cc(199)] Unhandled Exception: (-11800) The operation could not be completed 
        #0      AudioPlayer._load (package:just_audio/just_audio.dart:778:9)
        <asynchronous suspension>
        #1      AudioPlayer._setPlatformActive.<anonymous closure> (package:just_audio/just_audio.dart:1346:28)
        <asynchronous suspension>
    

    And this error pops up while I'm trying to call the audio URL for streaming using setUrl() method

    I have also tried Editing Transport security as the documentation recommends

    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
        <key>NSAllowsArbitraryLoadsForMedia</key>
        <true/>
    </dict>
    

    Note

    I have tried all the other packages available for ios for playing and streaming audio and none of them worked

  • Sina Safari
    Sina Safari over 2 years
    Still not working :( throws the same error
  • Sina Safari
    Sina Safari over 2 years
    Thanks but this issue was on both simulator and real device, I solved it btw. the issue was because I was using a signed URL generated by AWS with a security level on top of it. So It did not contain the audio extension in the URL itself. as soon as I add the extension to the URL , problem solved.
  • mohamed abu-ghazalla
    mohamed abu-ghazalla about 2 years
    could your tell me how to add audio extension in URL itself, pleas