javascript - What is the suggested method of playing video indefinitely in a browser? (for weeks or months a time) -



javascript - What is the suggested method of playing video indefinitely in a browser? (for weeks or months a time) -

i'm working on scheme few devices , screens should able run indefinitely, or @ to the lowest degree 2-3 days. 1 of promotional screen runs in fullscreen browser , has text , video playlist should loop forever.

currently i'm using jquery jplayer playlist video solution , i'm having problem crashes after longer period of time. i'm not quite sure how test it, left running on weekend find not loaded today.

so question is:

which solution best video playlist has loop forever?

so here's code worked

<video id="videoplayer" src="../../content/data/video_01.m4v" style="width: 1280px; height: 720px;" autoplay controls /> <script type="text/javascript"> var videoarray = [ "../../content/data/video_01.m4v", "../../content/data/video_02.m4v", "../../content/data/video_03.m4v" ]; var videoplayer = document.getelementbyid('videoplayer'); var videoindex = 0; videoplayer.onended = function () { videoindex++; if (videoindex >= videoarray.length) { videoindex = 0; } videoplayer.src = videoarray[videoindex]; } </script>

note: crashes after +/- 14hours on opera on sony tv, works on pc runs chrome in fullscreen (which i'll have running on site).

edit 1: added @ end of script in case video fails load (which happened once).

videoplayer.addeventlistener('error', function (err) { err.preventdefault(); videoplayer.onended(); });

edit 2: lastly part (adding eventlistener on error) key everything. apparently when crashed crashed because couldn't load video , stoped. i'd suggest having this.

javascript html flash video html5-video

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -