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
This would be a very handy feature. I currently have it implemented as follows:
/* double-click-fullscreen.js */import{useMediaDispatch,useMediaSelector,MediaActionTypes}from"media-chrome/react/media-store"exportdefaultfunctionuseDoubleClickFullscreen(){/** * An onClick handler to enter/exit fullscreen on double-click. */constdispatch=useMediaDispatch()constisFullscreen=useMediaSelector(state=>state.mediaIsFullscreen)returne=>{if(e.detail===2){consttype=isFullscreen
? MediaActionTypes.MEDIA_EXIT_FULLSCREEN_REQUEST
: MediaActionTypes.MEDIA_ENTER_FULLSCREEN_REQUESTdispatch({ type })}}}
/* where <video> is */<videoref={el=>{ref.current=elmediaRef(el)}}autoPlaycrossOrigin="anonymous"slot="media"onClick={useDoubleClickFullscreen()}/*...*/
If your <video> already has an onClick handler, then just include it in that and rework the hook to be able to pass the event variable into it.
The text was updated successfully, but these errors were encountered:
This would be a very handy feature. I currently have it implemented as follows:
If your
<video>
already has an onClick handler, then just include it in that and rework the hook to be able to pass the event variable into it.The text was updated successfully, but these errors were encountered: