ionic framework – webkitRequestFullscreen doesnt work on ios webview

[ad_1]

I’m attempting to write down 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?

[ad_2]

Leave a Reply