I'm trying to make a simple videoplayer using qt. However, I can't get the videowidget example that comes with qt to work, instead I get an error: "The QMediaPlayer object does not have a valid service". I'm using windows vista. Can I get the videos to play normally, even if that example isn't working? Is there any other simple way to test playing videos? Or is this a problem with qt?
How to play video with qt5
4.3k Views Asked by user2942080 At
2
There are 2 best solutions below
0

Check this VideoWidget I created: https://github.com/MaximAlien/VideoWidget. The main thing here is that the video should be in web and QMediaPlayer handles everything for you. Example works with Qt 5 and higher.
This is expected on your Vista, unfortunately. See the relevant post from the maintainer:
... in the following report on the Qt issue tracker:
Qt 5.0 and QMediaPlayer failure on Windows XP
The steps to build it on your would be:
Please make sure qmake is properly in your PATH before doing this.