Error when using QMediaPlayer on IOS



  • So here is my problem.
    When i use the mediaPlayer from QtMultimedia in my qml file i get the error: defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplyer"

    The app works fine when i use it on Windows or android, only get this error on iOS.

    Anyone know anything about this?

    Best regards,
    John


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Qt on iOS is a static build so there's some additional steps you need to do some as described here and there



  • Ok great! Thanks for the links, I added QT+= multimedia to my .pro file but now i get the error "Failed to load media" instead. So I'm guessing i need to statically link the mp3 file I'm trying to play as well? How do i do that?

    Thanks for the help!

    //John


  • Lifetime Qt Champion

    Depending on the file size, you can use the Qt Resource System, or bundle the files



  • Hmm, I'm still not getting it to work...
    I have the file in my qml.qrc but it's not working, could you maybe give me an example of what my .pro file should look like to get the .mp3 file into the app?


  • Lifetime Qt Champion

    I just realized something: I'm not sure whether the QtMultimedia plugins can handle files found in QRC. So I'd first go with the assets to provide multimedia content with an application since most of the time anyway, these files are already compressed (mp3, mp4 etc.) and generally too big to be compiled in.