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.

iOS Fullscreen with Controls Crash

See original GitHub issue

@ashnfb @cobarx

Current 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:closed
  • Created 4 years ago
  • Reactions:12
  • Comments:25 (3 by maintainers)

github_iconTop GitHub Comments

8reactions
joemewescommented, Nov 4, 2019

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 to true the simulator throws the following error:

Error setting property 'fullscreen' of RCTVideo with tag #3: Exception thrown while executing UI block: Application tried to present modally an active controller <UIViewController: 0x7fabe8c0fea0>.
  • with controls set to false 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 via dismissFullscreenPlayer().

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.

3reactions
skykingitcommented, Apr 25, 2020

i have the same error on IOS, but when i set control={false},it works for me when can fix the issues?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Safari crashes in full screen mode - Apple Support Communities
When I enter full screen mode in youtube something crashes and youtube refreshes, playing only the audio of the video.
Read more >
AVPlayer crash when resizing window during fullscreen while ...
When resizing the window at this point will cause a crash in the AVKit framework (I believe). Using Swift 2.3, Xcode 7.3.1. My...
Read more >
iPhone X (and similar) fullscreen Video playback - StatusBar ...
Compile your App for iOS · Run your App on iPhoneX simulator. · Expand video to full screen, rotate phone left or right,...
Read more >
Full screen media player in iOS 16 beta, very inaccessible
I've also encountered some unlabeled buttons throughout the player. I did create a bug report in the Feedback application. It is FB10416635 ( ......
Read more >
Ouch, Safari on iOS can overlap multiple full-screen videos
... of Safari on iOS: full-screen videos can overlap each other and make ... to close it since sometimes this behavior makes Safari...
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