@@ -61,9 +61,8 @@ export class MediaProviderElement extends Host(HTMLElement, MediaProvider) {
6161
6262 if ( isEmbed && target ) {
6363 effect ( ( ) => {
64- const { $iosControls } = this . _media ,
65- { controls } = this . _media . $state ,
66- showControls = controls ( ) || $iosControls ( ) ;
64+ const { nativeControls } = this . _media . $state ,
65+ showControls = nativeControls ( ) ;
6766
6867 if ( showControls ) {
6968 this . _blocker ?. remove ( ) ;
@@ -111,13 +110,12 @@ export class MediaProviderElement extends Host(HTMLElement, MediaProvider) {
111110 const video =
112111 this . _target instanceof HTMLVideoElement ? this . _target : document . createElement ( 'video' ) ;
113112
114- const { controls, crossOrigin, poster } = this . _media . $state ,
115- { $iosControls } = this . _media ,
116- $nativeControls = computed ( ( ) => ( controls ( ) || $iosControls ( ) ? 'true' : null ) ) ,
117- $poster = computed ( ( ) => ( poster ( ) && ( controls ( ) || $iosControls ( ) ) ? poster ( ) : null ) ) ;
113+ const { crossOrigin, poster, nativeControls } = this . _media . $state ,
114+ $controls = computed ( ( ) => ( nativeControls ( ) ? 'true' : null ) ) ,
115+ $poster = computed ( ( ) => ( poster ( ) && nativeControls ( ) ? poster ( ) : null ) ) ;
118116
119117 effect ( ( ) => {
120- setAttribute ( video , 'controls' , $nativeControls ( ) ) ;
118+ setAttribute ( video , 'controls' , $controls ( ) ) ;
121119 setAttribute ( video , 'crossorigin' , crossOrigin ( ) ) ;
122120 setAttribute ( video , 'poster' , $poster ( ) ) ;
123121 } ) ;
@@ -127,13 +125,10 @@ export class MediaProviderElement extends Host(HTMLElement, MediaProvider) {
127125
128126 private _createIFrame ( ) {
129127 const iframe =
130- this . _target instanceof HTMLIFrameElement ? this . _target : document . createElement ( 'iframe' ) ;
128+ this . _target instanceof HTMLIFrameElement ? this . _target : document . createElement ( 'iframe' ) ,
129+ { nativeControls } = this . _media . $state ;
131130
132- const { controls } = this . _media . $state ,
133- { $iosControls } = this . _media ,
134- $nativeControls = computed ( ( ) => controls ( ) || $iosControls ( ) ) ;
135-
136- effect ( ( ) => setAttribute ( iframe , 'tabindex' , ! $nativeControls ( ) ? - 1 : null ) ) ;
131+ effect ( ( ) => setAttribute ( iframe , 'tabindex' , ! nativeControls ( ) ? - 1 : null ) ) ;
137132
138133 return iframe ;
139134 }
0 commit comments