Pausing HTML5 video transaction on the server - html

Is it possible that when I click on the pause control of a HTML5 video the video transaction pauses on the server?

According the specifications (See http://www.whatwg.org/specs/web-apps/current-work/#the-video-element): "When a video element is paused and the current playback position is the first frame of video, the element represents the poster frame, unless a frame of video has already been shown, in which case the element represents the frame of video corresponding to the current playback position.
When a video element is paused at any other position, and the media resource has a video channel, the element represents the frame of video corresponding to the current playback position, or, if that is not yet available (e.g. because the video is seeking or buffering), the last frame of the video to have been rendered."
And the important part: "User agents should provide controls to enable or disable the display of closed captions, audio description tracks, and other additional data associated with the video stream, though such features should, again, not interfere with the page's normal rendering.
User agents may allow users to view the video content in manners more suitable to the user (e.g. full-screen or in an independent resizable window). As for the other user interface features, controls to enable this should not interfere with the page's normal rendering unless the user agent is exposing a user interface. In such an independent context, however, user agents may make full user interfaces visible, with, e.g., play, pause, seeking, and volume controls, even if the controls attribute is absent.
User agents may allow video playback to affect system features that could interfere with the user's experience; for example, user agents could disable screensavers while video playback is in progress."
By my opinion the answer to your question is: it depends from User-agents (i.e. browsers) implementations, maybe in future we will see this feature available in Chrome, Firefox, Opera, etc. but for now pausing transaction when pausing video is not implemented.

Related

How does html5 video tag works? Is there any way to see how it is implemented

I am developing an application where I need to display some animation in the canvas along with the video as a separate element, for the same I need to maintain the synchronisation between two DOM elements very precisely.
I was thinking of playing the animation as video tag plays the video. Is there any way I could see how the html5 video tag is implemented?
Theoretically, each browser can have their own implementation of the video tag. Besides of that, they will try their best to follow some rules specified by w3.org
This is the video tag draft:
https://www.w3.org/TR/2011/WD-html5-20110113/video.html#video
If yout want to sync something with a video you will want to use some video tag events:
https://www.w3.org/2010/05/video/mediaevents.html
A timeupdate event listener can be set on the video which will allow you to synchronize other elements on the page with the video as it plays. Video elements have many other events in addition to timeupdate, such as play, pause, and seeking.
The implementation of video elements will differ depending on the browser and may not be completely public, such as how they work with DRM.

HTML video autoplay without muted (or how does youtube do it)?

I know that many newer browsers now disable autoplay when the video isn't muted or mute it and then play. Without user interaction it's also not possible to call play on a video. That's understandable, but I'm wondering how youtube is still able to start the videos with sound.
I checked and they do use the video tag, just not with any autoplay/muted attributes and loading some blob. It's not the user interaction opening the video, it also starts when opening a link in incognito mode.
So my conclusion, it should still be possible. But how? Or did browsers add some kind of exception for trusted video streaming sites?
Thanks in advance
For the Youtube case, it is probably a pre-populated white list
https://blog.google/products/chrome/improving-autoplay-chrome/
If you don’t have browsing history, Chrome allows autoplay for over 1,000 sites where we see that the highest percentage of visitors play media with sound.
For other generic cases, you can refer to the following rules (for Chrome at least)
https://developers.google.com/web/updates/2017/09/autoplay-policy-changes
Autoplay with sound is allowed if:
User has interacted with the domain (click, tap, etc.).
On desktop, the user's Media Engagement Index threshold has been crossed, meaning the user has previously play video with sound.
On mobile, the user has added the site to his or her home
screen.

Audioless video accessibility and autoplay/loop

I have an audioless video implemented using HTML5's <video> tag. I'm trying to find out if auto-playing the video and automatically looping it (assuming I add a button to remove loop as well) would cause accessibility issues? I know there are rules regarding audio as well as video with audio that prevent you from doing that, so I'm also wondering if this video is practically considered a GIF.
The video can be found here for reference:
http://www.med.uottawa.ca/bmi/eng/lee.html
This is technically an accessibility violation if it plays for more than 5 seconds. It affects users with disabilities such as attention deficit disorder. You need to provide a button to stop the video from playing immediately, not only a button that disables the automatic loop.

Prevent HTML 5 Video from downloading the whole file at once

I wonder if its possible to download just the first 5 chunks (5MB) of a html5 video and so prevent to have high traffic bills when showing videos >100MB
the only way to have some control over this is with the preload attribute on the video tag. Sadly this is implemented differently in different browsers (eg auto may download 2s, 25s or the whole video depending on the connection).
Solutions like FMS or IIS SmoothStreaming allow more control, but require plugins (Flash or Silverlight) to manage that experience
preload='none'
From the spec, “Hints to the UA that the user is not expected to need the video, or that minimizing unnecessary traffic is desirable.”
preload='metadata'
“Hints to the UA that the user is not expected to need the video, but that fetching its metadata (dimensions, first frame, track list, duration, and so on) is desirable.”
preload='auto'
“Hints to the UA that optimistically downloading the entire video is considered desirable.”
preload or preload=''
The preload attribute is specified but no value is given. Specifying the empty string is the same as specifying “auto”.

How can I prevent HTML5 audio or video from playing when removed from the page?

Please feel free to suggest a better title for this post, as I wasn't sure how to properly describe the problem in one short question.
I've got a media player page with an HTML5 player and the option for the visitor to choose to play the video or audio for that page. While one is playing, a button to switch to the other is available. For example, if the visitor is playing audio, a "Switch to Video" button is available, which essentially removes the current content and replaces it. This effectively removes the current HTML5 player from the DOM tree as well, of course. In addition to replacing the content, a 'pause' event is triggered on any audio or video element on the page prior to loading the new content.
Unfortunately, if you switch between audio and video quickly enough, you'll end up with multiple items playing simultaneously.
I need to make sure this doesn't happen.
How can I ensure that when I replace the player, the previously loading file does not play?
To see this happening, go to http://www.onlinechurchmediacenter.com/mc/vertigoelectric/5628, choose either audio or video, and once it starts playing keep clicking the "Play Audio" or "Play Video" link which appears below the player. If you continuously click this quickly enough, you'll begin to notice multiple instances of the audio/video playing over each other.
I'd advise not to remove the elements from the DOM. Just hide them and trigger the pause. For good measure, trigger another pause before you play the next item.