11import { Component , effect } from 'maverick.js' ;
2- import { DOMEvent , setStyle } from 'maverick.js/std' ;
2+ import { DOMEvent , setAttribute , setStyle } from 'maverick.js/std' ;
33
44import { useMediaContext , type MediaContext } from '../../core/api/media-context' ;
55import { setAttributeIfEmpty } from '../../utils/dom' ;
@@ -40,6 +40,8 @@ export class Controls extends Component<ControlsProps, {}, ControlsEvents> {
4040 this . dispatch ( 'change' , { detail : this . _isShowing ( ) } ) ;
4141 } ) ;
4242
43+ effect ( this . _hideControls . bind ( this ) ) ;
44+
4345 effect ( ( ) => {
4446 const isFullscreen = fullscreen ( ) ;
4547 for ( const side of [ 'top' , 'right' , 'bottom' , 'left' ] ) {
@@ -48,6 +50,16 @@ export class Controls extends Component<ControlsProps, {}, ControlsEvents> {
4850 } ) ;
4951 }
5052
53+ private _hideControls ( ) {
54+ if ( ! this . el ) return ;
55+
56+ const { controls } = this . _media . $state ,
57+ isHidden = controls ( ) || this . _media . $iosControls ( ) ;
58+
59+ setAttribute ( this . el , 'aria-hidden' , isHidden ? 'true' : null ) ;
60+ setStyle ( this . el , 'display' , isHidden ? 'none' : null ) ;
61+ }
62+
5163 private _watchHideDelay ( ) {
5264 const { controls } = this . _media . player ,
5365 { hideDelay } = this . $props ;
0 commit comments