Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. I want to play a video but it is showing invalid property.
Forum Updated to NodeBB v4.3 + New Features

I want to play a video but it is showing invalid property.

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
10 Posts 4 Posters 598 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.
  • B Offline
    B Offline
    Biswa
    wrote on last edited by
    #1

    Screenshot from 2024-03-27 12-25-42.png

    sierdzioS MarkkyboyM Ronel_qtmasterR 3 Replies Last reply
    0
    • B Biswa

      Screenshot from 2024-03-27 12-25-42.png

      sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      @Biswa but does it work when you run the application? Qt Creator often gets confused with QML properties and reports errors which are not real.

      (Z(:^

      1 Reply Last reply
      0
      • B Biswa

        Screenshot from 2024-03-27 12-25-42.png

        MarkkyboyM Offline
        MarkkyboyM Offline
        Markkyboy
        wrote on last edited by
        #3

        @Biswa - The problem is clear, console is telling you that you have not included MediaPlayer in your code.

        Look at the examples given by Qt for MediaPlayerQML; https://doc.qt.io/qt-5/qml-qtmultimedia-mediaplayer.html

        Don't just sit there standing around, pick up a shovel and sweep up!

        I live by the sea, not in it.

        1 Reply Last reply
        1
        • B Biswa

          Screenshot from 2024-03-27 12-25-42.png

          Ronel_qtmasterR Offline
          Ronel_qtmasterR Offline
          Ronel_qtmaster
          wrote on last edited by
          #4

          @Biswa The error in application output say Media player is not defined.So maybe your code does not load QtMultimedia Module properly. You will need to check the import of Qt Multimedia

          1 Reply Last reply
          0
          • B Offline
            B Offline
            Biswa
            wrote on last edited by
            #5

            Dear all, below i have attached output screenshot but why "autoPlay and autoLoad" is showing Invalid property . Screenshot from 2024-03-27 14-29-26.png

            sierdzioS 1 Reply Last reply
            0
            • B Biswa

              Dear all, below i have attached output screenshot but why "autoPlay and autoLoad" is showing Invalid property . Screenshot from 2024-03-27 14-29-26.png

              sierdzioS Offline
              sierdzioS Offline
              sierdzio
              Moderators
              wrote on last edited by
              #6

              @Biswa Are you using Qt 5? Your import statements suggest you do.

              But autoPlay is not available in Qt 6 so perhaps you are trying to use Qt6 and that is why it fails?

              (Z(:^

              B 1 Reply Last reply
              2
              • sierdzioS sierdzio

                @Biswa Are you using Qt 5? Your import statements suggest you do.

                But autoPlay is not available in Qt 6 so perhaps you are trying to use Qt6 and that is why it fails?

                B Offline
                B Offline
                Biswa
                wrote on last edited by
                #7

                @sierdzio am using qt5

                Ronel_qtmasterR 1 Reply Last reply
                0
                • B Biswa

                  @sierdzio am using qt5

                  Ronel_qtmasterR Offline
                  Ronel_qtmasterR Offline
                  Ronel_qtmaster
                  wrote on last edited by
                  #8

                  @Biswa are you using qt5.15?

                  B 1 Reply Last reply
                  0
                  • Ronel_qtmasterR Ronel_qtmaster

                    @Biswa are you using qt5.15?

                    B Offline
                    B Offline
                    Biswa
                    wrote on last edited by
                    #9

                    @Ronel_qtmaster yes

                    sierdzioS 1 Reply Last reply
                    0
                    • B Biswa

                      @Ronel_qtmaster yes

                      sierdzioS Offline
                      sierdzioS Offline
                      sierdzio
                      Moderators
                      wrote on last edited by
                      #10

                      @Biswa it should work, the property is clearly there: https://doc.qt.io/qt-5/qml-qtmultimedia-video.html#autoPlay-prop

                      Anyway, as a workaround you can remove that line and trigger the play manually instead (for example using Component.onCompleted slot).

                      (Z(:^

                      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