1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2024-12-26 05:02:21 +00:00
plateforme-corres2math/server_files/views/envoyer_video.php

42 lines
1.2 KiB
PHP
Raw Normal View History

2019-09-12 18:10:30 +00:00
<?php
require_once "header.php";
if ($has_error)
echo "<h2>Erreur : $error_message</h2>";
elseif (isset($new_video))
echo "<h2>Votre vidéo a bien été envoyée !</h2>";
?>
2019-09-12 22:11:41 +00:00
<?php
2019-09-16 22:04:45 +00:00
if ($video !== null) {
$link = $video->getLink();
echo "Lien de la vidéo déjà envoyée : <a href=\"$link\">$link</a> (version " . $video->getVersion() . ")<br />\n";
2019-09-16 22:04:45 +00:00
if (preg_match("#(https?\://|)(www\.|)youtube\.com\/watch\?v=(.*)#", $link, $matches)) {
$code = $matches[3];
echo "<center><iframe width=\"854px\" height=\"480px\" src=\"https://www.youtube.com/embed/$code\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe></center><br />\n";
2019-09-12 22:11:41 +00:00
}
}
?>
2019-09-12 18:10:30 +00:00
<form method="POST">
<table style="width: 100%;">
<tbody>
<tr>
<td style="width: 30%;">
2019-09-16 22:04:45 +00:00
<label for="link">Lien de la vidéo à soumettre :</label>
2019-09-12 18:10:30 +00:00
</td>
<td style="width: 70%;">
<input style="width: 100%;" type="url" id="link" name="link" />
</td>
</tr>
<tr>
<td colspan="2">
<input style="width: 100%;" type="submit" name="upload" value="Envoyer la vidéo" />
</td>
</tr>
</tbody>
</table>
</form>
<?php require_once "footer.php";