Fucking osx

parent 4b8371d0
......@@ -118,17 +118,20 @@ void MainWin::httpResponseFinished(QNetworkReply * reply)
{
QString urls = reply->url().toString();
//std::cout << "AAAA " << reply->error() << " URI " << urls.toStdString() << std::endl;;
#if defined(Q_OS_MAC)
if(yt_is_open && urls.contains("stream_204") && urls.contains("youtube") && urls.contains("html5=1") && yt_is_fallback==false)
#else
if(yt_is_open && urls.contains("stream_204") && urls.contains("youtube") && urls.contains("html5=1"))
#endif
{
QString urlstr = yt->url().toString();
std::cout << "NO HTML5 FOR THIS YOUTUBE VIDEO " << urlstr.toStdString() << std::endl;
std::cout << "Reopen with " << urlstr.remove("html5=1&").toStdString() << std::endl;
yt->stop();
// connect(nam, SIGNAL(finished(QNetworkReply *)), this, SLOT(httpResponseFinished(QNetworkReply *)));
//disconnect(yt->page()->networkAccessManager(), &ReferredNetworkAccessManager::finished, this, &MainWin::httpResponseFinished);
disconnect(yt->page()->networkAccessManager(), SIGNAL(finished(QNetworkReply *)), this, SLOT(httpResponseFinished(QNetworkReply *)));
#if defined(Q_OS_MAC)
yt_is_fallback=true;
#endif
yt->load(QUrl(urlstr.remove("html5=1&")));
}
}
......@@ -221,6 +224,10 @@ void MainWin::handle_youtubevideo(SKMessage &msg)
newWeb->setNetworkAccessManager(nam);
//#endif
#if defined(Q_OS_MAC)
yt_is_fallback = false;
#endif
yt->setPage(newWeb);
yt->setAttribute(Qt::WA_DeleteOnClose, true);
yt->settings()->setAttribute(QWebSettings::PluginsEnabled, true);
......
......@@ -68,6 +68,9 @@ class MainWin : public SkylivexWin
QString msgsender; // The name of the mainwindow for the IPC messages
WebWin* yt; // a pointer to the special (singleton) Youtube window (if exists)
bool yt_is_open; // a boolean to indicate if the Youtube window is open
#if defined(Q_OS_MAC)
bool yt_if_fallback;
#endif
void handle_corestarted(SKMessage &msg);
void handle_connected(SKMessage &msg);
void handle_asklogin(SKMessage &msg);
......
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