mirror of
				https://gitlab.com/animath/si/plateforme-corres2math.git
				synced 2025-11-04 12:32:23 +01:00 
			
		
		
		
	Prise en charge de Google Drive
This commit is contained in:
		@@ -300,9 +300,15 @@ function displayVideo($link)
 | 
			
		||||
{
 | 
			
		||||
	if (preg_match("#(https?://|)(www\.|)(youtube\.com/watch\?v=|youtu.be/)(.*)#", $link, $matches)) {
 | 
			
		||||
		$code = $matches[4];
 | 
			
		||||
        /** @noinspection HtmlDeprecatedAttribute */
 | 
			
		||||
        /** @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";
 | 
			
		||||
		/** @noinspection HtmlDeprecatedAttribute */
 | 
			
		||||
		/** @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";
 | 
			
		||||
	}
 | 
			
		||||
	elseif (preg_match("#(https?://|)drive\.google\.com/file/d/(.*)/.*?#", $link, $matches)) {
 | 
			
		||||
		$code = $matches[2];
 | 
			
		||||
		/** @noinspection HtmlDeprecatedAttribute */
 | 
			
		||||
		/** @noinspection HtmlDeprecatedTag */
 | 
			
		||||
		echo "<center><iframe width=\"854px\" height=\"480px\" src=\"https://drive.google.com/file/d/$code/preview\" ></iframe></center><br />\n";
 | 
			
		||||
	}
 | 
			
		||||
	elseif (preg_match("#(https?://|)(www\.|)vimeo\.com/([0-9]*)#", $link, $matches)) {
 | 
			
		||||
		$code = $matches[3];
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user