Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
W
WordPress_SexHackMe_Plugin
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SexHackMe
WordPress_SexHackMe_Plugin
Commits
65f13d56
Commit
65f13d56
authored
Jul 13, 2022
by
Franco (nextime) Lanza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved video players and relative shortcodes
parent
b364ecb3
Changes
14
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
402 additions
and
198 deletions
+402
-198
00-videojs_player.php
deprecated/00-videojs_player.php
+0
-89
sexhack_gallery.php
deprecated/sexhack_gallery.php
+3
-3
class-shortcodes.php
includes/class-shortcodes.php
+66
-0
class-video-players.php
includes/class-video-players.php
+49
-0
functions-utils.php
includes/functions-utils.php
+27
-0
sexhackme.php
sexhackme.php
+99
-106
sexhackme.php
template/admin/sexhackme.php
+0
-0
gallery.php
templates/admin/gallery.php
+0
-0
sexhackme.php
templates/admin/sexhackme.php
+83
-0
newvideo.php
templates/newvideo.php
+0
-0
video.php
templates/video.php
+0
-0
hls.php
templates/videoplayer/hls.php
+36
-0
xr.php
templates/videoplayer/xr.php
+39
-0
videoaccess.php
templates/widgets/videoaccess.php
+0
-0
No files found.
deprecated/00-videojs_player.php
deleted
100644 → 0
View file @
b364ecb3
<?php
/**
* Copyright: 2022 (c)Franco (nextime) Lanza <franco@nexlab.it>
* License: GNU/GPL version 3.0
*
* This file is part of SexHackMe Wordpress Plugin.
*
* SexHackMe Wordpress Plugin is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
*
* SexHackMe Wordpress Plugin is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SexHackMe Wordpress Plugin. If not, see <https://www.gnu.org/licenses/>.
*/
namespace
wp_SexHackMe
;
if
(
!
class_exists
(
'SexhackVideoJSPlayer'
))
{
class
SexhackVideoJSPlayer
{
public
function
__construct
()
{
sexhack_log
(
'SexhackVideoJSPlayer() Instanced'
);
add_shortcode
(
"sexvideo"
,
array
(
$this
,
"sexvideo_shortcode"
));
}
public
function
addPlayer
(
$vurl
,
$posters
=
""
,
$projection
=
"180_LR"
)
{
$uid
=
uniqid
(
'sexvideo_'
);
//$uid = "antani";
$html
=
"<video id='
$uid
' class='video-js vjs-default-skin vjs-2-1 vjs-big-play-centered' style='width: 100%; height: 100%;' controls poster='
$posters
'>
\n
"
;
//$html.= '<script src="https://s3.deovr.com/version/1/js/bundle.js" async></script>';
//$html .= "<deo-video id='$uid'>\n";
//$html .= ' <source src="'.$vurl.'" quality="1080p" type="application/x-mpegURL">'."\n";
$html
.=
'</video>'
.
"
\n
"
;
//$html .= "</deo-video>\n";
$html
.=
"<script language='javascript'>
\n
"
;
$html
.=
"$(window).on('load', function() {\n"
;
//$html .= " videojs.log.level('debug');\n";
$html
.=
" var player = videojs('
$uid
', {\n"
;
$html
.=
" html5: {\n"
;
$html
.=
" vhs: {\n"
;
$html
.=
" overrideNative: !videojs.browser.IS_SAFARI
\n
"
;
$html
.=
" },
\n
"
;
$html
.=
" nativeAudioTracks: false,
\n
"
;
$html
.=
" nativeVideoTracks: false
\n
"
;
$html
.=
" }});
\n
"
;
$html
.=
" player.src({ src: '
$vurl
', type: 'application/x-mpegURL'});
\n
"
;
//if($_GET['antani']) {
$html
.=
" player.xr();"
;
//} else {
// $html .= " player.mediainfo = player.mediainfo || {};\n";
// $html .= " player.mediainfo.projection = '$projection';\n";
// $html .= " player.vr({projection: '$projection', debug: false, forceCardboard: true});\n";
//}
//$html .= " player.xr();";
$html
.=
'});'
.
"
\n
"
;
$html
.=
"</script>"
;
return
$html
;
}
public
function
sexvideo_shortcode
(
$attr
,
$cont
)
{
extract
(
shortcode_atts
(
array
(
"url"
=>
''
,
"posters"
=>
''
,
),
$attr
));
return
"<div class='sexvideo_videojs'>"
.
$this
->
addPlayer
(
$url
,
$posters
)
.
"</div>"
;
}
}
}
$SEXHACK_SECTION
=
array
(
'class'
=>
'SexhackVideoJSPlayer'
,
'description'
=>
'Add VideoJS Video Player'
,
'name'
=>
'sexhackme_videojs_player'
);
?>
deprecated/sexhack_gallery.php
View file @
65f13d56
...
...
@@ -182,9 +182,9 @@ if(!class_exists('SexHackVideoGallery')) {
$is_sexhack_video
=
get_query_var
(
'wooprod'
,
false
);
if
(
$is_sexhack_video
)
{
set_query_var
(
'post_type'
,
'sexhack_video'
);
if
(
file_exists
(
plugin_dir_path
(
__DIR__
)
.
'/template/'
.
$template
))
{
sexhack_log
(
"NEW TEMPLATE!: "
.
plugin_dir_path
(
__DIR__
)
.
'/template/'
.
$template
);
return
plugin_dir_path
(
__DIR__
)
.
'/template/'
.
$template
;
if
(
file_exists
(
plugin_dir_path
(
__DIR__
)
.
'/template
s
/'
.
$template
))
{
sexhack_log
(
"NEW TEMPLATE!: "
.
plugin_dir_path
(
__DIR__
)
.
'/template
s
/'
.
$template
);
return
plugin_dir_path
(
__DIR__
)
.
'/template
s
/'
.
$template
;
}
}
return
$template
;
...
...
deprecated/00-hls_player
.php
→
includes/class-shortcodes
.php
View file @
65f13d56
...
...
@@ -21,54 +21,46 @@
namespace
wp_SexHackMe
;
if
(
!
class_exists
(
'S
exhackHlsPlayer
'
))
{
class
S
exhackHlsPlayer
if
(
!
class_exists
(
'S
H_Shortcodes
'
))
{
class
S
H_Shortcodes
{
public
function
__construct
()
{
sexhack_log
(
'SexhackHlsPlayer() Instanced'
);
add_shortcode
(
"sexhls"
,
array
(
$this
,
"sexhls_shortcode"
));
}
public
static
function
init
()
{
$shortcodes
=
array
(
'sexhls'
=>
__CLASS__
.
'::video_hls'
,
'sexvideo'
=>
__CLASS__
.
'::video_xr'
,
'sh_videoxr'
=>
__CLASS__
.
'::video_xr'
,
'sh_videohls'
=>
__CLASS__
.
'::video_hls'
,
);
foreach
(
$shortcodes
as
$shortcode_tag
=>
$shortcode_func
)
{
add_shortcode
(
$shortcode_tag
,
$shortcode_func
);
}
public
function
addPlayer
(
$vurl
,
$posters
=
""
)
}
public
static
function
video_hls
(
$attr
,
$cont
)
{
$uid
=
uniqid
(
'sexhls_'
);
$html
=
'<video id="'
.
$uid
.
'" style="width: 100%; height: 100%;" controls poster="'
.
$posters
.
'"></video>'
.
"
\n
"
;
$html
.=
'<script language="javascript">'
.
"
\n
"
;
$html
.=
'$(window).on(\'load\', function() {'
.
"
\n
"
;
$html
.=
' SexHLSPlayer(\''
.
$vurl
.
'\', \''
.
$uid
.
'\');'
.
"
\n
"
;
$html
.=
' $(\'#'
.
$uid
.
'\').on(\'click\', function(){this.paused?this.play():this.pause();});'
.
"
\n
"
;
$html
.=
' Mousetrap(document.getElementById(\''
.
$uid
.
'\')).bind(\'space\', function(e, combo) { SexHLSplayPause(\''
.
$uid
.
'\'); });'
.
"
\n
"
;
$html
.=
' Mousetrap(document.getElementById(\''
.
$uid
.
'\')).bind(\'up\', function(e, combo) { SexHLSvolumeUp(\''
.
$uid
.
'\'); });'
.
"
\n
"
;
$html
.=
' Mousetrap(document.getElementById(\''
.
$uid
.
'\')).bind(\'down\', function(e, combo) { SexHLSvolumeDown(\''
.
$uid
.
'\'); });'
.
"
\n
"
;
$html
.=
' Mousetrap(document.getElementById(\''
.
$uid
.
'\')).bind(\'right\', function(e, combo) { SexHLSseekRight(\''
.
$uid
.
'\'); });'
.
"
\n
"
;
$html
.=
' Mousetrap(document.getElementById(\''
.
$uid
.
'\')).bind(\'left\', function(e, combo) { SexHLSseekLeft(\''
.
$uid
.
'\'); });'
.
"
\n
"
;
$html
.=
' Mousetrap(document.getElementById(\''
.
$uid
.
'\')).bind(\'f\', function(e, combo) { SexHLSvidFullscreen(\''
.
$uid
.
'\'); });'
.
"
\n
"
;
$html
.=
'});'
.
"
\n
"
;
$html
.=
'</script>'
.
"
\n
"
;
return
$html
;
extract
(
shortcode_atts
(
array
(
"url"
=>
''
,
"posters"
=>
''
,
),
$attr
));
return
"<div class='sexhls_video'>"
.
sh_hls_player
(
$url
,
$posters
)
.
"</div>"
;
}
public
function
sexhls_shortcode
(
$attr
,
$cont
)
public
static
function
video_xr
(
$attr
,
$cont
)
{
extract
(
shortcode_atts
(
array
(
"url"
=>
''
,
"posters"
=>
''
,
),
$attr
));
return
"<div class='sex
hls_video'>"
.
$this
->
addP
layer
(
$url
,
$posters
)
.
"</div>"
;
return
"<div class='sex
video_videojs'>"
.
sh_xr_p
layer
(
$url
,
$posters
)
.
"</div>"
;
}
}
}
}
}
$SEXHACK_SECTION
=
array
(
'class'
=>
'SexhackHlsPlayer'
,
'description'
=>
'Add HLS Video Player for progressive and live streaming support'
,
'name'
=>
'sexhackme_hls_player'
);
?>
includes/class-video-players.php
0 → 100644
View file @
65f13d56
<?php
/**
* Copyright: 2022 (c)Franco (nextime) Lanza <franco@nexlab.it>
* License: GNU/GPL version 3.0
*
* This file is part of SexHackMe Wordpress Plugin.
*
* SexHackMe Wordpress Plugin is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
*
* SexHackMe Wordpress Plugin is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SexHackMe Wordpress Plugin. If not, see <https://www.gnu.org/licenses/>.
*/
namespace
wp_SexHackMe
;
if
(
!
class_exists
(
'SH_VideoPlayer'
))
{
class
SH_VideoPlayer
{
public
static
function
addPlayer
(
$player_type
=
'hls'
,
$vurl
=
''
,
$posters
=
""
,
$projection
=
'180_LR'
)
{
$html
=
false
;
switch
(
$player_type
)
{
case
'hls'
:
$html
=
sh_get_template
(
"videoplayer/hls.php"
,
array
(
'vurl'
=>
$vurl
,
'posters'
=>
$posters
));
sexhack_log
(
$html
);
break
;
case
'xr'
:
$html
=
sh_get_template
(
"videoplayer/xr.php"
,
array
(
'vurl'
=>
$vurl
,
'posters'
=>
$posters
,
'projection'
=>
$projection
));
break
;
}
return
$html
;
}
}
}
?>
includes/functions-utils.php
View file @
65f13d56
...
...
@@ -37,6 +37,27 @@ if(!function_exists('sexhack_log')){
}
function
sh_get_template
(
$tmpl
,
$args
=
array
())
{
foreach
(
$args
as
$var
=>
$data
)
$$var
=
$data
;
if
(
file_exists
(
SH_PLUGIN_DIR_PATH
.
'templates/'
.
$tmpl
))
return
include_once
SH_PLUGIN_DIR_PATH
.
'templates/'
.
$tmpl
;
return
false
;
}
function
sh_hls_player
(
$video_url
,
$posters
=
''
)
{
echo
SH_VideoPlayer
::
addPlayer
(
'hls'
,
$video_url
,
$posters
);
}
function
sh_xr_player
(
$video_url
,
$posters
=
''
,
$projection
=
'180_LR'
)
{
echo
SH_VideoPlayer
::
addPlayer
(
'xr'
,
$video_url
,
$posters
,
$projection
);
}
function
debug_rewrite_rules
(
$matchonly
=
false
)
{
$matchonly
=
true
;
...
...
@@ -261,4 +282,10 @@ function html2text($html)
return
$plaintext
;
}
function
checkbox
(
$res
)
{
if
(
$res
==
"1"
)
return
"checked"
;
}
?>
sexhackme.php
View file @
65f13d56
This diff is collapsed.
Click to expand it.
template/admin/sexhackme.php
deleted
100644 → 0
View file @
b364ecb3
template/admin/gallery.php
→
template
s
/admin/gallery.php
View file @
65f13d56
File moved
templates/admin/sexhackme.php
0 → 100644
View file @
65f13d56
<?php
/**
* Copyright: 2022 (c)Franco (nextime) Lanza <franco@nexlab.it>
* License: GNU/GPL version 3.0
*
* This file is part of SexHackMe Wordpress Plugin.
*
* SexHackMe Wordpress Plugin is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
*
* SexHackMe Wordpress Plugin is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SexHackMe Wordpress Plugin. If not, see <https://www.gnu.org/licenses/>.
*/
?>
<div
class=
"wrap"
>
<h2>
SexHackMe Plugin Settings
</h2>
<form
method=
"post"
action=
"/wp-admin/options.php"
>
<?php
settings_fields
(
'sexhackme-settings'
);
?>
<?php
do_settings_sections
(
'sexhackme-settings'
);
?>
<table
class=
"form-table"
>
<?php
foreach
(
$this
->
SECTIONS
as
$section
)
{
?>
<tr
align=
"top"
>
<th
scope=
"row"
>
<?php
echo
$section
[
'description'
];
?>
</th>
<td>
<input
type=
"checkbox"
name=
"
<?php
echo
$section
[
'name'
];
?>
"
value=
"1"
<?php
echo
wp_SexHackMe\checkbox
(
get_option
(
$section
[
'name'
]
));
?>
/>
<br>
<?php
if
(
array_key_exists
(
'require-page'
,
$section
)
&&
(
$section
[
'require-page'
]))
{
$reqps
=
array
();
if
(
is_string
(
$section
[
'require-page'
]))
{
$reqtitle
=
"Select the base plugin module page"
;
$reqpages
=
get_posts
(
array
(
'post_type'
=>
$section
[
'require-page'
],
'parent'
=>
0
));
$reqps
[]
=
array
(
'title'
=>
$reqtitle
,
'pages'
=>
$reqpages
,
'option'
=>
$section
[
'name'
]
.
"-page"
);
}
elseif
(
is_array
(
$section
[
'require-page'
]))
{
$i
=
0
;
foreach
(
$section
[
'require-page'
]
as
$rpage
)
{
if
(
array_key_exists
(
'post_type'
,
$rpage
))
{
$reqpsa
=
array
(
'title'
=>
'Select Page'
,
'option'
=>
$section
[
'name'
]
.
"-page
$i
"
,
'pages'
=>
get_posts
(
array
(
'post_type'
=>
$rpage
[
'post_type'
],
'parent'
=>
0
)));
if
(
array_key_exists
(
'option'
,
$rpage
))
$reqpsa
[
'option'
]
=
$rpage
[
'option'
];
if
(
array_key_exists
(
'title'
,
$rpage
))
$reqpsa
[
'title'
]
=
$rpage
[
'title'
];
$reqps
[]
=
$reqpsa
;
}
$i
++
;
}
}
else
{
$reqtitle
=
"Select the base plugin module page"
;
$reqpages
=
get_pages
();
$reqps
[]
=
array
(
'title'
=>
$reqtitle
,
'pages'
=>
$reqpages
,
'option'
=>
$section
[
'name'
]
.
"-page"
);
}
foreach
(
$reqps
as
$reqarr
)
{
?>
<select
id=
"
<?php
echo
$reqarr
[
'option'
];
?>
"
name=
"
<?php
echo
$reqarr
[
'option'
];
?>
"
class=
"widefat"
>
<option
value=
"-1"
>
<?php
esc_html_e
(
'Choose...'
,
'paid-member-subscriptions'
)
?>
</option>
<?php
$opt
=
get_option
(
$reqarr
[
'option'
]);
foreach
(
$reqarr
[
'pages'
]
as
$page
)
{
echo
'<option value="'
.
esc_attr
(
$page
->
ID
)
.
'"'
;
if
(
$opt
==
$page
->
ID
)
{
echo
"selected"
;}
echo
'>'
.
esc_html
(
$page
->
post_title
)
.
' ( ID: '
.
esc_attr
(
$page
->
ID
)
.
')'
.
'</option>'
;
}
?>
</select>
<p
class=
"description"
>
<?php
echo
$reqarr
[
'title'
];
?>
</p>
<?php
}
?>
<?php
}
?>
</td>
</tr>
<?php
}
?>
</table>
<?php
submit_button
();
?>
</form>
</div>
template/newvideo.php
→
template
s
/newvideo.php
View file @
65f13d56
File moved
template/video.php
→
template
s
/video.php
View file @
65f13d56
File moved
templates/videoplayer/hls.php
0 → 100644
View file @
65f13d56
<?php
/**
* Copyright: 2022 (c)Franco (nextime) Lanza <franco@nexlab.it>
* License: GNU/GPL version 3.0
*
* This file is part of SexHackMe Wordpress Plugin.
*
* SexHackMe Wordpress Plugin is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
*
* SexHackMe Wordpress Plugin is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SexHackMe Wordpress Plugin. If not, see <https://www.gnu.org/licenses/>.
*/
$uid
=
uniqid
(
'sexhls_'
);
?>
<video
id=
"
<?php
echo
$uid
;
?>
"
style=
"width: 100%; height: 100%;"
controls
poster=
"
<?php
echo
$posters
;
?>
"
></video>
<script
language=
"javascript"
>
$
(
window
).
on
(
'load'
,
function
()
{
SexHLSPlayer
(
'
<?php
echo
$vurl
;
?>
'
,
'
<?php
echo
$uid
;
?>
'
);
$
(
'#
<?php
echo
$uid
;
?>
'
).
on
(
'click'
,
function
(){
this
.
paused
?
this
.
play
():
this
.
pause
();});
Mousetrap
(
document
.
getElementById
(
'
<?php
echo
$uid
;
?>
'
)).
bind
(
'space'
,
function
(
e
,
combo
)
{
SexHLSplayPause
(
'
<?php
echo
$uid
;
?>
'
);
});
Mousetrap
(
document
.
getElementById
(
'
<?php
echo
$uid
;
?>
'
)).
bind
(
'up'
,
function
(
e
,
combo
)
{
SexHLSvolumeUp
(
'
<?php
echo
$uid
;
?>
'
);
});
Mousetrap
(
document
.
getElementById
(
'
<?php
echo
$uid
;
?>
'
)).
bind
(
'down'
,
function
(
e
,
combo
)
{
SexHLSvolumeDown
(
'
<?php
echo
$uid
;
?>
'
);
});
Mousetrap
(
document
.
getElementById
(
'
<?php
echo
$uid
;
?>
'
)).
bind
(
'right'
,
function
(
e
,
combo
)
{
SexHLSseekRight
(
'
<?php
echo
$uid
;
?>
'
);
});
Mousetrap
(
document
.
getElementById
(
'
<?php
echo
$uid
;
?>
'
)).
bind
(
'left'
,
function
(
e
,
combo
)
{
SexHLSseekLeft
(
'
<?php
echo
$uid
;
?>
'
);
});
Mousetrap
(
document
.
getElementById
(
'
<?php
echo
$uid
;
?>
'
)).
bind
(
'f'
,
function
(
e
,
combo
)
{
SexHLSvidFullscreen
(
'
<?php
echo
$uid
;
?>
'
);
});
});
</script>
templates/videoplayer/xr.php
0 → 100644
View file @
65f13d56
<?php
/**
* Copyright: 2022 (c)Franco (nextime) Lanza <franco@nexlab.it>
* License: GNU/GPL version 3.0
*
* This file is part of SexHackMe Wordpress Plugin.
*
* SexHackMe Wordpress Plugin is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
*
* SexHackMe Wordpress Plugin is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SexHackMe Wordpress Plugin. If not, see <https://www.gnu.org/licenses/>.
*/
$uid
=
uniqid
(
'sexvideo_'
);
?>
<video
id=
'
<?php
echo
$uid
;
?>
'
class=
'video-js vjs-default-skin vjs-2-1 vjs-big-play-centered'
style=
'width: 100%; height: 100%;'
controls
poster=
'
<?php
echo
$posters
;
?>
'
>
</video>
<script
language=
'javascript'
>
$
(
window
).
on
(
'load'
,
function
()
{
var
player
=
videojs
(
'
<?php
echo
$uid
;
?>
'
,
{
html5
:
{
vhs
:
{
overrideNative
:
!
videojs
.
browser
.
IS_SAFARI
},
nativeAudioTracks
:
false
,
nativeVideoTracks
:
false
}});
player
.
src
({
src
:
'
<?php
echo
$vurl
;
?>
'
,
type
:
'application/x-mpegURL'
});
player
.
xr
();
});
</script>
template/widgets/videoaccess.php
→
template
s
/widgets/videoaccess.php
View file @
65f13d56
File moved
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