Skip to content

Commit

Permalink
Add missing @MainActor decorators
Browse files Browse the repository at this point in the history
  • Loading branch information
123mpozzi committed Nov 22, 2024
1 parent e0ff572 commit ea13ad8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ios/FullscreenHandlerModule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,22 @@ public class FullscreenHandlerModule: NSObject, RCTBridgeModule {
fullscreenHandlers.removeValue(forKey: nativeId)
}

@MainActor
@objc(onFullscreenChanged:isFullscreenEnabled:)
func onFullscreenChanged(_ nativeId: NativeId, isFullscreenEnabled: Bool) -> Any? {
fullscreenHandlers[nativeId]?.isFullscreen = isFullscreenEnabled
fullscreenChangeDispatchGroup.leave()
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
Expand Down
1 change: 1 addition & 0 deletions ios/RNPlayerViewManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit ea13ad8

Please sign in to comment.