From fd38276b39c447ee58d5b7a490e204cd2b8291e8 Mon Sep 17 00:00:00 2001 From: YangJH Date: Wed, 8 Nov 2023 23:20:52 +0900 Subject: [PATCH] fix(ios): fix wrong react method definition --- ios/Video/RCTVideo.swift | 4 ++-- ios/Video/RCTVideoManager.m | 5 +++-- ios/Video/RCTVideoManager.swift | 12 ++++++------ 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/ios/Video/RCTVideo.swift b/ios/Video/RCTVideo.swift index 7696e7998b..b76e93a267 100644 --- a/ios/Video/RCTVideo.swift +++ b/ios/Video/RCTVideo.swift @@ -1069,11 +1069,11 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH _resouceLoaderDelegate?.setLicenseResultError(error, licenseUrl) } - func dismissFullscreenPlayer(_ error:String!) { + func dismissFullscreenPlayer() { setFullscreen(false) } - func presentFullscreenPlayer(_ error:String!) { + func presentFullscreenPlayer() { setFullscreen(true) } diff --git a/ios/Video/RCTVideoManager.m b/ios/Video/RCTVideoManager.m index a90a551251..8d04d5da6a 100644 --- a/ios/Video/RCTVideoManager.m +++ b/ios/Video/RCTVideoManager.m @@ -80,8 +80,9 @@ @interface RCT_EXTERN_MODULE(RCTVideoManager, RCTViewManager) RCT_EXTERN_METHOD(setPlayerPauseState:(nonnull NSNumber *)paused reactTag:(nonnull NSNumber *)reactTag) -RCT_EXTERN_METHOD(presentFullscreenPlayer - reactTag:(nonnull NSNumber *)reactTag) +RCT_EXTERN_METHOD(presentFullscreenPlayer:(nonnull NSNumber *)reactTag) + +RCT_EXTERN_METHOD(dismissFullscreenPlayer:(nonnull NSNumber *)reactTag) RCT_EXTERN_METHOD(dismissFullscreenPlayer reactTag:(nonnull NSNumber *)reactTag) diff --git a/ios/Video/RCTVideoManager.swift b/ios/Video/RCTVideoManager.swift index ef70eb5407..82851a1c7e 100644 --- a/ios/Video/RCTVideoManager.swift +++ b/ios/Video/RCTVideoManager.swift @@ -48,25 +48,25 @@ class RCTVideoManager: RCTViewManager { }) } - @objc(dismissFullscreenPlayer:reactTag:) - func dismissFullscreenPlayer(error: NSString, reactTag: NSNumber) -> Void { + @objc(dismissFullscreenPlayer:) + func dismissFullscreenPlayer(_ reactTag: NSNumber) -> Void { bridge.uiManager.prependUIBlock({_ , viewRegistry in let view = viewRegistry?[reactTag] if !(view is RCTVideo) { RCTLogError("Invalid view returned from registry, expecting RCTVideo, got: %@", String(describing: view)) } else if let view = view as? RCTVideo { - view.dismissFullscreenPlayer(error as String) + view.dismissFullscreenPlayer() } }) } - @objc(presentFullscreenPlayer:reactTag:) - func presentFullscreenPlayer(error: NSString, reactTag: NSNumber) -> Void { + @objc(presentFullscreenPlayer:) + func presentFullscreenPlayer(_ reactTag: NSNumber) -> Void { bridge.uiManager.prependUIBlock({_ , viewRegistry in let view = viewRegistry?[reactTag] if !(view is RCTVideo) { RCTLogError("Invalid view returned from registry, expecting RCTVideo, got: %@", String(describing: view)) } else if let view = view as? RCTVideo { - view.presentFullscreenPlayer(error as String) + view.presentFullscreenPlayer() } }) }