iOS Fullscreen with Controls Crash
See original GitHub issueCurrent behavior
The following change crashes our current implementation on iOS: https://github.com/react-native-community/react-native-video/pull/1441/files#diff-42e8804735be64e84d6dd1fb103210a1R566 We display the video in full screen as soon as it is loaded. After updating this implementation crashes. A fix is not urgent for us, as we do not need the controls in non fullscreen mode on iOS. As a workaround we just disable the controls on iOS, which resolves the issue.
Reproduction steps
<Video source={this.props.source} resizeMode='contain' paused={false} repeat={false} controls={true} onLoad={() => this.player && this.player.presentFullscreenPlayer()} ref={this.handleRef} style={fullscreen} />
Additional info: We render the video in a react navigation dialog.
Expected behavior
It does not crash.
Platform
- iOS
Exception thrown while executing UI block: Application tried to present modally an active controller <XXX.ReactNativeViewController: 0x7ff09b6182c0>.
__44-[RCTUIManager flushUIBlocksWithCompletion:]_block_invoke
RCTUIManager.m:1112
__44-[RCTUIManager flushUIBlocksWithCompletion:]_block_invoke.461
__RCTExecuteOnMainQueue_block_invoke
_dispatch_call_block_and_release
_dispatch_client_callout
_dispatch_main_queue_callback_4CF
__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
__CFRunLoopRun
CFRunLoopRunSpecific
GSEventRunModal
UIApplicationMain
main
start
0x0
Issue Analytics
- State:
- Created 4 years ago
- Reactions:12
- Comments:25 (3 by maintainers)
We have this issue too when setting fullscreen via
presentFullscreenPlayer()
:Simulator/Device (iOS)
Tested with local .mp4, remote .mp4 and remote .m3u8.
with
controls
set totrue
the simulator throws the following error:controls
set tofalse
the simulator does not throw and error but the video loses frame playback and gets stuck, forcing faster playback/catchup when you programmatically dismiss full screen mode viadismissFullscreenPlayer()
.I’ve setup a test repo to reproduce and debug : https://github.com/4AllDigital/RNV-iOS
I’m happy to do any work/testing on this, but Im not an Objective-C developer and it seems that the issue is on that side, possibly around https://github.com/react-native-community/react-native-video/blob/master/ios/Video/RCTVideo.m#L1257, but I’d be guessing.
i have the same error on IOS, but when i set control={false},it works for me when can fix the issues?