question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

expo-av useNativeControls not displayed with iOS 14

See original GitHub issue

🐛 Bug Report

Summary of Issue

On iOS 14, the video player setup with useNativeControls is not displaying anything.

I have tried to update expo-av to version 8.6 to see if it fixes it but same result.

Edit: after working on a workaround, it seems that only the initial play button is not rendering. But once the video is launched, all controls are visible. So my work around was a simple implementation of the play button to trigger the initial start. Then the controls are displayed again.

Environment - output of expo diagnostics & the platform(s) you’re targeting

Expo CLI 3.27.4 environment info: System: OS: macOS 10.15.6 Shell: 5.7.1 - /bin/zsh Binaries: Node: 12.14.0 - /usr/local/bin/node Yarn: 1.21.1 - /usr/local/bin/yarn npm: 6.13.4 - /usr/local/bin/npm SDKs: iOS SDK: Platforms: iOS 13.7, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2 IDEs: Xcode: 11.7/11E801a - /usr/bin/xcodebuild npmPackages: expo: ^38.0.0 => 38.0.8 react: 16.11.0 => 16.11.0 react-dom: 16.11.0 => 16.11.0 react-native: https://github.com/expo/react-native/archive/sdk-38.0.0.tar.gz => 0.62.2 react-native-web: ~0.11.7 => 0.11.7 npmGlobalPackages: expo-cli: 3.27.4 Expo Workflow: managed

Targeting iOS 14.

Reproducible Demo

Using the <Video/> component with a remote URL as the source. No local file.

Steps to Reproduce

Using the <Video/> component with a remote URL as the source. No local file.

Expected Behavior vs Actual Behavior

Video native controls are not displayed.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:10
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
fabioknoedtcommented, Nov 10, 2020

I am experiencing the same in iOS 14.1 (both device and simulator). The controls are not shown with the flag useNativeControls set to true.

4reactions
hanayashikicommented, Sep 30, 2020

Same issue here. 14.0 Simulator on iPhone X

The workaround works. Maybe this is an AVPlayerViewController bug

    const [shouldPlay, setShouldPlay] = useState(false);
    const videoRef = useRef<Video>();

    const videoPlayer = () => (
        <View>
            <Video
                {...{
                    source: { uri: menu?.video },
                    resizeMode: "stretch",
                    useNativeControls: true,
                    style: localStyles.video,
                    shouldPlay: shouldPlay,
                    ref: ref => videoRef.current = ref
                }}
            />
            { !shouldPlay && <View style={[StyleSheet.absoluteFill, styles.flexCenter]}>
                <TouchableOpacity onPress={() => setShouldPlay(true)}>
                    <Image
                        source={require("app/assets/images/icons/play.png")}
                        style={{ opacity: 0.5, height: 100, width: 100 }}
                    />
                </TouchableOpacity>
            </View>
            }
        </View>
    )
Read more comments on GitHub >

github_iconTop Results From Across the Web

expo-av Video not showing up on iOS but working on Android
The problem was video format. Check what video format is uploaded/ played, guys. The video I was trying to play on iOS was...
Read more >
expo-av Video not showing up on iOS but working on Android
Video and video player is loading fine on Android, but on iOS nothing is rendered. I'm using Video from expo-av. I tried adding...
Read more >
Video - Expo Documentation
This presents a fullscreen view of your video component on top of your app's UI. Note that even if useNativeControls is set to...
Read more >
expo-av | Yarn - Package Manager
Fix stability issues when changing source and/or useNativeControls on iOS. · Fix stability issue due to player-item observers not cleaned up on iOS....
Read more >
How to Create a React Native Video Player Using Expo
The Video component is a component from expo-av that displays a video in line ... While the video is loading, the Video component...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found