From ea13ad8517a453b76f9a11cf6fb3e722177f059d Mon Sep 17 00:00:00 2001 From: Michele Pozzi <123.mpozzi@gmail.com> Date: Fri, 22 Nov 2024 12:55:16 +0100 Subject: [PATCH] Add missing `@MainActor` decorators --- ios/FullscreenHandlerModule.swift | 3 +++ ios/RNPlayerViewManager.swift | 1 + 2 files changed, 4 insertions(+) diff --git a/ios/FullscreenHandlerModule.swift b/ios/FullscreenHandlerModule.swift index 963b0cbd..54ba2d16 100644 --- a/ios/FullscreenHandlerModule.swift +++ b/ios/FullscreenHandlerModule.swift @@ -44,6 +44,7 @@ public class FullscreenHandlerModule: NSObject, RCTBridgeModule { fullscreenHandlers.removeValue(forKey: nativeId) } + @MainActor @objc(onFullscreenChanged:isFullscreenEnabled:) func onFullscreenChanged(_ nativeId: NativeId, isFullscreenEnabled: Bool) -> Any? { fullscreenHandlers[nativeId]?.isFullscreen = isFullscreenEnabled @@ -51,12 +52,14 @@ public class FullscreenHandlerModule: NSObject, RCTBridgeModule { return nil } + @MainActor @objc(registerHandler:) func registerHandler(_ nativeId: NativeId) { guard fullscreenHandlers[nativeId] == nil else { return } fullscreenHandlers[nativeId] = FullscreenHandlerBridge(nativeId, bridge: bridge) } + @MainActor @objc(setIsFullscreenActive:isFullscreen:) func setIsFullscreenActive(_ nativeId: NativeId, isFullscreen: Bool) { fullscreenHandlers[nativeId]?.isFullscreen = isFullscreen diff --git a/ios/RNPlayerViewManager.swift b/ios/RNPlayerViewManager.swift index 96390e3f..99e96877 100644 --- a/ios/RNPlayerViewManager.swift +++ b/ios/RNPlayerViewManager.swift @@ -200,6 +200,7 @@ public class RNPlayerViewManager: RCTViewManager { bridge.module(for: FullscreenHandlerModule.self) as? FullscreenHandlerModule } + @MainActor private func maybeEmitPictureInPictureAvailabilityEvent(for view: RNPlayerView, previousState: Bool) { guard let playerView = view.playerView, playerView.isPictureInPictureAvailable != previousState else {