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. Can QMediaPlayer play a media through ftp ?

Can QMediaPlayer play a media through ftp ?

Scheduled Pinned Locked Moved General and Desktop
6 Posts 2 Posters 2.0k 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.
  • V Offline
    V Offline
    vpwal
    wrote on last edited by
    #1

    Hi all,

    I am trying to play a media

    @
    QString strFileName = "ftp://wpglinux:123456@192.168.100.61:" +QString().setNum(9954)+ //D:/VideosSongs/ims.mov";
    pvMediaPlayer->setMedia(QUrl::fromLocalFile(strFileName));
    @

    can i play?

    1 Reply Last reply
    0
    • raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      i think so ... QNetworkAccesManager has basic FTP support.
      But beside that, why don't you just try it?? You already posted the code to use?!

      Edit:
      @QUrl::fromLocalFile(strFileName)@ is wrong. Use @QUrl(strFileName)@ or @QUrl::fromUserInput(strfFileName)@

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • V Offline
        V Offline
        vpwal
        wrote on last edited by
        #3

        Hi.
        i am using
        @
        QString strFileName = "ftp://wpglinux:123456@192.168.100.61:" +QString().setNum(9954)+ "//D:/VideosSongs/ims.mov";
        QUrl url(strFileName);
        url.setScheme("ftp");
        // url.setUrl(strFileName,QUrl::TolerantMode);
        qDebug()<<"Path : "<< strFileName;
        //pvMediaPlayer->setMedia(QUrl::fromLocalFile(strFileName));
        pvMediaPlayer->setMedia(QUrl::fromUserInput(strFileName));@

        giving -->

        Unsupported url scheme!

        1 Reply Last reply
        0
        • raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by
          #4

          then it seems it is not supported (yet) ;)

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          1 Reply Last reply
          0
          • V Offline
            V Offline
            vpwal
            wrote on last edited by
            #5

            thanks...
            BTW ...Is there any way ?

            1 Reply Last reply
            0
            • raven-worxR Offline
              raven-worxR Offline
              raven-worx
              Moderators
              wrote on last edited by
              #6

              I haven tried it so far but this may be possible:

              use QnetworkAccessManager to download file form your url using it's get() method

              the returned QNetworkReply (subclass of QIODevice) can be set to QMediaPlayer::setMedia(QMediaContent(), reply);

              Note that streaming is only supported on windows and unix so far - with the "shipped multimedia backends":http://qt-project.org/wiki/Qt_Multimedia_Backends.

              Edit: just found "this post":http://qt-project.org/forums/viewthread/34146, which doesn't look promising. But still you can try, maybe it was already fixed in the meantime.

              You may also pass QMediaPlayer::StreamPlayback in the flags of QMediaPlayer's constructor

              --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
              If you have a question please use the forum so others can benefit from the solution in the future

              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