TheWidlarzGroup / react-native-video

A <Video /> component for react-native
http://thewidlarzgroup.github.io/react-native-video/
MIT License
7.12k stars 2.88k forks source link

[BUG]: tvOS presentFullscreenPlayer() presents broken controls #3981

Open ashnfb opened 1 month ago

ashnfb commented 1 month ago

Version

6.3.0

What platforms are you having the problem on?

Apple tvOS

System Version

17.5.1

On what device are you experiencing the issue?

Real device

Architecture

Old archictecture. (I'm not clear what this indicates?)

What happened?

Two issues. Tested on a device.

  1. if presentFullscreenPlayer() is called on tvOS, the controls that become available, do not permit selection of the Captions and Audio selection menu using the Apple touch remote

  2. if controls={true} is included with presentFullscreenPlayer(), a white screen appears, with no video visible. Given that controls are always on with fullscreen iOS, controls={true} should be ignored

Reproduction

repository link

Reproduction

Step to reproduce this bug are:

import React from 'react';
import Video from 'react-native-video';

let videoContainer;

export default function App() {
  return (
    <>
      <Video
        ref={(ref) => {
          videoContainer = ref;
        }}
        // controls
        source={{
          uri: 'https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4',
        }}
        onLoad={() => { videoContainer.presentFullscreenPlayer()}}
        resizeMode={'contain'}
      />
    </>
  );
}
ashnfb commented 1 month ago

react-native-video-6.3.0.patch we comment out showsPlaybackControls in

    func createPlayerViewController(player: AVPlayer, withPlayerItem _: AVPlayerItem) -> RCTVideoPlayerViewController {
        let viewController = RCTVideoPlayerViewController()
        // viewController.showsPlaybackControls = self._controls

then the controls now work correctly, when the fullscreen is presented, and we can access the subtitle and audio menus

seyedmostafahasani commented 1 week ago

@ashnfb Please use this method. setFullScreen