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
e08f871b
Commit
e08f871b
authored
Feb 28, 2013
by
Franco (nextime) Lanza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ok, it wasn't the user agent.
parent
7ae6290e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
29 deletions
+29
-29
mainwin.cpp
src/mainwin.cpp
+4
-4
webwin.cpp
src/webwin.cpp
+15
-15
webwin.h
src/webwin.h
+10
-10
No files found.
src/mainwin.cpp
View file @
e08f871b
...
...
@@ -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
);
...
...
src/webwin.cpp
View file @
e08f871b
...
...
@@ -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
);
...
...
src/webwin.h
View file @
e08f871b
...
...
@@ -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
/*
...
...
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