artpolikarpov / fotorama

A simple, stunning, powerful jQuery gallery.
http://fotorama.io
Other
1.58k stars 380 forks source link

How to force play and not download the video #577

Open SivopCi opened 1 year ago

SivopCi commented 1 year ago

Hi there, I have a problem with fotorama video playback. Indeed, I don't play youtube videos my videos on my server and when I click to play, it downloads the video... Do you please have a solution for me? The title mime of my video is a pm4 and here is my code:

`
<div class=\"fotorama\" data-autoplay=\"true\" data-nav=\"thumbs\" data-transition=\"dissolve\" data-loop=\"true\"> <?php $image = null; $video = null; $image_b = null; $image_c = null;

    $image   = "images/produits/".$reference.".png";
    $video   = "images/produits/".$reference.".mp4";
    $image_b = "images/produits/".$reference."-b.png";
    $image_c = "images/produits/".$reference."-c.png";

    if(file_exists($image))   {echo '<img src="'.$image.'" class="img-fluid">';}
    if(file_exists($video))   {echo '<a href="'.$video.'" data-video="true"><img src="'.$image.'"></a>';}
    if(file_exists($image_b)) {echo '<img src="'.$image_b.'" class="img-fluid">';}
    if(file_exists($image_c)) {echo '<img src="'.$image_c.'" class="img-fluid">';}
    ?>
    </div>

`

Thanks for your help