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
a285bf2c
Commit
a285bf2c
authored
Feb 27, 2013
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make windows use flash for youtube
parent
3d27a5e1
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
5 deletions
+38
-5
skproto.cpp
plugins/skproto.cpp
+11
-4
mainwin.cpp
src/mainwin.cpp
+24
-0
mainwin.h
src/mainwin.h
+1
-0
webwin.cpp
src/webwin.cpp
+2
-1
No files found.
plugins/skproto.cpp
View file @
a285bf2c
...
...
@@ -211,15 +211,22 @@ void SkyliveProtocol::processPackets()
QList
<
QString
>
paramlist
=
pkt
.
params
.
split
(
PARAM_SEPARATOR
);
if
(
paramlist
.
size
()
==
3
)
{
//SKMessage mmsg("youtubevideo");
//QString yt("http://youtube.googleapis.com/v/");
SKMessage
mmsg
(
"openurl"
);
SKMessage
mmsg
(
"youtubevideo"
);
#if defined(Q_OS_WIN)
QString
yt
(
"http://youtube.googleapis.com/v/"
);
yt
.
append
(
paramlist
[
0
]);
yt
.
append
(
"?autoplay=1&start="
);
yt
.
append
(
paramlist
[
1
]);
#else
//SKMessage mmsg("openurl");
QString
yt
(
"http://www.youtube.com/embed/"
);
yt
.
append
(
paramlist
[
0
]);
yt
.
append
(
"?html5=1&autoplay=1&start="
);
yt
.
append
(
paramlist
[
1
]);
#endif
mmsg
.
parameters
.
insert
(
"url"
,
yt
);
//
mmsg.parameters.insert("volume", paramlist[2]);
mmsg
.
parameters
.
insert
(
"volume"
,
paramlist
[
2
]);
sendMessage
(
mmsg
);
}
}
...
...
src/mainwin.cpp
View file @
a285bf2c
...
...
@@ -58,6 +58,7 @@ MainWin::MainWin(QString &htmlfile)
registerHandler
((
QString
)
"loginfailed"
,
(
SKHandlerFunction
)
&
MainWin
::
handle_loginres
);
registerHandler
((
QString
)
"openurl"
,
(
SKHandlerFunction
)
&
MainWin
::
handle_openurl
);
registerHandler
((
QString
)
"youtubevideo"
,
(
SKHandlerFunction
)
&
MainWin
::
handle_youtubevideo
);
msgsender
=
SENDER
;
...
...
@@ -128,3 +129,26 @@ void MainWin::handle_openurl(SKMessage &msg)
}
}
}
void
MainWin
::
handle_youtubevideo
(
SKMessage
&
msg
)
{
if
(
msg
.
handle
==
"youtubevideo"
)
{
if
(
msg
.
parameters
.
contains
(
"url"
))
{
std
::
cout
<<
"OPEN URL "
<<
msg
.
parameters
[
"url"
].
toStdString
()
<<
std
::
endl
;
//if(msg.parameters.contains("width")
//if(msg.parameters.contains("height);
WebWin
*
wv
=
new
WebWin
;
QWebPage
*
newWeb
=
new
QWebPage
(
wv
);
wv
->
setPage
(
newWeb
);
wv
->
setAttribute
(
Qt
::
WA_DeleteOnClose
,
true
);
wv
->
setUrl
(
QUrl
(
msg
.
parameters
[
"url"
]));
wv
->
show
();
}
}
}
src/mainwin.h
View file @
a285bf2c
...
...
@@ -63,6 +63,7 @@ class MainWin : public SkylivexWin
void
handle_asklogin
(
SKMessage
&
msg
);
void
handle_loginres
(
SKMessage
&
msg
);
void
handle_openurl
(
SKMessage
&
msg
);
void
handle_youtubevideo
(
SKMessage
&
msg
);
};
...
...
src/webwin.cpp
View file @
a285bf2c
...
...
@@ -57,7 +57,8 @@ WebWin::WebWin(QString &htmlfile)
settings
()
->
setAttribute
(
QWebSettings
::
JavascriptCanOpenWindows
,
true
);
settings
()
->
setAttribute
(
QWebSettings
::
JavascriptCanCloseWindows
,
true
);
//settings->setAttribute(QWebSettings::JavascriptCanAccessClipboard, true);
settings
()
->
setAttribute
(
QWebSettings
::
JavascriptCanAccessClipboard
,
true
);
settings
()
->
setAttribute
(
QWebSettings
::
PluginsEnabled
,
true
);
QPalette
pal
=
palette
();
pal
.
setBrush
(
QPalette
::
Base
,
Qt
::
transparent
);
...
...
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