Is there a way in Qt to force QMediaPlayer to buffer a file without playing it?

When a file is loaded into a QMediaPlayer instance QMediaPlayer it will not automatically buffer the file. MediaStatus remains NoMedia until you start playing the file using play() , only after which it will be BufferedMedia . I cannot find any way in the documentation to make the player buffer the file without playing it - is there a way to do this?

Now I plan to turn it off, play the file, then stop it again and turn it off, but it makes me feel dirty. Surely there is a better way to do this?

This is necessary, by the way, because I cannot get duration until the file is buffered, and I need duration to select position in the track to start playing from.

thanks

+7
qt qmediaplayer
source share

No one has answered this question yet.

See similar questions:

0
[Windows, Qt5, QMediaPlayer, QMediaPlaylist]: a small black screen when changing the current video source

or similar:

6
How to play audio and delete a file in QMediaPlayer?
3
Play mp3 file in a resource using QMediaPlayer
3
Unable to play movie using QMediaPlayer
2
Sound waveform Qt5
2
Packaging mp3 files in Qt application
one
Changin mp3 speed in Qt and C ++ [QMediaPlayer]
0
QMediaPlayer - play music on YouTube
0
Is there an easy way to play mp3 file
0
QMediaPlayer cannot play MP3
0
QMediaPlayer - play sound loaded into memory

All Articles