Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question] about the HTML5-VIDEO-tag #68

Closed
ghost opened this issue Mar 24, 2019 · 2 comments
Closed

[question] about the HTML5-VIDEO-tag #68

ghost opened this issue Mar 24, 2019 · 2 comments

Comments

@ghost
Copy link

ghost commented Mar 24, 2019

I was wondering if placing a HTML5 VIDEO tag in my HTML-page will have the save effect as embedding 'nosleep.js', I've encoded few 'blank videos' with FFMPEG and I was going to test it..
I was just curious on how it works, and why there is a jump in playing time on MP4 and for WEBM the 'loop' attribute is enough..

would this thing work in the same manner? (after manually clicking play):

<video autoplay="true" crossorigin="anonymous" loop="true" muted="true" preload="auto" playsinline="true" poster="poster.jpg">
  <source src="video_h264.mp4"    type='video/mp4;  codecs="avc1.42001E"'  />
  <source src="video_vp9.webm"    type='video/webm; codecs="vp9.0"'        />
  <source src="video_vp8.webm"    type='video/webm; codecs="vp8.0"'        />
  <source src="video_theora.ogv"  type='video/ogg;  codecs="theora"'       />
  <source src="video_mpeg4.avi"   type='video/avi;  codecs="mpeg4"'        />
  <p>No Support For HTML5's-video.</p>
</video>
@a22aaass
Copy link

you must be set voice is muted

@ghost ghost closed this as completed Apr 24, 2019
@MasterInQuestion
Copy link

MasterInQuestion commented Apr 16, 2023

    [ Quote eladkarako @ CE 2019-03-24 20:55:24 UTC:
https://github.com/richtr/NoSleep.js/issues/68#issue-424658888
    ... why there is a jump in playing time on MP4 and for WEBM the 'loop' attribute is enough. ]
<^>    https://github.com/richtr/NoSleep.js/issues/66#issuecomment-1510354869
    ~~To workaround certain browser bugs?~~ Precisely, probably just screwed logic...

    [ Quote (previous):
    ... if placing a HTML5 VIDEO tag in my HTML-page will have the save effect as embedding 'nosleep.js'? ]
<^>    No, perhaps.
    The "<video>" tag doesn't need to be attached to the document. [1]
    And "autoplay" is not "play".

    [ Quote richtr @ CE 2015-04-27 12:23:15 UTC:
https://github.com/richtr/NoSleep.js/commit/7a34e29dc5608193b999ecd1825f421d4a270a64#r10914646
    Also, iOS ''(old iOS)'' requires video elements to be appended to the DOM to enable playback.
    If you append a video to the DOM in Android and play it then in some browsers (e.g. Opera Mobile) it automatically launches a full-screen video player which is not the required behavior. ]
<.>    "playsinline" attribute may help.

[ [1]
    Perhaps doing so would be preferable.
    [ Quote wlekin @ CE 2021-05-07 08:03:02 UTC:
https://github.com/richtr/NoSleep.js/issues/123#issuecomment-834153935
    Not working for some reason after iOS 14.4.
    In the meantime I just put a zero opacity video tag without muted and loop to keep iPhone awake. ]
<.>    https://cdn.jsdelivr.net/npm/mil-no-sleep/src/MilNoSleep.js
    https://github.com/richtr/NoSleep.js/issues/135#issuecomment-974245430 ]

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants