Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
skylivex
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
astronomy
skylivex
Commits
0c9d421e
Commit
0c9d421e
authored
Mar 05, 2013
by
Franco (nextime) Lanza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed the flash fallback for non existent youtube html5 videos
parent
95bf16aa
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
1 deletion
+35
-1
mainwin.cpp
src/mainwin.cpp
+18
-0
mainwin.h
src/mainwin.h
+2
-0
webwin.cpp
src/webwin.cpp
+13
-1
webwin.h
src/webwin.h
+2
-0
No files found.
src/mainwin.cpp
View file @
0c9d421e
...
...
@@ -43,6 +43,7 @@
#include <QString>
#include <QPalette>
#include <QDragMoveEvent>
#include <QNetworkReply>
#include <iostream>
#include "ipcmsg.h"
#include "jsbridge.h"
...
...
@@ -113,6 +114,20 @@ MainWin::~MainWin()
}
void
MainWin
::
httpResponseFinished
(
QNetworkReply
*
reply
)
{
QString
urls
=
reply
->
url
().
toString
();
//std::cout << "AAAA " << reply->error() << " URI " << urls.toStdString() << std::endl;;
if
(
yt_is_open
&&
urls
.
contains
(
"stream_204"
)
&&
urls
.
contains
(
"youtube"
)
&&
urls
.
contains
(
"html5=1"
))
{
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
->
load
(
QUrl
(
urlstr
.
remove
(
"html5=1&"
)));
}
}
void
MainWin
::
handle_corestarted
(
SKMessage
&
msg
)
{
msg
.
handle
=
"connectTelescopes"
;
...
...
@@ -194,6 +209,9 @@ void MainWin::handle_youtubevideo(SKMessage &msg)
QWebPage
*
newWeb
=
new
QWebPage
(
yt
);
//ReferredNetworkAccessManager nam;
ReferredNetworkAccessManager
*
nam
=
new
ReferredNetworkAccessManager
();
connect
(
nam
,
SIGNAL
(
finished
(
QNetworkReply
*
)),
this
,
SLOT
(
httpResponseFinished
(
QNetworkReply
*
)));
newWeb
->
setNetworkAccessManager
(
nam
);
//#endif
...
...
src/mainwin.h
View file @
0c9d421e
...
...
@@ -45,6 +45,7 @@
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QIODevice>
#include <QNetworkReply>
#include <ipcmsg.h>
#include "webwin.h"
#include "jsbridge.h"
...
...
@@ -76,6 +77,7 @@ class MainWin : public SkylivexWin
void
handle_closeyoutube
(
SKMessage
&
msg
);
public
slots
:
void
ytclosesignal
();
// This slot is needed to close the special youtube window
void
httpResponseFinished
(
QNetworkReply
*
reply
);
};
...
...
src/webwin.cpp
View file @
0c9d421e
...
...
@@ -43,6 +43,7 @@
#include <QString>
#include <QPalette>
#include <QDragMoveEvent>
//#include <QNetworkReply>
#include <iostream>
#include "ipcmsg.h"
#include "jsbridge.h"
...
...
@@ -70,6 +71,8 @@
WebWin
::
WebWin
(
QString
&
htmlfile
)
:
QWebView
(
0
)
{
...
...
@@ -112,6 +115,15 @@ WebWin::~WebWin()
}
/*
void WebWin::httpResponseFinished(QNetworkReply * reply)
{
if(reply->error()==204)
std::cout << "NO FLASH!" << std::endl;
}
}
*/
void
WebWin
::
closeEvent
(
QCloseEvent
*
event
)
{
emit
closingWindow
();
...
...
@@ -126,6 +138,7 @@ QWebView* WebWin::createWindow(QWebPage::WebWindowType type)
QWebPage
*
newWeb
=
new
QWebPage
(
wv
);
//#endif
//connect(newWeb->networkAccessManager(), SIGNAL(finished(QNetworkReply *)), this, SLOT(httpResponseFinished(QNetworkReply *)));
wv
->
setPage
(
newWeb
);
wv
->
setAttribute
(
Qt
::
WA_DeleteOnClose
,
true
);
if
(
type
==
QWebPage
::
WebModalDialog
)
...
...
@@ -138,7 +151,6 @@ QWebView* WebWin::createWindow(QWebPage::WebWindowType type)
SKMessage
msg
(
"newwindow"
,
qobject_cast
<
SkylivexWin
*>
(
wv
));
sendMessage
(
msg
);
wv
->
show
();
return
wv
;
}
...
...
src/webwin.h
View file @
0c9d421e
...
...
@@ -42,6 +42,7 @@
#include <QHash>
#include <QString>
#include <QObject>
//#include <QNetworkReply>
#include <ipcmsg.h>
#include "jsbridge.h"
...
...
@@ -102,6 +103,7 @@ class WebWin : public QWebView
public
slots
:
void
msgFromCore
(
SKMessage
&
msg
);
//void httpResponseFinished(QNetworkReply * reply);
signals
:
void
putMessage
(
SKMessage
&
msg
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment