Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bilal-prog opened this issue Mar 20, 2023 · 6 comments
Open

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

bilal-prog opened this issue Mar 20, 2023 · 6 comments
Labels

Comments

@bilal-prog
Copy link

bilal-prog commented Mar 20, 2023

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 bilal-prog added the bug Something isn't working label Mar 20, 2023
@olivierapivideo
Copy link
Member

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

@bilal-prog
Copy link
Author

bilal-prog commented Apr 19, 2023

<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
Copy link
Author

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
Copy link
Author

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

@bilal-prog bilal-prog changed the title [Bug]: Can't enable or disable fullscreen mode on Android [Bug]: Can't call requestFullScreen() method on Android Apr 19, 2023
@charlestbell
Copy link

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.

@olivierapivideo
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants