Autoplay ne marche pas !

Fermé
Neutrino3500 Messages postés 72 Date d'inscription lundi 11 novembre 2019 Statut Membre Dernière intervention 25 juillet 2020 - 9 déc. 2019 à 19:45
Neutrino3500 Messages postés 72 Date d'inscription lundi 11 novembre 2019 Statut Membre Dernière intervention 25 juillet 2020 - 12 déc. 2019 à 12:34
Bonjour,
Voici mon code HTML :
<video width="80%" id="video" autoplay>
    <source src="http://cloudghost.000webhostapp.com/msgs-exe-version/stromae-papaoutai-karaoke.mp4" type="video/mp4">
</video>

Pourquoi autoplay ne marche pas ?
Cordialement.

1 réponse

jordane45 Messages postés 38144 Date d'inscription mercredi 22 octobre 2003 Statut Modérateur Dernière intervention 21 avril 2024 4 650
9 déc. 2019 à 19:50
Bonjour,

Essaye
<video controls autoplay>
  <source src="http://cloudghost.000webhostapp.com/msgs-exe-version/stromae-papaoutai-karaoke.mp4" type="video/mp4">
  Your browser does not support the video tag.
</video>


Il arrive que certains navigateurs n'autorisent pas la lecture de la video en automatique si il y a du son
Dans ce cas il faut ajouter l'attribut muted
<video controls autoplay muted>
  <source src="http://cloudghost.000webhostapp.com/msgs-exe-version/stromae-papaoutai-karaoke.mp4" type="video/mp4">
  Your browser does not support the video tag.
</video>

1
Neutrino3500 Messages postés 72 Date d'inscription lundi 11 novembre 2019 Statut Membre Dernière intervention 25 juillet 2020
9 déc. 2019 à 20:37
La première méthode ne marche pas. La deuxième marche mais je voudrais que la vidéo ne soit pas muette...

Ce qui est bizarre, c'est qu'avec ma méthode, parfois ça marche, mais la plupart du temps ça ne marche pas. Pourquoi ?
0
jordane45 Messages postés 38144 Date d'inscription mercredi 22 octobre 2003 Statut Modérateur Dernière intervention 21 avril 2024 4 650 > Neutrino3500 Messages postés 72 Date d'inscription lundi 11 novembre 2019 Statut Membre Dernière intervention 25 juillet 2020
10 déc. 2019 à 11:38
1