mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 09:49:28 +02:00
Categories page
PlayO page
This commit is contained in:
parent
83d89c98b6
commit
546c3e6761
14 changed files with 415 additions and 79 deletions
|
@ -74,6 +74,7 @@ Options All -Indexes
|
|||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine on
|
||||
#VideoHLS for DRM
|
||||
RewriteRule ^playLink/?$ view/modePlayLink.php [QSA]
|
||||
RewriteRule ^videos/([^/]+)/(.*).key$ plugin/VideoHLS/downloadProtection.php?filename=$1&key=$2 [QSA]
|
||||
|
||||
RewriteRule glyphicons-halflings-regular(.+)$ view/bootstrap/fonts/glyphicons-halflings-regular$1 [NC,L]
|
||||
|
@ -196,6 +197,7 @@ Options All -Indexes
|
|||
RewriteRule ^categories.json$ objects/categories.json.php [NC,L]
|
||||
RewriteRule ^addNewCategory$ objects/categoryAddNew.json.php [NC,L]
|
||||
RewriteRule ^deleteCategory$ objects/categoryDelete.json.php [NC,L]
|
||||
RewriteRule ^listCategories$ view/listCategories.php [NC,L]
|
||||
|
||||
#manager plugin
|
||||
RewriteRule ^plugins$ view/managerPlugins.php [NC,L]
|
||||
|
|
|
@ -556,7 +556,6 @@ class Category {
|
|||
return self::getChildCategories($row['id']);
|
||||
}
|
||||
|
||||
|
||||
static function getTotalFromCategory($categories_id, $showUnlisted = false, $getAllVideos = false, $renew = false) {
|
||||
$videos = self::getTotalVideosFromCategory($categories_id, $showUnlisted, $getAllVideos, $renew);
|
||||
$lives = self::getTotalLivesFromCategory($categories_id, $showUnlisted, $renew);
|
||||
|
@ -565,9 +564,31 @@ class Category {
|
|||
return array('videos' => $videos, 'lives' => $lives, 'livelinks' => $livelinkss, 'total' => $total);
|
||||
}
|
||||
|
||||
static function getTotalFromChildCategory($categories_id, $showUnlisted = false, $getAllVideos = false, $renew = false) {
|
||||
|
||||
$categories = self::getChildCategories($categories_id);
|
||||
$array = array('videos' => 0, 'lives' => 0, 'livelinks' => 0, 'total' => 0);
|
||||
foreach ($categories as $value) {
|
||||
$totals = self::getTotalFromCategory($categories_id, $showUnlisted, $getAllVideos, $renew);
|
||||
$array = array(
|
||||
'videos' => $array['videos'] + $totals['videos'],
|
||||
'lives' => $array['lives'] + $totals['lives'],
|
||||
'livelinks' => $array['livelinks'] + $totals['livelinks'],
|
||||
'total' => $array['total'] + $totals['total']);
|
||||
$totals = self::getTotalFromChildCategory($value['id'], $showUnlisted, $getAllVideos, $renew);
|
||||
$array = array(
|
||||
'videos' => $array['videos'] + $totals['videos'],
|
||||
'lives' => $array['lives'] + $totals['lives'],
|
||||
'livelinks' => $array['livelinks'] + $totals['livelinks'],
|
||||
'total' => $array['total'] + $totals['total']);
|
||||
}
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
static function getTotalVideosFromCategory($categories_id, $showUnlisted = false, $getAllVideos = false, $renew = false) {
|
||||
global $global, $config;
|
||||
if (true || $renew || empty($_SESSION['user']['sessionCache']['categoryTotal'][$categories_id][intval($showUnlisted)][intval($getAllVideos)]['videos'])) {
|
||||
if ($renew || empty($_SESSION['user']['sessionCache']['categoryTotal'][$categories_id][intval($showUnlisted)][intval($getAllVideos)]['videos'])) {
|
||||
$sql = "SELECT count(id) as total FROM videos v WHERE 1=1 AND categories_id = ? ";
|
||||
|
||||
if (User::isLogged()) {
|
||||
|
@ -593,6 +614,58 @@ class Category {
|
|||
return $_SESSION['user']['sessionCache']['categoryTotal'][$categories_id][intval($showUnlisted)][intval($getAllVideos)]['videos'];
|
||||
}
|
||||
|
||||
static function getLatestVideoFromCategory($categories_id, $showUnlisted = false, $getAllVideos = false) {
|
||||
global $global, $config;
|
||||
$sql = "SELECT * FROM videos v WHERE 1=1 AND (categories_id = ? OR categories_id IN (SELECT id from categories where parentId = ?))";
|
||||
|
||||
if (User::isLogged()) {
|
||||
$sql .= " AND (v.status IN ('" . implode("','", Video::getViewableStatus($showUnlisted)) . "') OR (v.status='u' AND v.users_id ='" . User::getId() . "'))";
|
||||
} else {
|
||||
$sql .= " AND v.status IN ('" . implode("','", Video::getViewableStatus($showUnlisted)) . "')";
|
||||
}
|
||||
if (!$getAllVideos) {
|
||||
$sql .= Video::getUserGroupsCanSeeSQL();
|
||||
}
|
||||
$sql .= "ORDER BY created DESC LIMIT 1";
|
||||
//var_dump($sql, $categories_id);
|
||||
$res = sqlDAL::readSql($sql, "ii", array($categories_id, $categories_id));
|
||||
$result = sqlDAL::fetchAssoc($res);
|
||||
sqlDAL::close($res);
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
static function getLatestLiveFromCategory($categories_id) {
|
||||
if (!AVideoPlugin::isEnabledByName("Live")) {
|
||||
return array();
|
||||
}
|
||||
global $global, $config;
|
||||
$sql = "SELECT * FROM live_transmitions lt LEFT JOIN live_transmitions_history lth ON lt.users_id = lth.users_id "
|
||||
. " WHERE 1=1 AND (categories_id = ? OR categories_id IN (SELECT id from categories where parentId = ?))";
|
||||
|
||||
$sql .= "ORDER BY lth.created DESC LIMIT 1";
|
||||
//var_dump($sql, $categories_id);
|
||||
$res = sqlDAL::readSql($sql, "ii", array($categories_id, $categories_id));
|
||||
$result = sqlDAL::fetchAssoc($res);
|
||||
sqlDAL::close($res);
|
||||
return $result;
|
||||
}
|
||||
|
||||
static function getLatestLiveLinksFromCategory($categories_id) {
|
||||
if (AVideoPlugin::isEnabledByName("LiveLinks")) {
|
||||
return array();
|
||||
}
|
||||
global $global, $config;
|
||||
$sql = "SELECT * FROM livelinks WHERE 1=1 AND (categories_id = ? OR categories_id IN (SELECT id from categories where parentId = ?))";
|
||||
|
||||
$sql .= "ORDER BY created DESC LIMIT 1";
|
||||
//var_dump($sql, $categories_id);
|
||||
$res = sqlDAL::readSql($sql, "ii", array($categories_id, $categories_id));
|
||||
$result = sqlDAL::fetchAssoc($res);
|
||||
sqlDAL::close($res);
|
||||
return $result;
|
||||
}
|
||||
|
||||
static function getTotalLiveLinksFromCategory($categories_id, $showUnlisted = false, $renew = false) {
|
||||
global $global;
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
header('Access-Control-Allow-Origin: *');
|
||||
global $global, $config;
|
||||
if(!isset($global['systemRootPath'])){
|
||||
require_once '../videos/configuration.php';
|
||||
}
|
||||
require_once $global['systemRootPath'] . 'plugin/MobileManager/MobileManager.php';
|
||||
require_once 'functions.php';
|
||||
header('Access-Control-Allow-Origin: *');
|
||||
allowOrigin();
|
||||
AVideoPlugin::loadPlugin('MobileManager');
|
||||
header('Content-Type: application/json');
|
||||
$obj = new stdClass();
|
||||
$obj->max_file_size = get_max_file_size();
|
||||
|
|
|
@ -121,6 +121,7 @@ class CustomizeAdvanced extends PluginAbstract {
|
|||
}
|
||||
}
|
||||
|
||||
$obj->disablePlayLink = false;
|
||||
$obj->disableHelpLeftMenu = false;
|
||||
$obj->disableAboutLeftMenu = false;
|
||||
$obj->disableContactLeftMenu = false;
|
||||
|
|
|
@ -1123,7 +1123,7 @@ class Live extends PluginAbstract {
|
|||
$url = $p->getLivePosterImage($users_id, $live_servers_id);
|
||||
$url = addQueryStringParameter($url, "playlists_id_live", $playlists_id_live);
|
||||
} else {
|
||||
$file = self::getOfflineImage(false);
|
||||
$url = self::getOfflineImage(false);
|
||||
}
|
||||
return $url;
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ worker_processes 1;
|
|||
hls_playlist_length 60m;
|
||||
hls_fragment 4s;
|
||||
on_publish http://localhost/AVideo/plugin/Live/on_publish.php;
|
||||
on_publish_done http://localhost/AVideo/plugin/Live/on_publish_done.php;
|
||||
on_play http://localhost/AVideo/plugin/Live/on_play.php;
|
||||
on_record_done http://localhost/AVideo/plugin/Live/on_record_done.php;
|
||||
|
||||
|
|
|
@ -1,45 +0,0 @@
|
|||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
http {
|
||||
include mime.types;
|
||||
default_type application/octet-stream;
|
||||
sendfile on;
|
||||
keepalive_timeout 65;
|
||||
server {
|
||||
listen 81;
|
||||
server_name localhost;
|
||||
|
||||
location / {
|
||||
root html;
|
||||
index index.html index.htm;
|
||||
}
|
||||
|
||||
location /stat {
|
||||
rtmp_stat all;
|
||||
rtmp_stat_stylesheet stat.xsl;
|
||||
}
|
||||
location /stat.xsl {
|
||||
root html;
|
||||
}
|
||||
location /control {
|
||||
rtmp_control all;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
rtmp {
|
||||
server {
|
||||
listen 1935;
|
||||
chunk_size 4096;
|
||||
|
||||
application live {
|
||||
live on;
|
||||
record off;
|
||||
on_publish http://[AVideoURL]/plugin/Live/on_publish.php;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -160,6 +160,7 @@ class LiveLinks extends PluginAbstract {
|
|||
"htmlExtraVideoPage" => $newContentExtraVideoPage,
|
||||
"UserPhoto" => $UserPhoto,
|
||||
"title" => $value['title'],
|
||||
"users_id" => $value['users_id'],
|
||||
"name" => $name,
|
||||
"poster" => self::getPosterToLiveFromId($value['id']),
|
||||
"link" => self::getLinkToLiveFromId($value['id'], true)
|
||||
|
|
|
@ -16,8 +16,8 @@ class LoginTwitter extends PluginAbstract {
|
|||
$name = $obj->type;
|
||||
$str = "Login with {$name} OAuth Integration";
|
||||
$str .= "<br><a href='{$obj->linkToDevelopersPage}'>Get {$name} ID and Key</a>"
|
||||
. "<br>Valid OAuth redirect URIs: <strong>{$global['webSiteRootURL']}objects/login.json.php?type=$name</strong>"
|
||||
. "<br>For mobile a Valid OAuth redirect URIs: <strong>{$global['webSiteRootURL']}plugin/MobileManager/oauth2.php?type=$name</strong>";
|
||||
. "<br>Valid OAuth redirect URIs: <strong>{$global['webSiteRootURL']}objects/login.json.php</strong>"
|
||||
. "<br>For mobile a Valid OAuth redirect URIs: <strong>{$global['webSiteRootURL']}plugin/MobileManager/oauth2.php</strong>";
|
||||
return $str;
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ class YPTSocket extends PluginAbstract {
|
|||
global $global;
|
||||
$desc = getSocketConnectionLabel();
|
||||
$desc .= "Socket Plugin, WebSockets allow for a higher amount of efficiency compared to REST because they do not require the HTTP request/response overhead for each message sent and received<br>";
|
||||
$desc .= "<code>nohup php {$global['systemRootPath']}plugin/YPTSocket/server.php &</code>";
|
||||
$desc .= "<code>sudo nohup php {$global['systemRootPath']}plugin/YPTSocket/server.php &</code>";
|
||||
$help = "<br>run this command start the server <small><a href='https://github.com/WWBN/AVideo/wiki/Socket-Plugin' target='__blank'><i class='fas fa-question-circle'></i> Help</a></small>";
|
||||
|
||||
//$desc .= $this->isReadyLabel(array('YPTWallet'));
|
||||
|
|
|
@ -39,6 +39,13 @@ if(strtolower($scheme)!=='https'){
|
|||
|
||||
$server->run();
|
||||
} else {
|
||||
if(!file_exists($SocketDataObj->server_crt_file) || !is_readable($SocketDataObj->server_crt_file)){
|
||||
echo "SSL ERROR, we could not access the CRT file {$SocketDataObj->server_crt_file}, try to run this command as root or use sudo ".PHP_EOL;
|
||||
}
|
||||
if(!file_exists($SocketDataObj->server_key_file) || !is_readable($SocketDataObj->server_key_file)){
|
||||
echo "SSL ERROR, we could not access the KEY file {$SocketDataObj->server_key_file}, try to run this command as root or use sudo ".PHP_EOL;
|
||||
}
|
||||
|
||||
echo "Your socket server uses a secure connection".PHP_EOL;
|
||||
$parameters = [
|
||||
'local_cert' => $SocketDataObj->server_crt_file,
|
||||
|
|
|
@ -1153,7 +1153,11 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
|
|||
</li>
|
||||
<!-- categories -->
|
||||
<li>
|
||||
<h3 class="text-danger"><?php echo __($advancedCustom->CategoryLabel); ?></h3>
|
||||
<h3>
|
||||
<a href="<?php echo $global['webSiteRootURL']; ?>listCategories" class="text-danger">
|
||||
<?php echo __($advancedCustom->CategoryLabel); ?>
|
||||
</a>
|
||||
</h3>
|
||||
</li>
|
||||
<?php
|
||||
$_rowCount = getRowCount();
|
||||
|
@ -1237,6 +1241,16 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp
|
|||
<hr>
|
||||
</li>
|
||||
<?php
|
||||
if (empty($advancedCustom->disablePlayLink)) {
|
||||
?>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<?php echo $global['webSiteRootURL']; ?>playLink">
|
||||
<i class="fas fa-play-circle"></i>
|
||||
<?php echo __("Play a Link"); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
if (empty($advancedCustom->disableHelpLeftMenu)) {
|
||||
?>
|
||||
<li>
|
||||
|
|
177
view/listCategories.php
Normal file
177
view/listCategories.php
Normal file
|
@ -0,0 +1,177 @@
|
|||
<?php
|
||||
global $global, $config;
|
||||
if (!isset($global['systemRootPath'])) {
|
||||
require_once '../videos/configuration.php';
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="<?php echo $config->getLanguage(); ?>">
|
||||
<head>
|
||||
<?php
|
||||
echo getHTMLTitle(array('Categories'));
|
||||
include $global['systemRootPath'] . 'view/include/head.php';
|
||||
?>
|
||||
<style>
|
||||
.categoryItem .categoryName {
|
||||
position: absolute;
|
||||
clear: both;
|
||||
overflow: hidden;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
padding: 10px 10px 10px calc( 20% + 20px);
|
||||
width: 100%;
|
||||
color: #fff;
|
||||
background-image: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,1));
|
||||
}
|
||||
.categoryItem .panel-default{
|
||||
position: relative;
|
||||
}
|
||||
.categoryItem img{
|
||||
max-width: 20%;
|
||||
position: absolute;
|
||||
bottom: 10px;
|
||||
left: 10px;
|
||||
-webkit-transform: scale(1);
|
||||
transform: scale(1);
|
||||
-webkit-transition: .3s ease-in-out;
|
||||
transition: .3s ease-in-out;
|
||||
}
|
||||
.categoryItem:hover img {
|
||||
-webkit-transform: scale(1.1);
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
|
||||
.categoryItem>div{
|
||||
background-size: cover;
|
||||
box-shadow: 0 1px 2px rgba(0,0,0,0.15);
|
||||
transition: box-shadow 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
.categoryItem:hover>div{
|
||||
-webkit-animation: zoomin 0.3s linear;
|
||||
animation: zoomin 0.3s linear;
|
||||
animation-fill-mode: forwards;
|
||||
box-shadow: 0 5px 15px rgba(0,0,0,0.3);
|
||||
}
|
||||
|
||||
@-webkit-keyframes zoomin {
|
||||
0% {
|
||||
-webkit-transform: scale(1);
|
||||
transform: scale(1);
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: scale(1.05);
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="<?php echo $global['bodyClass']; ?>">
|
||||
<br>
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'view/include/navbar.php';
|
||||
?>
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<?php
|
||||
$_GET['parentsOnly'] = 1;
|
||||
$categories = Category::getAllCategories(false, true);
|
||||
//var_dump(count($categories));
|
||||
foreach ($categories as $value) {
|
||||
if (!empty($value['parentId'])) {
|
||||
//var_dump("<br> 1 {$value['name']}");
|
||||
continue;
|
||||
}
|
||||
if ($advancedCustom->ShowAllVideosOnCategory) {
|
||||
$total = $value['fullTotal'];
|
||||
} else {
|
||||
$total = $value['total'];
|
||||
}
|
||||
if (empty($total)) {
|
||||
//var_dump("<br> 2 {$value['name']}");
|
||||
continue;
|
||||
}
|
||||
|
||||
if(!empty($value['fullTotal_videos'])){
|
||||
$video = Category::getLatestVideoFromCategory($value['id'], true, true);
|
||||
$images = Video::getImageFromID($video['id']);
|
||||
$image = $images->poster;
|
||||
}else
|
||||
if(!empty($value['fullTotal_lives'])){
|
||||
$live = Category::getLatestLiveFromCategory($value['id'], true, true);
|
||||
$image = Live::getImage($live['users_id'], $live['live_servers_id']);
|
||||
}else
|
||||
if(!empty($value['fullTotal_livelinks'])){
|
||||
$liveLinks = Category::getLatestLiveLinksFromCategory($value['id'], true, true);
|
||||
$image = LiveLinks::getImage($liveLinks['id']);
|
||||
}
|
||||
|
||||
$totalVideosOnChilds = Category::getTotalFromChildCategory($value['id']);
|
||||
$childs = Category::getChildCategories($value['id']);
|
||||
$photo = Category::getCategoryPhotoPath($value['id']);
|
||||
$photoBg = Category::getCategoryBackgroundPath($value['id']);
|
||||
$link = $global['webSiteRootURL'] . 'cat/' . $value['clean_name'];
|
||||
$imageNotFound = preg_match('/notfound/i', $image);
|
||||
$photoNotFound = preg_match('/notfound/i', $photo['url']);
|
||||
$icon = '<i class="' . (empty($value['iconClass']) ? "fa fa-folder" : $value['iconClass']) . '"></i> ' ;
|
||||
if (!$imageNotFound) {
|
||||
?>
|
||||
<style>
|
||||
.categoryItem<?php echo $value['id']; ?>>div{
|
||||
background-image: url(<?php echo $image; ?>);
|
||||
}
|
||||
</style>
|
||||
<?php
|
||||
}
|
||||
if ($photoNotFound || !Category::isAssetsValids($value['id'])) {
|
||||
?>
|
||||
<style>
|
||||
.categoryItem<?php echo $value['id']; ?> img{
|
||||
display: none;
|
||||
}
|
||||
.categoryItem<?php echo $value['id']; ?> .categoryName {
|
||||
padding-left: 10px ;
|
||||
}
|
||||
</style>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<a href="<?php echo $link; ?>">
|
||||
<div class="col-lg-3 col-md-4 col-sm-6 col-xs-12 categoryItem categoryItem<?php echo $value['id']; ?>" >
|
||||
<div class="panel panel-default embed-responsive embed-responsive-16by9 ">
|
||||
<div class="panel-body ">
|
||||
<?php
|
||||
//var_dump($images, $totalVideosOnChilds['total'], $value['name'], $value['fullTotal']);
|
||||
?>
|
||||
<div class="categoryName">
|
||||
<?php echo $icon, ' ', $value['name']; ?>
|
||||
</div>
|
||||
<img src="<?php echo $photo['url+timestamp']; ?>" class=" img img-responsive" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div><!--/.container-->
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'view/include/footer.php';
|
||||
?>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
include $global['systemRootPath'].'objects/include_end.php';
|
105
view/modePlayLink.php
Normal file
105
view/modePlayLink.php
Normal file
|
@ -0,0 +1,105 @@
|
|||
<?php
|
||||
global $global, $config;
|
||||
if (!isset($global['systemRootPath'])) {
|
||||
require_once '../videos/configuration.php';
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="<?php echo $config->getLanguage(); ?>">
|
||||
<head>
|
||||
<?php
|
||||
echo getHTMLTitle(array('Categories'));
|
||||
include $global['systemRootPath'] . 'view/include/head.php';
|
||||
?><style>
|
||||
#custom-search-input{
|
||||
padding: 3px;
|
||||
border: solid 1px #E4E4E4;
|
||||
border-radius: 6px;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
#custom-search-input input{
|
||||
border: 0;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
#custom-search-input button{
|
||||
margin: 2px 0 0 0;
|
||||
background: none;
|
||||
box-shadow: none;
|
||||
border: 0;
|
||||
color: #666666;
|
||||
padding: 0 8px 0 10px;
|
||||
border-left: solid 1px #ccc;
|
||||
}
|
||||
|
||||
#custom-search-input button:hover{
|
||||
border: 0;
|
||||
box-shadow: none;
|
||||
border-left: solid 1px #ccc;
|
||||
}
|
||||
|
||||
#custom-search-input .glyphicon-search{
|
||||
font-size: 23px;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="<?php echo $global['bodyClass']; ?>">
|
||||
<br>
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'view/include/navbar.php';
|
||||
?>
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="input-group col-md-12">
|
||||
<div class="panel">
|
||||
<div class="panel-body" id="linkPanel">
|
||||
<form id="play-form" name="play-form" method="get">
|
||||
<div id="custom-search-input">
|
||||
<div class="input-group col-md-12">
|
||||
<input type="search" name="urlToPlay" class="form-control input-lg" placeholder="<?php echo __("Place a Link to play"); ?>" value="<?php
|
||||
echo @$_GET['urlToPlay'];
|
||||
?>" id="playFormInput" />
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-info btn-lg" type="submit">
|
||||
<i class="fas fa-play-circle"></i>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!--/.container-->
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'view/include/footer.php';
|
||||
?>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#play-form').submit(function (event) {
|
||||
if (seachFormIsRunning) {
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
seachFormIsRunning = 1;
|
||||
var str = $('#playFormInput').val();
|
||||
if (isMediaSiteURL(str)) {
|
||||
event.preventDefault();
|
||||
console.log("playForm is URL " + str);
|
||||
seachFormPlayURL(str);
|
||||
return false;
|
||||
} else {
|
||||
avideoToast('<?php echo __('This is not a valid URL'); ?>');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue