[Qt-interest] youtube videos with QT
warptrosse
warptrosse at gmail.com
Wed Mar 17 18:42:30 CET 2010
Hi all, I was trying to reproduce a youtube video on symbian OS using "qt
for symbian 4.6.2" and "symbian SDK for N97".
I try with following alternatives but It does not work... mainly I want to
reproduce rtsp videos....
does someone have any idea?...
NOTE: I can load youtube page with QTWebKit but I can't see flash videos....
seems like a problem with the plugin.
regards
//--------------------------------------------------------------------------
Phonon::MediaObject *mediaObject = new Phonon::MediaObject(this);
Phonon::VideoWidget *videoWidget = new Phonon::VideoWidget(this);
Phonon::createPath(mediaObject, videoWidget);
Phonon::AudioOutput *audioOutput =
new Phonon::AudioOutput(Phonon::VideoCategory, this);
Phonon::createPath(mediaObject, audioOutput);
QUrl url("rtsp://
v2.cache5.c.youtube.com/CkELENy73wIaOAlx6IJQhx0VPRMYESARFEIJbXYtZ29vZ2xlSARSBXdhdGNoWglDbGlja0xpbmtghN75xNCRsuxKDA==/0/0/0/video.3gp
");
mediaObject.setCurrentSource(url);
mediaObject->play();
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
QWebSettings* defaultSettings = QWebSettings::globalSettings();
defaultSettings->setAttribute(QWebSettings::AutoLoadImages, true);
defaultSettings->setAttribute(QWebSettings::JavascriptEnabled, true);
defaultSettings->setAttribute(QWebSettings::JavaEnabled, true);
defaultSettings->setAttribute(QWebSettings::PluginsEnabled, true);
QUrl page("http://www.youtube.com/watch?v=LlvUepMa31o");
ui->webView->load(page);
ui->webView->show();
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
QWebSettings* defaultSettings = QWebSettings::globalSettings();
defaultSettings->setAttribute(QWebSettings::AutoLoadImages, true);
defaultSettings->setAttribute(QWebSettings::JavascriptEnabled, true);
defaultSettings->setAttribute(QWebSettings::JavaEnabled, true);
defaultSettings->setAttribute(QWebSettings::PluginsEnabled, true);
ui->webView->setHtml("<html><head><title>hola</title></head><body><object
width=\"425\" height=\"344\"><param name=\"movie\" value=\"
http://www.youtube.com/v/LlvUepMa31o&hl=en_US&fs=1&\"></param><param
name=\"allowFullScreen\" value=\"true\"></param><param
name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"
http://www.youtube.com/v/LlvUepMa31o&hl=en_US&fs=1&\"
type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\"
allowfullscreen=\"true\" width=\"425\"
height=\"344\"></embed></object></body></html>");
ui->webView->show();
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
QUrl page("http://www.youtube.com/watch?v=LlvUepMa31o");
QDesktopServices::openUrl(page);
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
VideoPlayer *player = new VideoPlayer(Phonon::VideoCategory,
parentWidget);
connect(player, SIGNAL(finished()), player, SLOT(deleteLater()));
player->play("rtsp://
v2.cache5.c.youtube.com/CkELENy73wIaOAlx6IJQhx0VPRMYESARFEIJbXYtZ29vZ2xlSARSBXdhdGNoWglDbGlja0xpbmtghN75xNCRsuxKDA==/0/0/0/video.3gp
");
//--------------------------------------------------------------------------
--
WARPTROSSE {The knowledge of a man belongs to all the humanity}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100317/a54d5fca/attachment.html
More information about the Qt-interest-old
mailing list