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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AV][Video][iOS] presentFullscreenPlayer only works once in iOS #8239

Closed
zackify opened this issue May 10, 2020 · 1 comment 路 Fixed by #8343
Closed

[AV][Video][iOS] presentFullscreenPlayer only works once in iOS #8239

zackify opened this issue May 10, 2020 · 1 comment 路 Fixed by #8343

Comments

@zackify
Copy link
Contributor

zackify commented May 10, 2020

馃悰 Bug Report

Environment

Expo CLI 3.17.23 environment info:
System:
OS: macOS 10.15.4
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.16.1 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.13.4 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
IDEs:
Android Studio: 3.6 AI-192.7142.36.36.6308749
Xcode: 11.4.1/11E503a - /usr/bin/xcodebuild
npmPackages:
expo: ~37.0.3 => 37.0.5
react: ~16.9.0 => 16.9.0
react-native: https://github.com/expo/react-native/archive/sdk-37.0.0.tar.gz => 0.61.4
npmGlobalPackages:
expo-cli: 3.17.23

iOS, and android app targets

Steps to Reproduce

Use Expo video player. Call videoRef?.current?.presentFullscreenPlayer();

Close the player by tapping the close icon with native controls. Now call presentFullscreenPlayer again. On iOS it throws "Fullscreen player is already being presented"

On android it works perfectly. It will let me tap a button to go to full screen, close it, tap it again. Here's the full code inside a component

<Text
        onPress={async () => {
          await ScreenOrientation.lockAsync(
            ScreenOrientation.OrientationLock.LANDSCAPE_LEFT,
          );
          await videoRef?.current?.playAsync();
          videoRef?.current?.presentFullscreenPlayer();
        }}
      >
        Press for full screen and rotate
      </Text>
      <Video
        ref={videoRef}
        onFullscreenUpdate={async ({ fullscreenUpdate }) => {
          if (
            fullscreenUpdate === Video.FULLSCREEN_UPDATE_PLAYER_WILL_DISMISS
          ) {
            await ScreenOrientation.lockAsync(
              ScreenOrientation.OrientationLock.PORTRAIT_UP,
            );
          }
        }}
        source={{
          uri: data?.videoUrl as string,
        }}
        onLoad={() => setLoading(false)}
        rate={1.0}
        volume={1.0}
        isMuted={false}
        resizeMode="cover"
        useNativeControls
        shouldPlay={autoStart}
        style={{ width: '100%', height: 300, borderRadius: 8 }}
      />

Expected Behavior

Allow me to call present fullscreen a second time after the user closes the video.

Actual Behavior

Can only call the method one time, then it throws an error even when the video is no longer in full screen

Reproducible Demo

https://snack.expo.io/@zachrebuild/eager-waffle

This runs on ios just fine, but has an issue running on the snack player. just open it inside the expo app on your phone.

Tap the text. it works. close full screen. tap again. video does not enter full screen mode.

@IjzerenHein IjzerenHein self-assigned this May 11, 2020
@FiberJW FiberJW changed the title presentFullscreenPlayer only works once in iOS [AV][Video][iOS] presentFullscreenPlayer only works once in iOS May 15, 2020
@IjzerenHein
Copy link
Contributor

Hi! Thanks for reporting this. I've created PR #8343 that fixes this problem. 馃憤

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

Successfully merging a pull request may close this issue.

2 participants