mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2025-02-06 12:13:01 +00:00
Correction de l'affichage de vidéos Youtube
This commit is contained in:
parent
7463817503
commit
b4870c4f3e
@ -298,8 +298,8 @@ function exportProblemsData() {
|
|||||||
|
|
||||||
function displayVideo($link)
|
function displayVideo($link)
|
||||||
{
|
{
|
||||||
if (preg_match("#(https?://|)(www\.|)youtube\.com/watch\?v=(.*)#", $link, $matches)) {
|
if (preg_match("#(https?://|)(www\.|)(youtube\.com/watch\?v=|youtu.be/)(.*)#", $link, $matches)) {
|
||||||
$code = $matches[3];
|
$code = $matches[4];
|
||||||
/** @noinspection HtmlDeprecatedAttribute */
|
/** @noinspection HtmlDeprecatedAttribute */
|
||||||
/** @noinspection HtmlDeprecatedTag */
|
/** @noinspection HtmlDeprecatedTag */
|
||||||
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";
|
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";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user