Intenté reproducir el reproductor de video a pantalla completa en el navegador y en el móvil. Tengo un problema en el modo de pantalla completa móvil. Está dando el siguiente error cuando llama la función de pantalla completa.
No sé Este error viene de Dónde. ¿Alguien ha enfrentado este tipo de error antes? o alguien sabe acerca de la solución para este error?
Mi código está a continuación:
Código HTML:
<div #myVle class="video-player position-relative p-0" id="video-player-selecter"> <video class="video" id="myvideo" style="width: inherit;height: inherit;max-width: 100%;" disablepictureinpicture controlslist="nodownload" autoplay muted playsinline> Your browser does not support the video tag. </video> </div> <div class="col-lg-12 p-0"> <button class="btn btn-theme-select btn-block btn-sm" type="button" (click)="fullScreen($event)"> Full Screen </button> </div>Código de archivo ts:
@ViewChild('myVle') myVleEle: ElementRef// Este error aparece cuando se llama 'si parte' de la siguiente función. "a3.fc(...)[aMJ(...)] no es un error de función"
Mi función:
fullScreen(event) { if(!document.fullscreenElement) { if(this.myVleEle.nativeElement) { event.stopPropagation() // I also checked with removing this line if (this.myVleEle.nativeElement.requestFullscreen) { // Also tried with requestFullScreen this.myVleEle.nativeElement.requestFullscreen(); } else if (this.myVleEle.nativeElement.mozRequestFullScreen) { this.myVleEle.nativeElement.mozRequestFullScreen(); } else if (this.myVleEle.nativeElement.webkitRequestFullscreen) { this.myVleEle.nativeElement.webkitRequestFullscreen(); } else if (this.myVleEle.nativeElement.msRequestFullscreen) { this.myVleEle.nativeElement.msRequestFullscreen(); } } } else { if(document.exitFullscreen) { event.stopPropagation() // I also checked with removing this line document.exitFullscreen() } } }Este código funciona bien en el navegador web y también en la vista receptiva del navegador web. Pero cuando intento usar el navegador móvil, da un error. Probé todos los navegadores como Chrome, Firefox, Opera Safari. Pero ninguno de los navegadores ha funcionado. ¿Alguien puede sugerir lo que falta aquí?
Gracias.