1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-06-24 15:00:27 +02:00

Flexibilité sur la validation des vidéos accrue

This commit is contained in:
galaxyoyo
2019-09-19 00:31:53 +02:00
parent 1e67b8569d
commit 5372350f46
13 changed files with 289 additions and 17 deletions

View File

@ -12,11 +12,24 @@ elseif (isset($new_video))
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";
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";
displayVideo($link);
switch ($video->getValidation()) {
case 0:
echo "La vidéo n'a pas encore été contrôlée.<br />";
break;
case 1:
echo "La vidéo a été acceptée.<br />";
break;
case -1:
echo "La vidéo a été rejetée.<br />";
break;
}
}
if ($video_validated != null && $video_validated->getId() != $video->getId()) {
$link = $video_validated->getLink();
echo "<hr />\nLien de la dernière vidéo validée : <a href=\"$link\">$link</a><br />";
displayVideo($link);
}
?>
<form method="POST">
@ -30,6 +43,16 @@ if ($video !== null) {
<input style="width: 100%;" type="url" id="link" name="link" />
</td>
</tr>
<tr>
<td style="text-align: center;" colspan="2">
<input type="checkbox" name="valid_link" id="valid_link" required /> <label for="valid_link">Je confirme que le lien est valide</label>
</td>
</tr>
<tr>
<td style="text-align: center;" colspan="2">
<input type="checkbox" name="no_change" id="no_change" required /> <label for="no_change">Je m'engage à ne pas changer le contenu du lien et de la vidéo</label>
</td>
</tr>
<tr>
<td colspan="2">
<input style="width: 100%;" type="submit" name="upload" value="Envoyer la vidéo" />