← Back to team overview

ubuntu-phone team mailing list archive

Re: [Music app] Qt.Multimedia and EndOfMedia?

 

Hi Jim,

Thank you. I'm still having some issues with this since I don't quite understand the different objects in that part of the code.
   Connections {
       target: playerLoader.item
       onStatusChanged: {
           if (playerLoader.item.status === MediaPlayer.EndOfMedia) {
               playerLoader.item.stop()
               playerLoader.item.controlsActive = true
           }
       }
   }

target, I set to playMusic, since that is the ID of the music player I want to get the status and stuff from. Also I tried to use playMusic.EndOfMedia, which comes out as undefined.

What is playerLoader.item?

Vänlig hälsning / Yours sincerely,
 Daniel Holm
 IT Consultant
 Web Developer
 Student
 d.holmen@xxxxxxxxx
 http://www.danielholm.se

Den mån 13 maj 2013 15:21:05 skrev Jim Hodapp:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Daniel,

Take a look at [1] to see how the Ubuntu Touch mediaplayer-app does
it. I think after looking at that QML code, it'll be pretty obvious
for you.

Jim

[1]
http://bazaar.launchpad.net/~phablet-team/mediaplayer-app/trunk/view/head:/src/qml/player.qml#L136

On 05/11/2013 10:43 AM, Daniel Holm wrote:
Hi all,

I'm working hard on the music app and I now need a way to play
another track when the current one ends. Since I'm using
Qt.Multimedia (and QML only!) I found the status property
EndOfMedia which I thought I could use. The only thing is that I
don't know how...

Could anyone help me with this? The code is here:
https://launchpad.net/musicapp/trunk

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJRkOjAAAoJENCYE0OpVkFTvlcH/RGIMCSQXoJ7Avzb/CwGMgAf
C87zlDCfuN8Xy6qowwxHxiF1Ysh+rjcXsvlXBMKXHDQOrZn7iEtUwEV5tkXWzyDj
2iBF6jb2+dsqqtMe5BTF1kKlEI7reGhD8h3sgvTeqNXT787P+8hTYL5OIlPiN0VS
NYyaB1HG/swaF2n4jHiRtddIlkaSRFtdPRznpv6bZnu0z3Fw6/SYoIDw7bl6j1oh
LE3l4vVHHQ22C++I0OKiZarm3BHTQqij789Ru/+iqp9KnI0IOBkrawv2X0bJKtvK
J1muLtGVyZcDgCgWT4bFZ+k4PgkncbRifmvpV285iW2fUuTgvPysuNI7z85dqEU=
=D/RY
-----END PGP SIGNATURE-----



References