PDA

View Full Version : Qt video gui sample code



sanda199
24th January 2013, 04:06
Hi everyone, I am newbie in Qt. I would like to display video in my qt gui. How can i display it? If you have any example concerned with that, pls kindly share me. Thanks millions.

Lesiok
24th January 2013, 06:35
Use Phonon-VideoPlayer.

sanda199
24th January 2013, 07:18
I know I need to use phonon-videoplayer. But I need to study some examples regarding to it. I created one gui with phonon videoplayer. But every time i need to load my video and play. But it didn't show in GUI form. it only show in designer form. For me, I want to click button to play. So that's y i need some examples to study. thanks.

Salads
24th January 2013, 08:59
Well I'm a beginner too and haven't done too much exploring in Qt yet, but here goes:

In the link (http://qt-project.org/doc/qt-4.8/phonon-videoplayer.html) Lesiok provided, it gives you all the definitions for public slots and such in that page.
So I imagine that if you want a play button, you would use the play() function, with a button connected with a clicked() SIGNAL to a acceptable SLOT. Now it seems to me that the play() and pause() are completely separate, so either make two different buttons for each of them or one that switches between pause() and play(). I would try using the isPaused() and isPlaying() bools if I wanted to do that.

sanda199
24th January 2013, 10:00
Well I'm a beginner too and haven't done too much exploring in Qt yet, but here goes:

In the link (http://qt-project.org/doc/qt-4.8/phonon-videoplayer.html) Lesiok provided, it gives you all the definitions for public slots and such in that page.
So I imagine that if you want a play button, you would use the play() function, with a button connected with a clicked() SIGNAL to a acceptable SLOT. Now it seems to me that the play() and pause() are completely separate, so either make two different buttons for each of them or one that switches between pause() and play(). I would try using the isPaused() and isPlaying() bools if I wanted to do that.




Thanks for your information. Thanks :)

Lesiok
24th January 2013, 14:39
You have an examples in directory QT_DIR\demos\qmediaplayer and QT_DIR\examples\multimedia where QT_DIR is Yours Qt installation directory.