Forums

OverviewV-Play 2 Support (Qt 5) › BackgroundMusic Issue

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #8362

    Nour

    Hi

    I am using BackgroundMusic  to play game music, the music not stop playing when locking the mobile

    Code:

     

    BackgroundMusic{
    id:backgroundMusic
    source:"intro23.mp3"
    autoPauseInBackground:true
    }

    Please advice

    Thanks

    #8363

    Christian
    V-Play Team

    Hi,

    I guess you are experiencing this on Android?

    Is it happening on all devices you have tested it on?

    Cheers, Chris

    #8364

    Nour

    Yes for all

    #8387

    Christian
    V-Play Team

    Hi,

    we did test it on all Android devices we had, and could not reproduce the problem – the sound file was successfully paused when the lock button was pressed and then continued when the app was resumed again.

    Can you please try the AudioTest from the V-Play example folder: <QtSDK>/examples/V-Play/examples/multimedia/audio

    Maybe it has something to do with your mp3 file or the code you are using. If the AudioTest also does not work, please send us your project and the affected devices and we’ll have a closer look.

    Cheers, Chris

    #8410

    Alex
    V-Play Team

    Hi,

    thank you for the project files you sent via email. We could initially reproduce the problem and were also able to fix it. We found a faulty configuration in the AndroidManifest.xml file:

    All Qt-related projects usually include the line:

    <uses-sdk android:minSdkVersion="9" android:targetSdkVersion="14" />

    (so our wizards do). In your project configuration you’re missing the “targetSdkVersion” attribute, Android then uses the provided min sdk version number, which results in API 9 for your project. This version is missing the required application state handlers and therefore the background music resumed playback.

    Please make sure to define a target sdk version of 14 or higher and test it again.

    Cheers,

    Alex

    #8411

    Nour

    Thanks for helping

    its working now :)

     

    Thanks

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

RSS feed for this thread

You must be logged in to reply to this topic.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support