Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Debugging QMediaPlaylist::load(QUrl)
Forum Updated to NodeBB v4.3 + New Features

Debugging QMediaPlaylist::load(QUrl)

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 1.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Hazzl
    wrote on last edited by Hazzl
    #1

    Hi,

    I'm trying to play a web radio stream. These streams are distributed in playlist files. I am successful if I download the playlist manually and directly add the media URL.

    I've subclassed a QMediaPlayer and I'm trying to load the playlists like this

    url=QUrl("http://stream.station.com/live.m3u");
    playlist->load(url);
    connect(playlist, &QMediaPlaylist::loaded, this, &QMediaPlayer::play);
    

    However, I'm having trouble parsing the playlist in QMediaPlaylist::load. I see in GammaRay that the loadFailed() signal fires. I also see that a QPlaylistFileParser object fires the same loadFailed signal with an ParserError as a QString argument. How do I access this ParserError? QPlaylistFileParser has no officially documented interface

    Regards
    Felix

    jsulmJ 1 Reply Last reply
    0
    • C Offline
      C Offline
      Charlie_Hdz
      wrote on last edited by
      #2

      Hi @Hazzl,

      Are you using QtCreator IDE to develop? If so, Had you tried to get help from the interface?

      If QMediaPlayer is open source, Had you see any repository of this class?

      Anyways, if they are string, Can you get the value of that string?

      Thank you.

      Kind Regards,
      Enrique Hernandez
      gearstech.com.mx
      chernandez@gearstech.com.mx

      1 Reply Last reply
      0
      • H Hazzl

        Hi,

        I'm trying to play a web radio stream. These streams are distributed in playlist files. I am successful if I download the playlist manually and directly add the media URL.

        I've subclassed a QMediaPlayer and I'm trying to load the playlists like this

        url=QUrl("http://stream.station.com/live.m3u");
        playlist->load(url);
        connect(playlist, &QMediaPlaylist::loaded, this, &QMediaPlayer::play);
        

        However, I'm having trouble parsing the playlist in QMediaPlaylist::load. I see in GammaRay that the loadFailed() signal fires. I also see that a QPlaylistFileParser object fires the same loadFailed signal with an ParserError as a QString argument. How do I access this ParserError? QPlaylistFileParser has no officially documented interface

        Regards
        Felix

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @Hazzl Did you try to print out http://doc.qt.io/qt-5/qmediaplaylist.html#errorString ?

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        1
        • H Offline
          H Offline
          Hazzl
          wrote on last edited by
          #4

          Thanks @jsulm , printing the ErrorString provides a clue: I get an empty file error. Hmmm... Something seems to go wrong when retrieving the playlist from the remote server. Using curl with the provided URL does work, so that's not the problem. I'll try to dig deeper...

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved