Thursday, December 1, 2022
HomeiOS Developmentionic framework - webkitRequestFullscreen doesnt work on ios webview

ionic framework – webkitRequestFullscreen doesnt work on ios webview


I’m attempting to put in writing a customized fullscreen button for video tag.

Right here is my code:

const onClickVideoHandler = useCallback(() => {
    console.log(videoRef.present?.webkitRequestFullscreen); // all the time undefined in ios webview

    if (videoRef.present?.requestFullscreen) {
      videoRef.present?.requestFullscreen();
    } else if (videoRef.present?.msRequestFullscreen) {
      videoRef.present?.msRequestFullscreen();
    } else if (videoRef.present?.mozRequestFullScreen) {
      videoRef.present?.mozRequestFullScreen();
    } else if (videoRef.present?.webkitRequestFullscreen) {
      videoRef.present?.webkitRequestFullscreen();
    }
  }, [videoRef.current]);

<VideoWrapper onClick={onClickVideoHandler}>
  <video ref={videoRef} src={videoLink} muted={muted} controls={false} playsInline autoPlay loop onError={onErrorHandler} />
</VideoWrapper>

After I click on on the VideoWrapper I would like the video to open in fullscreen mode

I attempt to name webkitRequestFullscreen(), however this methodology all the time undefined in ios webview(
in addition to mozRequestFullScreen, mozRequestFullScreen, msRequestFullscreen, requestFullscreen)

Is there a way for fullscreen mode in ios webview?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments