add admin warning, disable preload of videos
This commit is contained in:
@@ -34,6 +34,10 @@ processPostData($dbConnection, $_POST);
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
|
||||
<!-- unpkg : use the latest version of Video.js -->
|
||||
<link href="https://unpkg.com/video.js/dist/video-js.min.css" rel="stylesheet">
|
||||
<script src="https://unpkg.com/video.js/dist/video.min.js"></script>
|
||||
|
||||
<!-- Compiled and minified CSS -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@materializecss/materialize@1.1.0-alpha/dist/css/materialize.min.css">
|
||||
<!-- Compiled and minified JavaScript -->
|
||||
|
||||
@@ -203,7 +203,9 @@ SQL;
|
||||
$ret."<div>".$ext."</div>";
|
||||
switch($ext){
|
||||
case "webm":
|
||||
$retHtml .= "<video controls><source src=\"".$this->imageUrl."\" type=\"video/webm\">Video tag is not supported in this browser.</video>";
|
||||
$retHtml .= "<video controls preload=\"none\"><source src=\"".$this->imageUrl."\" type=\"video/webm\">Video tag is not supported in this browser.</video>";
|
||||
// $retHtml .= videoJsFrame(array('url'=>$this->imageUrl));
|
||||
// $retHtml .= "<div>Hier sollte ein Video sein!</div>";
|
||||
break;
|
||||
default:
|
||||
$retHtml .= "<img src=\"".$this->imageUrl."\">";
|
||||
@@ -259,8 +261,12 @@ SQL;
|
||||
$retHtml .= "<input name=\"redirectLocation\" value=\"./#achievementList-".$uId."\" type=\"hidden\" />";
|
||||
$retHtml .= "<input name=\"userId\" value=\"".$uId."\" type=\"hidden\" />";
|
||||
$retHtml .= "<input name=\"achievementId\" value=\"".$usersNextAchievement['id']."\" type=\"hidden\" />";
|
||||
//! warning for admins, that the user already had an achievement today
|
||||
if( !canUserGetAchievementToday( $this->getDbConnection(), $uId) and isUserAdmin($this->getDbConnection(), $_SESSION['user']['userId']) ){
|
||||
$retHtml .= "<div class=\"pink\" >Heute wurde bereits eine Achievement erreicht!</div>";
|
||||
}
|
||||
//! Only one achievements shall be given daily! Admins can overrule this!
|
||||
if( canUserGetAchievementToday( $this->getDbConnection(), $uId) or isUserAdmin($this->getDbConnection(), $_SESSION['user']['userId']) ){
|
||||
// $retHtml .= "<button style=\"width:100%\" class=\"btn\" name=\"submit\" type=\"submit\" >Achievement ".$usersNextAchievement['name']." geben</button>";
|
||||
$retHtml .= "<button style=\"width:100%\" class=\"btn\" name=\"submit\" type=\"submit\" >Achievement geben</button>";
|
||||
}
|
||||
else{
|
||||
@@ -430,4 +436,24 @@ function collectKeysValues($array, $key){
|
||||
$values[]=$a[$key];
|
||||
return $values;
|
||||
}
|
||||
|
||||
//! create the <video>Tag for videoJs
|
||||
function videoJsFrame($item){
|
||||
return "<video "
|
||||
."id=\"".str_replace("/", "-", $item['url'])."\" "
|
||||
."class=\"video-js\" "
|
||||
."controls "
|
||||
."preload=\"none\" "
|
||||
// ."poster=\"//vjs.zencdn.net/v/oceans.png\""
|
||||
."data-setup='{}' "
|
||||
.">"
|
||||
."<source src=\"".$item['url']."\" type=\"video/webm\">"//</source>"
|
||||
."<p class=\"vjs-no-js\">"
|
||||
."To view this video please enable JavaScript, and consider upgrading to a web browser that "
|
||||
."<a href=\"https://videojs.com/html5-video-support/\" target=\"_blank\">"
|
||||
."supports HTML5 video"
|
||||
."</a>"
|
||||
."</p>"
|
||||
."</video>";
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user