Skip to content

Commit

Permalink
Patch commit to fix the error:
Browse files Browse the repository at this point in the history
  Implicit use of 'self' in closure; use 'self.' to make capture semantics explicit
  • Loading branch information
dibyendu committed Jun 6, 2024
1 parent 8693dbc commit 5edde97
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions ios/Video/NowPlayingInfoCenterManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class NowPlayingInfoCenterManager {
guard let self, let player = self.currentPlayer else {
return .commandFailed
}
let newTime = player.currentTime() - CMTime(seconds: SEEK_INTERVAL_SECONDS, preferredTimescale: .max)
let newTime = player.currentTime() - CMTime(seconds: self.SEEK_INTERVAL_SECONDS, preferredTimescale: .max)
player.seek(to: newTime)
return .success
}
Expand All @@ -160,7 +160,7 @@ class NowPlayingInfoCenterManager {
return .commandFailed
}

let newTime = player.currentTime() + CMTime(seconds: SEEK_INTERVAL_SECONDS, preferredTimescale: .max)
let newTime = player.currentTime() + CMTime(seconds: self.SEEK_INTERVAL_SECONDS, preferredTimescale: .max)
player.seek(to: newTime)
return .success
}
Expand Down Expand Up @@ -266,15 +266,15 @@ class NowPlayingInfoCenterManager {

// case where there is new player that is not paused
// In this case event is triggered by non currentPlayer
if rate != 0 && currentPlayer != player {
setCurrentPlayer(player: player)
if rate != 0 && self.currentPlayer != player {
self.setCurrentPlayer(player: player)
return
}

// case where currentPlayer was paused
// In this case event is triggeret by currentPlayer
if rate == 0 && currentPlayer == player {
findNewCurrentPlayer()
if rate == 0 && self.currentPlayer == player {
self.findNewCurrentPlayer()
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions ios/Video/RCTVideo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH
guard let self else { throw NSError(domain: "", code: 0, userInfo: nil) }

let playerItem = try await self.preparePlayerItem()
try await setupPlayer(playerItem: playerItem)
try await self.setupPlayer(playerItem: playerItem)
} catch {
DebugLog("An error occurred: \(error.localizedDescription)")

Expand Down Expand Up @@ -763,7 +763,7 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH
guard let self else { return }

self._playerObserver.addTimeObserverIfNotSet()
self.setPaused(_paused)
self.setPaused(self._paused)
self.onVideoSeek?(["currentTime": NSNumber(value: Float(CMTimeGetSeconds(item.currentTime()))),
"seekTime": seekTime,
"target": self.reactTag])
Expand Down
2 changes: 1 addition & 1 deletion ios/Video/RCTVideoManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class RCTVideoManager: RCTViewManager {
let view = self.bridge.uiManager.view(forReactTag: reactTag)

guard let videoView = view as? RCTVideo else {
DebugLog("Invalid view returned from registry, expecting RCTVideo, got: \(String(describing: view))")
DebugLog("Invalid view returned from registry, expecting RCTVideo, got: \(String(describing: self.view))")
callback(nil)
return
}
Expand Down

0 comments on commit 5edde97

Please sign in to comment.