Neler yeni

"Yardım" Html arkaplanda müzik oynatma (1 Viewer)

Mesajlar
372
Credits
15,387
Arkadaşlar aşağıda verdiğim kod ile video başlıyor,fakat ekrana click atmadan başlamıyor.
Click atmadan videonun başlamasını istiyorum...

<html lang="tr"> <head> <meta charset="UTF-8"> <style> * { box-sizing: border-box; } body { margin: 0; font-family: Arial; font-size: 17px; } #video { position: fixed; right: 0; bottom: 0; min-width: 100%; min-height: 100%; } #videoIcerik { position: fixed; bottom: 0; background: rgba(0, 0, 0, 0.5); color: #f1f1f1; width: 100%; padding: 20px; } #buton { width: 200px; font-size: 18px; padding: 10px; border: none; background: #000; color: #fff; cursor: pointer; } #buton:hover { background: #ddd; color: black; } </style> </head> <body> <video autoplay loop id="video" onclick="durBasla()"> <source src="video.mp4" type="video/mp4"> </video> <script> var video = document.getElementById("video"); var btn = document.getElementById("buton"); function durBasla() { if (video.paused) { video.play(); btn.innerHTML = "Dur"; } else { video.pause(); btn.innerHTML = "Oynat"; } } </script> </body> </html>
 
Mesajlar
372
Credits
15,387
Şu kodumun kodunu çalıştırıncada sessiz başlıyor,"muted" ekini kaldırıyorum bu sefer video hiç başlamıyor.

<html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <video autoplay loop muted playsinline> <source src="video.mp4" type="video/mp4"> Tarayıcınız video etiketini desteklemiyor. </video> </body> </html>
 

StureZ 

İmthack.com/forum
stad
Mesajlar
958
Credits
2,777
zamanında bende yasadım bu muted sorununu yaşadım tek çare videonun sesini mp3 olarak uploadlayıp audio etiketi ile otomatik oynatma
 

Bu konuyu görüntüleyen kullanıcılar