Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ios): fix wrong react method definition (dismissFullscreenPlayer, presentFullscreenPlayer) #3338

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ios/Video/RCTVideo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
5 changes: 3 additions & 2 deletions ios/Video/RCTVideoManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should both of these be here?

Copy link
Collaborator Author

@YangJonghun YangJonghun Jan 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jordangrant-stadiumlive
It looks my mistake.
could you create PR to correct this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

posted: #3474

Expand Down
12 changes: 6 additions & 6 deletions ios/Video/RCTVideoManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
})
}
Expand Down