Ich möchte mehrere Videos hintereinander spielen. Ich möchte jedoch, dass die Seite jedes Mal aktualisiert wird, wenn ein Video beendet wird.Loop-Videos und aktualisieren nach jedem
Wie mache ich das?
Im Moment habe ich dies:
<script>
video_count =1;
videoPlayer = document.getElementById("homevideo");
function run(){
video_count++;
if (video_count == 6) video_count = 1;
var nextVideo = "Videos/demo/"+video_count+".mp4";
videoPlayer.src = nextVideo;
videoPlayer.play();
};
</script>
Und
<video id="homevideo" width="100%" autoplay onended="run()">
<source src="Videos/demo/1.mp4" type='video/mp4'/>
</video>
Jetzt wird diese Arbeit (Das nächste Video startet nach dem ersten fertig.) Allerdings weiß ich nicht, wie man bauen in der automatischen Aktualisierung. ohne erneut beim ersten Video zu starten.
EDIT:
Ist es posible mit php?
Das ist, was ich jetzt habe:
<?php
$videos=array("Videos/treinen/1.mp4",
"Videos/Demo/1.mp4",
"Videos/Demo1/2.mp4",
"Videos/Demo/2.mp4",
"Videos/Demo1/3.mp4",
"Videos/Demo/3.mp4",
"Videos/Demo1/4.mp4",
"Videos/Demo/4.mp4",
"Videos/Demo1/5.mp4",
"Videos/Demo/5.mp4",
"Videos/Demo1/6.mp4");
echo $videos[0] . $videos[1] . $videos[2] . $videos[3] . $videos[4] . $videos[5] . $videos[6] . $videos[7] . $videos[8] . $videos[9];
?>
Ist es posible
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item" src="<?php echo $videos; ?>"></iframe>
</div>
Dies ist natürlich noch nicht funktioniert, aber ich hoffe, euch meine Idee. (Ich konnte es über eine Sitzung speichern. Und ich verwende einen iframe wegen Bootstrap).
Verwenden Sie Cookies, um zu speichern, auf welchem Video Sie sich befinden. – frosty