Skip to content

After exiting fullscreen, the video remains in the "expanded" size #32

Open
@bpark93

Description

@bpark93

Describe the bug
After I exit out of fullscreen in landscape mode, the youtube video retains the "landscape fullscreen" size. The app also freezes, and all parts of the app except the video becomes untouchable. Even in portrait mode, after exiting fullscreen, the play/pause button is no longer there, and other UI buttons can be seen to be increased in size.

To Reproduce
Exit out of fullscreen in both portrait mode and landscape mode.

Expected behavior
The video should revert back to its original size when exiting fullscreen.

Screenshots
https://streamable.com/y9238r
https://streamable.com/xmxjev

Smartphone (please complete the following information):

  • Device: Reproduced in Android emulator: pixel 2, Physical phones: Oneplus 6, iPhone 8
  • OS + version:
  • react-native-youtube-iframe version : "^1.2.4"
  • react-native-webview version: "8.1.1"
  • Expo verison [if using expo]: "~37.0.3"

Additional context
When reproducing the bug on landscape mode, I get a Warning message from expo: "State updates from the useState() and useReducer() Hooks don't support the second callback...". I can't even expand the warning as it also becomes unresponsive to touch.

Code

import YoutubePlayer from 'react-native-youtube-iframe';

const App = () => {
    const playerRef = useRef(null);
    const [playing, setPlaying] = useState(true);
    const width = useWindowDimensions().width
    const height = width*9/16;

    return (
        <YoutubePlayer
                ref={playerRef}
                height={height}
                width={width}
                videoId={id.video}
                play={playing}
                volume={50}
                playbackRate={1}
                playerParams={{
                    cc_lang_pref: "us",
                    showClosedCaptions: false,
                }}
        />
    )
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions