0
votes

I want to play a short video in loop in fullscreen mode without the sleep mode to turn on any mobile device.

I tried afterglow player and video.js but I keep having the same problem that the screen dims and the sleep mode is enable based on the phone's settings. When playing the videos on the players websites it works fine, so it's possible and I must be missing something.

This is the afterglow player example

<script type="text/javascript" src="afterglow.min.js"></script>

<body>
  <div id="videoContainer">
    <video class="afterglow" autoplay loop id="xmas" width="1920" height="1080" src="someVideo.mp4" type="video/mp4"></video>
  </div>
</body>

I also tried nosleep.js but from what I understand it just plays an transparent mp4 video to prevent the sleep mode. So shouldn't it automatically work for playing a visible video?

Thanks for any help

1

1 Answers

0
votes

The "loop" attribute appears to interfere with preventing the sleep mode (tested on iOS) so once it's set the phone will go in to sleep mode even when the video is playing. Without the "loop" attribute it works fine, the phone will stay on til the video is done playing.