Ok, it wasn't the user agent.

parent 7ae6290e
......@@ -146,11 +146,11 @@ void MainWin::handle_youtubevideo(SKMessage &msg)
{
yt = new WebWin();
yt_is_open=true;
#if defined(Q_OS_MAC)
QWebPageForMac *newWeb = new QWebPageForMac(yt);
#else
//#if defined(Q_OS_MAC)
//QWebPageForMac *newWeb = new QWebPageForMac(yt);
//#else
QWebPage *newWeb = new QWebPage(yt);
#endif
//#endif
yt->setPage(newWeb);
yt->setAttribute(Qt::WA_DeleteOnClose, true);
......
......@@ -50,23 +50,23 @@
#define SENDER "webwin"
#if defined(Q_OS_MAC)
//#if defined(Q_OS_MAC)
/*
* For some reason youtube think that the default user agent
* on OSX doesn't support HTML5 videos,
* so, we change it faking the Linux one
*/
QWebPageForMac::QWebPageForMac(WebWin* &win) : QWebPage(win)
{
}
QString QWebPageForMac::userAgentForUrl(const QUrl &url) const
{
return "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.21 (KHTML, like Gecko) skylivex Safari/537.21";
}
#endif
//QWebPageForMac::QWebPageForMac(WebWin* &win) : QWebPage(win)
//{
//}
//
//QString QWebPageForMac::userAgentForUrl(const QUrl &url) const
//{
// return "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.21 (KHTML, like Gecko) skylivex Safari/537.21";
//}
//
//#endif
......@@ -120,11 +120,11 @@ void WebWin::closeEvent(QCloseEvent *event)
QWebView* WebWin::createWindow(QWebPage::WebWindowType type)
{
WebWin *wv = new WebWin;
#if defined(Q_OS_MAC)
QWebPageForMac *newWeb = new QWebPageForMac(wv);
#else
//#if defined(Q_OS_MAC)
//QWebPageForMac *newWeb = new QWebPageForMac(wv);
//#else
QWebPage *newWeb = new QWebPage(wv);
#endif
//#endif
wv->setPage(newWeb);
wv->setAttribute(Qt::WA_DeleteOnClose, true);
......
......@@ -52,21 +52,21 @@ typedef void (WebWin::*SKHandlerFunction)(SKMessage&);
//typedef int (WebWin::*SKHandlerFunction)(SKMessage&);
#if defined(Q_OS_MAC)
//#if defined(Q_OS_MAC)
/*
* For some reason youtube think that the default user agent
* on OSX doesn't support HTML5 videos,
* so, we change it faking the Linux one
*/
class QWebPageForMac : public QWebPage
{
Q_OBJECT
public:
QWebPageForMac(WebWin* &win);
QString userAgentForUrl(const QUrl &url) const;
};
#endif
//class QWebPageForMac : public QWebPage
//{
// Q_OBJECT
// public:
// QWebPageForMac(WebWin* &win);
// QString userAgentForUrl(const QUrl &url) const;
//};
//
//#endif
/*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment