Embed YouTube Video in QWebView

From Qt Wiki
Revision as of 15:24, 14 January 2015 by Maintenance script (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

English | Español | Български | 日本語 | Português |

Embed YouTube Video in QWebView

Small snippet showing how to embed a YouTube video in a QWebView [qt.io]. This also demonstrates Qt support for flash.
First create a Qt Gui Application using Qt Creator and add a QWebView to it.

Now add network and webkit support to your .pro file

Now add this in your mainwindow.cpp file

You should be able to load the webpage with the embedded video in it.
You could also embed this video only in an object tag in a local html file and just point the url to this local file.

Detailed article on using flash with Qt can be found here [blog.forwardbias.in]

Categories: