This commit is contained in:
pepa65 2022-08-30 09:57:43 +07:00
parent 78f3db04bd
commit 41cff4126a
4 changed files with 66 additions and 18 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 111 KiB

View File

@ -2,17 +2,19 @@
<meta charset="utf-8">
<title>Stream Upload</title>
<link rel="icon" href="favicon.png">
<link rel="stylesheet" href="style.css">
<script>
function respond(){
const feedback = document.getElementById('response');
feedback.innerHTML = '<b>File is uploading</b>';
}
</script>
<div style="display:flex; justify-content:center; align-items:center; height:95vh;">
<div class="container">
<div class="incontainer">
<form action="upload.php" method="post" enctype="multipart/form-data" onsubmit="respond()">
<table>
<tr><td colspan=2 align=center><h1>Video Upload Page</h1></td></tr>
<tr>
<tr><td></td><td align="center"><h1>Stream Upload</h1></td></tr>
<tr>
<td>Target:</td>
<td>
<select name="target" id="target" required>
@ -21,22 +23,20 @@ function respond(){
<option value="YouTube">YouTube</option>
</select>
</td></tr>
<tr>
<td>Streamkey:</td>
<td><input type="text" name="streamkey" id="streamkey" required title="string of 0-9, a-z, A-Z or underscore characters" pattern="[a-zA-Z0-9_]+"></td></tr>
<tr>
<td>Date:</td>
<td><input type="date" name="date" id="date" required></td></tr>
<tr>
<td>Time:</td>
<td><input type="time" name="time" id="time" required></td></tr>
<td class="left">Streamkey:</td>
<td class="right"><input type="text" name="streamkey" id="streamkey" required title="string of 0-9, a-z, A-Z or underscore characters" pattern="[a-zA-Z0-9_]+"></td></tr>
<tr>
<td>Date and Time:</td>
<td><input type="datetime-local" name="datetime" id="datetime" required></td></tr>
<tr>
<td>Video File:</td>
<td><input type="file" name="fileToUpload" id="fileToUpload" required accept=".mp4"></td></tr>
<tr><td><br></td></tr>
<tr><td></td><td><input type="submit" value="Schedule Stream" name="submit"></td></tr>
<tr><td></td><td><input type="submit" value="Schedule Stream" name="submit"></td></tr>
<tr><td><br></td></tr>
<tr><td align=center colspan="2" id="response"></td></tr>
<tr><td align=center colspan="2" id="response"></td></tr>
</table>
</form>
</div>
</div>

47
uploadpage/style.css Normal file
View File

@ -0,0 +1,47 @@
input[type=text],[type=file], select, [type=time], [type=date], [type=datetime-local] {
width:100%;
padding:12px 20px;
margin:0;
display:inline-block;
border:1px solid #ccc;
border-radius:4px;
box-sizing:border-box;
font-size:16px;
}
input[type=submit] {
width:100%;
background-color:#4CAF50;
color:white;
padding:14px 20px;
margin:8px 0;
border:none;
border-radius:4px;
cursor:pointer;
font-size:16px
}
body {
margin:0;
font-family:sans-serif;
font-size:16px;
}
.container {
display:flex;
flex-direction:column;
justify-content:center;
align-items:center;
height:100vh;
}
.incontainer {
width:450px;
max-width:450px;
}
table {
width:100%;
}
.left {
width:125px;
}
.right {
width:325px;
}

View File

@ -16,9 +16,9 @@ function Back($msg){
header('Content-type: text/html; charset=utf-8');
$upload=htmlspecialchars(basename($_FILES['fileToUpload']['name']));
$key=$_POST['streamkey'];
$date=$_POST['date'];
$hour=substr($_POST['time'], 0, 2);
$min=substr($_POST['time'], 3, 2);
$date=substr($_POST['datetime'], 0, 10);
$hour=substr($_POST['datetime'], 11, 2);
$min=substr($_POST['datetime'], 14, 2);
$time=$hour.$min;
$target=$_POST['target'];
$dir='streams/';
@ -28,8 +28,9 @@ print('<!DOCTYPE html>
<meta charset="utf-8">
<title>Encoding</title>
<link rel="icon" href="favicon.png">
<div style="display:flex; flex-direction:column; justify-content:center; text-align:center; align-items:center; height:95vh;">
<h3>Encoding</h3>
<link rel="stylesheet" href="style.css">
<div class="container">
<h1>Encoding</h1>
File: '.$upload);
$now=date('Y-m-dHi');
if(strcmp($now, $date.$time)>0){