video player with qt phonon (using python)

走远了吗. 提交于 2020-02-06 05:00:54

问题


I am working on Windows xp and am trying to get a simple video player running.

I am trying to use Phonon::VideoPlayer module for this. I am connecting the signal as

connect(self.player,SIGNAL("finished()"),self.player.deleteLater)

and then , when the Play button is pressed, it makes the following call:

self.player.play(Phonon.MediaSource("C:\\vid.mp4"))

But, this doesn't display the video in the video player widget. Neither can I hear audio. Can anyone help??

I tried using different video file formats but no luck.


回答1:


Try writing

self.player.play(Phonon.MediaSource("C:\\vid.mp4"))

to escape the \




回答2:


Phonon::MediaSource mediaSource= Phonon::MediaSource("C:\\vid.mp4");

Try creating media sources like this and also other Phonon objects..



来源:https://stackoverflow.com/questions/2454560/video-player-with-qt-phonon-using-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!