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

Video playback unreliable on Android

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.2.0
    • 5.2.0 Beta1 , 5.2.0 RC1
    • Multimedia
    • None
    • Tested on Nexus 7 (ARM) and Asus FonPad (X86)
      Tested with Qt 5.2-beta1 and Qt 5.2 Git from last week.
    • Android
    • 2412c298d4e8c112a63eb1e3ec9b5f2789bd3eeb

    Description

      After porting an application that plays many video files in a loop from Desktop to Android I noticed, that sometimes the video stops playing on Android.

      This happens when switching files. The "state" property of the Video element is still reporting that it is playing, but nothing is drawn on the screen. Not even a black rectangle. If the Video element is in this state calling Video.play() does not make a difference.

      I managed to reproduce that behavior using the following code. The code expects two .mp4 video files inside the qml dir named "0.mp4" and "1.mp4".

      On my desktop those two files are played in a loop without end. On my Android devices it stops at some point or does not even start. The behavior is quite random so I expect it to be a timing issue.

      import QtQuick 2.0
      import QtMultimedia 5.0
      
      Rectangle {
          id: root
          width: 640
          height: 480
          color: "yellow"
      
          property int index: 0
      
          Video {
              id: vid
              source: root.index + ".mp4"
              autoLoad: true
              autoPlay: true
              anchors.fill: parent
              anchors.margins: 10
      
              onStatusChanged: {
                  if (status === MediaPlayer.EndOfMedia) {
                      root.index = (root.index + 1) % 2
                      vid.play()
                  }
              }
      
              onSourceChanged: console.log("New source: " + source)
              onErrorStringChanged: console.log("New error: " + errorString)
      
              // For debug purpose only
              MouseArea {
                  anchors.fill: parent
                  onClicked: {
                      console.log("Source: " + vid.source)
                      console.log("Error: " + vid.errorString)
                      console.log("State: " + vid.playbackState)
                      console.log("Status: " + vid.status)
                      vid.play()
                  }
              }
          }
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ylopes Yoann Lopes
            conny Cornelius Hald
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes