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. To display video on qml (Qt-5)
Forum Updated to NodeBB v4.3 + New Features

To display video on qml (Qt-5)

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 2 Posters 2.2k 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
    bts-007
    wrote on last edited by
    #1

    Hai,
    display video on qml.
    video player (qt) uses videoWidget

    @
    QVideoWidget *videoWidget = new QVideoWidget;
    @

    To display the video we are using layout. Instead of displaying it in layout ,I should pass this data to qml video element and display on qml
    @
    QBoxLayout *layout = new QVBoxLayout;
    layout->addWidget(videoWidget);
    @

    1 Reply Last reply
    0
    • B Offline
      B Offline
      bjanuario
      wrote on last edited by
      #2

      You are mixing widget with QML ... you should do all on QML

      1 Reply Last reply
      0
      • B Offline
        B Offline
        bts-007
        wrote on last edited by
        #3

        bjanuario thank you for the reply. My source of video is in qt side I don't know how to display on qml side.

        1 Reply Last reply
        0
        • B Offline
          B Offline
          bjanuario
          wrote on last edited by
          #4

          Here some sample of video player on QML:

          @import QtQuick 1.0
          import QtMultimediaKit 1.1 // do not forgot to import this

          Item {
          id: videoPlayerItem
          property bool isVideoPlaying: videoPlayer.hasVideo // property to know if videoPlaying id ongoing or not
          /*
          Functions Which starts Video Playing
          /
          function playVideo(){
          videoPlayer.play()
          }
          /

          Function Which Stops Video Playing
          /
          function stopVideo(){
          videoPlayer.stop()
          }
          /

          Function Which Stops Video Playing
          /
          function pauseVideo(){
          videoPlayer.pause()
          }
          /

          Actual QML based Video Component
          */
          Video{
          id:videoPlayer
          anchors.fill: videoPlayerItem // never forget to mention the size and position
          source: "Video/Bear.wmv"
          focus: true
          }
          }@

          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