Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
5.15.8, 5.15.2
-
iOS 14, 15
Description
When setting QAbstractVideoSurface inheriting class(PlayerVideoSurface) like this.
QUrl url("file:///video.mp4"); // or http resource auto surface = new PlayerVideoSurface; auto player = new QMediaPlayer; player->setVideoOutput(surface); player->setMedia(url); player->play();
For desktop(Windows, Linux, macOS) and Android, it works as expected, that is
after video player status change to LoadingMedia and then to BufferedMedia to finally become EndOfMedia, it can be seen that there are QMediaPlayer::positionChanged signals emitted and frames are presented in the present function of a PlayerVideoSurface.
// Log from the sample project on macOS
positionChanged: 0 mediaStatusChanged: QMediaPlayer::LoadingMedia stateChanged: QMediaPlayer::PlayingState positionChanged: 0 positionChanged: 0 positionChanged: 0 positionChanged: 0 videoAvailableChanged: true mediaStatusChanged: QMediaPlayer::BufferedMedia start present, frame valid: true present, frame valid: true present, frame valid: true
However, in iOS, PlayerVideoSurface::start() is never called and no frames are presented.
There is no error reported. It happens with both local and/or remote resource. The video is still playable.
// Log from iOS
stale focus object 0x0 , doing manual update
positionChanged: 0
mediaStatusChanged: QMediaPlayer::LoadingMedia
stateChanged: QMediaPlayer::PlayingState
positionChanged: 0
positionChanged: 0
positionChanged: 0
positionChanged: 0
videoAvailableChanged: true
mediaStatusChanged: QMediaPlayer::BufferedMedia
positionChanged: 0
positionChanged: 0
positionChanged: 1
positionChanged: 2
positionChanged: 248
positionChanged: 1246
positionChanged: 2248
How to reproduce
https://github.com/bialasjaroslaw/qmediaplayer