Results 1 to 2 of 2

Thread: QMediaPlayer crash using QPlaylist

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2019
    Thanked 1 Time in 1 Post
    Qt products

    Question QMediaPlayer crash using QPlaylist


    so i want to run background music on loop and i searched for it on how to do it on google and i found this bit of code:
    Qt Code:
    1. playlist = new QMediaPlaylist();
    2. playlist->addMedia(QUrl("qrc:/World_Sounds/BackgroundSound.wav"));
    3. playlist->setPlaybackMode(QMediaPlaylist::Loop);
    5. music = new QMediaPlayer();
    6. music->setPlaylist(playlist);
    7. music->play();
    To copy to clipboard, switch view to plain text mode 

    but this code crashes as soon as the first song stops playing ? (when it wants to loop)

    but doing only this works, but the problem is it won't loop the media:
    Qt Code:
    1. music = new QMediaPlayer();
    2. music->setMedia(QUrl("qrc:/World_Sounds/BackgroundSound.wav"));
    3. music->play();
    To copy to clipboard, switch view to plain text mode 

    Here is the error message:

    More error messages:

    If anyone knows why does this happen, please help
    Any help is appreciated !!!!
    Attached Images Attached Images
    Last edited by MongKong; 31st March 2020 at 21:03.

Similar Threads

  1. QMediaPlayer crash
    By FlyDoodle in forum Qt Programming
    Replies: 5
    Last Post: 15th October 2019, 10:56
  2. Replies: 0
    Last Post: 3rd November 2015, 18:58
  3. Timecode in QMediaPlayer
    By mkarol in forum Qt Programming
    Replies: 1
    Last Post: 5th December 2013, 18:50
  4. Playing MP4 and FLV with QMediaPlayer
    By JasonKretzer in forum Newbie
    Replies: 2
    Last Post: 12th September 2013, 22:58
  5. QMediaPlayer problems
    By alenn.masic in forum Qt Programming
    Replies: 1
    Last Post: 25th February 2013, 16:32

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.