play a video from youtube
Hi,
This is my first try with Phonon ... so be patient :o
I wrote this code:
Code:
#include <QApplication>
#include <QBoxLayout>
#include <QWidget>
#include <QUrl>
#include <Phonon>
int main(int argc, char *argv[]){
app.setApplicationName("myApp");
Phonon::VideoPlayer *myPlayer= new Phonon::VideoPlayer(Phonon::VideoCategory, video);
layout->addWidget(myPlayer);
window->setLayout(layout);
QUrl url
("http://www.youtube.com/watch?v=p916yeFa2Xk");
myPlayer->play(url);
window->show();
return app.exec();
}
What's missing so that i can watch this beautiful video?
Thanks
Re: play a video from youtube
You need to create a Media Object from the URL. Instead of :
myPlayer->play(url);
Try this:
Phonon::MediaObject obj(url);
myPlayer->play(obj);
Re: play a video from youtube
Hi
I hace implemented this code ... But Phonon reference not found in header section in main file..
Plz Help