You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if the container is closed -> video inside should be paused automatically
User behavior
if video was stopped/paused by user behavior (click or direct call of pause/stop) -> video can not be started automatically (e.g. play-in-viewport, autoplay, etc)
Restriction API
Original proposal
// Declare before registration to cover autoplay constrestriction=($media: ESLMedia)=>{return$media.type='video'&&matchMedia('(user-prefer-no-motion)').matching;};ESLMediaRestrictionManager.add(restiction);// To add restriction hookESLMediaRestrictionManager.delete(restiction);// To remove if required//ESLMedia.register();
Alternative (EventAPI)
window.addEventListener('esl:media:before:play',(event: Event)=>{// 1. The event is Cancelable// 2 The event contain all required inforamtionif(e.target.type==='video'&&matchMedia('(user-prefer-no-motion)').matching){e.prventDefault();// Reject playing the video}});ESLMedia.register();
It is proposed to rework the ESLMedia flow to resolve the following points:
User cases:
Autoplay
If the video (on the page) is marked as autoplay, then
If video is inside container
video was not played
video was played (container was opened previously)
Note:
Edge case - user decides to deprecate autostart in container second time
Container
User behavior
Restriction API
Original proposal
Alternative (EventAPI)
Tech details
TODO @ala-n
The text was updated successfully, but these errors were encountered: