Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-109960

[WMF] Unable to show video preview (first frame)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.3.2, 6.4.2, 6.5.0 Beta1
    • Multimedia
    • None
    • Windows

    Description

      It's very common use-case when one need to load a video and just show the first frame as a preview, but do not play it automatically. There is a know trick for this - just call play()/pause() right when media has been loaded. It perfectly works on macOS (and probably on other backends), but doesn't work on Windows.

      Code sample:

      import QtQuick
      import QtMultimedia
      
      Window {
          width: 640
          height: 480
          visible: true
      
          VideoOutput {
              id: vo
              anchors.fill: parent
      
              MediaPlayer {
                  id: mp
                  videoOutput: vo
                  source: 'qrc:///sample_640x360.mp4'
                  Component.onCompleted: {
                      // play/pause trick to display first frame
                      play()
                      pause()
                  }
              }
      
              TapHandler {
                  onTapped: mp.play()
              }
          }
      }
      

      Just build and run simple example: MediaPlayerIssue.zip
      Actual result: nothing is displayed
      Expected result: first video frame is displayed, video is paused

      This looks as specific issue for WMF backend.

      Attachments

        1. MediaPlayerIssue.zip
          562 kB
          Vladimir Belyavsky
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            padubsky Pavel Dubsky
            studiosus Vladimir Belyavsky
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes