Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.2.0 Beta1 , 5.2.0 RC1
-
None
-
Tested on Nexus 7 (ARM) and Asus FonPad (X86)
Tested with Qt 5.2-beta1 and Qt 5.2 Git from last week.
-
-
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() } } } }