api.video-reactnative-player icon indicating copy to clipboard operation
api.video-reactnative-player copied to clipboard

[Bug]: Can't call requestFullScreen() method on Android

Open bilal-prog opened this issue 2 years ago • 6 comments

Version

1.0.1

Environment that reproduces the issue

"react-native": "0.69.4", "@api.video/react-native-player": "^1.0.1",

Is it reproducible in the example application?

Yes

Reproduction steps

demo: https://drive.google.com/file/d/1IvTTAbM1jnXvr2WqAa4jY2wedXrrdO1X/view?usp=share_link

Expected result

NONE

Actual result

NONE

Additional context

No response

Relevant logs output

No response

bilal-prog avatar Mar 20 '23 15:03 bilal-prog

Hi @bilal-prog We were not able to reproduce your issue. Can you send us the relevant part of your code?

olivier-lando avatar Mar 23 '23 16:03 olivier-lando

<VideoPlayer ref={ref} muted={isMuted} videoParams={video?.videoParams} autoplay={false} videoId={video?.videoId} onPlay={() => setIsPlaying(true)} onPause={() => setIsPlaying(false)} onReady={() => setIsReady(true)} onVolumeChange={volume => { console.log( =====================onVolumeChange: ${volume}===================, ); }} onError={e => console.log('video e', e)} />

bilal-prog avatar Apr 19 '23 11:04 bilal-prog

useEffect(() => { //request full screen when it's playing (working on ios / it works in second time for android not in the first time) if (isPalying) { setTimeout(() => ref.current?.requestFullscreen(), 100); } }, [isPalying]);

bilal-prog avatar Apr 19 '23 11:04 bilal-prog

Hi @olivierapivideo the problem is in requestFullScreen() method (I think it's a bug in react-native-webveiw)

bilal-prog avatar Apr 19 '23 11:04 bilal-prog

I had the same issue. It may be a platform limitation, not sure.

I ended up adding an inline player on Android, and the user has to click fullscreen from there if they want it.

I do wish the maintainers would weigh in.

charlestbell avatar May 30 '24 19:05 charlestbell

Hi there,

First of all, we're sorry it's taken so long to respond to this issue.

Unfortunately, this problem cannot be corrected at present. Using a webview on Android requires the user to have interacted with its content before executing a requestFullscreen. This is a browser security issue that cannot be overridden. In the coming weeks, we plan to release a major version of the RN player based not on a webview but on our 2 native players for Android and IOS. This migration will fix the issues with such restrictions.

We apologize for the inconvenience.

olivier-lando avatar Jul 17 '24 12:07 olivier-lando