Active Topics

 


Reply
Thread Tools
Posts: 169 | Thanked: 194 times | Joined on Apr 2012 @ Austria
#1
like the title says i would like to have the function the n900 had back then to press the headsetbutton and then it would start the mediaplayer and play random music. i tried it for myself and as far as i got i also reported here https://together.jolla.com/question/...s-play-button/ i could get the mediaplayer to start playing music automatically, but it only would do this when the app gets into foreground and scanning of the library finished but not in the background, because i put the function or whatever in onFinished section of one qml and it waited for the gui to finish. now the question is how to get this scanning to be triggered in the background and then playing music is trivial^^. i managed to do this if i put the function or whatever outside the onFinished section, but it then strangely would only play one song. thanks in advance for any suggestions
 

The Following 2 Users Say Thank You to smatkovi For This Useful Post:
Posts: 169 | Thanked: 194 times | Joined on Apr 2012 @ Austria
#2
putting AudioPlayer.shuffleAndPlay(allSongModel, allSongModel.count) in onFinished in /usr/share/jolla-mediaplayer/mediaplayer.qml lets the mediaplayer automatically play random music, but unfortunately not when the device is locked
 

The Following 3 Users Say Thank You to smatkovi For This Useful Post:
Posts: 169 | Thanked: 194 times | Joined on Apr 2012 @ Austria
#3
i investigated a little and found out that the signal from the headset comes to the mpris section in the AudioPlayer.qml where also the function shuffleAndPlayAllAudio is located. the thing is ,it takes 2 arguments, model and some size, which both are only available in mediaplayer.qml, but how can i tell mediaplayer.qml from Audioplayer.qml to call the function shuffleAndPlayAllAudio? my idea was to send a signal from Audioplayer.qml, so i put in mpris section, which has the id mprisPlayer, signal mys and in onPlayRequested i put mprisPlayer.mys(). in mediaplayer.qml i changed onFinished to onMys and put the function to shuffle and play all audio there. but when i run jolla-mediaplayer it tells me cannot assign to non-existent property onMys
 

The Following 3 Users Say Thank You to smatkovi For This Useful Post:
Reply

Tags
automatically, background, headset button, mediaplayer, music


 
Forum Jump


All times are GMT. The time now is 04:05.