fix ffmpeg
This commit is contained in:
14
lesson.php
14
lesson.php
@@ -138,6 +138,16 @@ $can_view = $lesson['is_demo'] || $user_owns;
|
||||
<?php
|
||||
// Usa lo stream protetto per i video locali
|
||||
$stream_url = SITE_URL . '/stream_video.php?lesson_id=' . $lesson_id;
|
||||
|
||||
// Determina il tipo MIME corretto dal file
|
||||
$extension = strtolower(pathinfo($lesson['video_url'], PATHINFO_EXTENSION));
|
||||
$mime_types = [
|
||||
'mp4' => 'video/mp4',
|
||||
'webm' => 'video/webm',
|
||||
'ogg' => 'video/ogg',
|
||||
'mov' => 'video/mp4' // MOV spesso funziona con il codec mp4
|
||||
];
|
||||
$video_mime = $mime_types[$extension] ?? 'video/mp4';
|
||||
?>
|
||||
<video
|
||||
id="videoPlayer"
|
||||
@@ -146,10 +156,10 @@ $can_view = $lesson['is_demo'] || $user_owns;
|
||||
width="100%"
|
||||
height="100%"
|
||||
style="border-radius: 8px; background: #000;"
|
||||
preload="auto"
|
||||
preload="metadata"
|
||||
playsinline
|
||||
oncontextmenu="return false;">
|
||||
<source src="<?php echo htmlspecialchars($stream_url); ?>" type="video/mp4">
|
||||
<source src="<?php echo htmlspecialchars($stream_url); ?>" type="<?php echo $video_mime; ?>">
|
||||
<p style="color: white; padding: 20px;">
|
||||
Il tuo browser non supporta la riproduzione video.<br>
|
||||
Prova ad aggiornare il browser o usa Chrome/Firefox.
|
||||
|
||||
Reference in New Issue
Block a user