Skip to content

Commit f745a14

Browse files
sharnikfreeboub
andauthored
Syntax cleanup
Co-authored-by: Olivier Bouillet <62574056+freeboub@users.noreply.github.com>
1 parent b0529e7 commit f745a14

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

ios/Video/Features/RCTPlayerObserver.swift

+2-6
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,6 @@ class RCTPlayerObserver: NSObject, AVPlayerItemMetadataOutputPushDelegate, AVPla
331331
willBeginFullScreenPresentationWithAnimationCoordinator coordinator: UIViewControllerTransitionCoordinator
332332
) {
333333
self._handlers?.handleWillEnterFullScreen()
334-
335334
coordinator.animate(alongsideTransition: nil) { [weak self] context in
336335
guard let self, !context.isCancelled else { return }
337336
self._handlers?.handleDidEnterFullScreen()
@@ -343,18 +342,15 @@ class RCTPlayerObserver: NSObject, AVPlayerItemMetadataOutputPushDelegate, AVPla
343342
willEndFullScreenPresentationWithAnimationCoordinator coordinator: UIViewControllerTransitionCoordinator
344343
) {
345344
self._handlers?.handleWillExitFullScreen()
346-
347345
// iOS automatically pauses videos after exiting fullscreen,
348346
// but it's better if we resume playback
349347
let wasPlaying = player?.timeControlStatus == .playing
350-
351348
coordinator.animate(alongsideTransition: nil) { [weak self] context in
352349
guard let self, !context.isCancelled else { return }
353350
self._handlers?.handleDidExitFullScreen()
354-
355-
if (wasPlaying) {
351+
if (wasPlaying == true) {
356352
self.player?.play()
357-
}
353+
}
358354
}
359355
}
360356

0 commit comments

Comments
 (0)