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

[WASM] Multiple VideoOutputs cannot play independently

    XMLWordPrintable

Details

    • WebAssembly
    • 680304a0e (dev), 7ec4d1b9f (6.8), 6a866de06 (6.7)

    Description

      Code

      import QtQuick
      import QtMultimedia
      import QtQuick.Controls.Basic
      
      Window {
          width: 640
          height: 480
          visible: true
      
          component Player: VideoOutput {
              id: videoOutput
      
              Button {
                  text: player.playing ? "Stop" : "Play"
                  onClicked: {
                      if (player.source == '')
                          player.source = "video.mp4"
      
                      if (player.playing)
                          player.stop()
                      else
                          player.play()
                  }
              }
              MediaPlayer {
                  id: player
                  videoOutput: videoOutput
              }
          }
      
          Column {
              anchors.fill: parent
              Player {
                  width: parent.width
                  height: parent.height / 3
              }
              Player {
                  width: parent.width
                  height: parent.height / 3
              }
              Player {
                  width: parent.width
                  height: parent.height / 3
              }
          }
      }
      

       

      Steps to reproduce

      1. Build and run the attached project
      2. Wait a few seconds, then click the top button
      3. Wait a few seconds, then click the middle button
      4. Wait a few seconds, then click the bottom button
      5. Reload the page, and repeat steps #2-#4 in the reverse order

       

      Expected outcomes (Windows)
      All 3 videos play independently all the time

       

      Actual outcomes (WASM)
      All 3 audio streams play independently as expected, but...

      • In the "forward" test, all 3 video outputs display the same thing as the top frame.
      • In the "reverse" test, the bottom 2 frames show nothing. Only the top frame plays as expected.

       

      Google Chrome 127.0.6533.72 reports the following exception in the "reverse" test (but Mozilla Firefox 128.0 doesn't):

      Uncaught DOMException: Failed to construct 'VideoFrame': Invalid source state
          at methodCaller<(emscripten::val) => emscripten::val> (eval at newFunc (http://localhost:30000/appMultiVideoStudy.js:5570:22), <anonymous>:5:12)
          at __emval_call (http://localhost:30000/appMultiVideoStudy.js:6175:9)
          at appMultiVideoStudy.wasm.emscripten::val emscripten::val::new_<emscripten::val&>(emscripten::val&) const (http://localhost:30000/appMultiVideoStudy.wasm:wasm-function[6974]:0x28b844)
          at appMultiVideoStudy.wasm.QWasmVideoOutput::videoFrameCallback(emscripten::val, emscripten::val) (http://localhost:30000/appMultiVideoStudy.wasm:wasm-function[35647]:0xb478f4)
          at appMultiVideoStudy.wasm.emscripten::internal::Invoker<void, emscripten::val, emscripten::val>::invoke(void (*)(emscripten::val, emscripten::val), emscripten::_EM_VAL*, emscripten::_EM_VAL*) (http://localhost:30000/appMultiVideoStudy.wasm:wasm-function[34314]:0xad44d4)
          at qtVideoFrameTimerCallback (eval at newFunc (http://localhost:30000/appMultiVideoStudy.js:5570:22), <anonymous>:9:1)
      methodCaller<(emscripten::val) => emscripten::val> @ VM63:5
      __emval_call @ appMultiVideoStudy.js:6175
      $emscripten::val emscripten::val::new_<emscripten::val&>(emscripten::val&) const @ appMultiVideoStudy.wasm:0x28b844
      $QWasmVideoOutput::videoFrameCallback(emscripten::val, emscripten::val) @ appMultiVideoStudy.wasm:0xb478f4
      $emscripten::internal::Invoker<void, emscripten::val, emscripten::val>::invoke(void (*)(emscripten::val, emscripten::val), emscripten::_EM_VAL*, emscripten::_EM_VAL*) @ appMultiVideoStudy.wasm:0xad44d4
      qtVideoFrameTimerCallback @ VM39:9
      

      Attachments

        1. error.log
          47 kB
        2. MultiVideoStudy.zip
          893 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            lpotter Lorn Potter
            skoh-qt Sze Howe Koh
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes