Playing audio file with QMediaPlayer pause Media player

I found it!

If I understand it correctly, there are two concepts. Media role that may signalize that sound from current application is car navigation or music player… But Gstreamer backend in Qt 5.6 used on Sailfish don’t use it. Every player needs to acquire “resource” (using session D-Bus) to be able play something. When some music player start playing it “steal” resource from previous one and it pause its playback. It have to be resumed manually then. Luckily I found this commit: https://github.com/qt/qtmultimedia/commit/1c5ea95 There are multiple resource classes and they behaves differently… It may be set by NEMO_RESOURCE_CLASS_OVERRIDE environment variable. When second player is using “navigator” class, first player with “player” class is paused and resumed when “navigator” stops…

This is exactly what I need! And it is easy to setup: https://github.com/Karry/osmscout-sailfish/commit/84dd52280de9304660d0042d06dde8aa1ea98bf4 Why I was not able to find it in documentation?

cc @rinigus , it may improve behavior even for Pure Maps :wink: https://github.com/rinigus/pure-maps/issues/120

7 Likes