Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 3 Support (Qt 5) › MediaPlayer

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #17919

    André

    Hi,

     

    Can I use something like this in Felgo? I would like to play mp3 files from an URL

     

    Text {
    text: “Click Me!”
    font.pointSize: 24
    width: 150
    height: 50

    MediaPlayer {
    id: playMusic
    source: “http://www.sample-videos.com/audio/mp3/wave.mp3”
    }
    MouseArea {
    id: playArea
    anchors.fill: parent
    onPressed: { playMusic.play() }
    }
    }

     

     

    Thanks,

     

    André

    #17924

    Günther
    Felgo Team

    Hi Andre!

    Yes, it is possible to use MediaPlayer like that. However, on macOS the loading of your audio resource is blocked by default for unsecure HTTP connections. To make this example work, you can

    • either use a secure SSL connection with HTTPS (if your server supports it)
    • or create a custom Info.plist for macOS application configuration, which allows to specify:
            <key>NSAppTransportSecurity</key>
            <dict>
                <key>NSAllowsArbitraryLoads</key>
                <true/>
                <key>NSExceptionDomains</key>
                <dict>
                    <key>example.com</key>
                    <dict>
                        <key>NSExceptionAllowsInsecureHTTPLoads</key>
                        <true/>
                        <key>NSIncludesSubdomains</key>
                        <true/>
                    </dict>
                </dict>
            </dict>

    With this setting your application then allows Insecure Http Loads. You can specify a custom plist configuration in your *.pro configuration with e.g.

     

    QMAKE_INFO_PLIST = macx/Info.plist

     

    Please note that you have to delete your shadow build directory / previously built application to correctly rebuild the app and copy your modified plist. A simple rebuild after changing the plist will not affect your previously built bundle and you won’t see any changes.

    Best,
    Günther

    #17927

    André

    Thanks! – I got it working.

Viewing 3 posts - 1 through 3 (of 3 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded