mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-01-11 20:10:25 +00:00
Merge branch 'main' of https://github.com/tapframe/NuvioStreaming
This commit is contained in:
commit
c6e55429e4
1 changed files with 22 additions and 0 deletions
|
|
@ -25,6 +25,7 @@ class KSPlayerView: UIView {
|
|||
@objc var onEnd: RCTDirectEventBlock?
|
||||
@objc var onError: RCTDirectEventBlock?
|
||||
@objc var onBufferingProgress: RCTDirectEventBlock?
|
||||
@objc var onExitFullscreen: RCTDirectEventBlock?
|
||||
|
||||
// Property setters that React Native will call
|
||||
@objc var source: NSDictionary? {
|
||||
|
|
@ -313,6 +314,22 @@ class KSPlayerView: UIView {
|
|||
} else {
|
||||
playerView.play()
|
||||
}
|
||||
}
|
||||
|
||||
override var keyCommands: [UIKeyCommand]? {
|
||||
return [
|
||||
UIKeyCommand(
|
||||
input: UIKeyCommand.inputEscape,
|
||||
modifierFlags: [],
|
||||
action: #selector(handleEscapeKey),
|
||||
discoverabilityTitle: "Exit Fullscreen"
|
||||
)
|
||||
]
|
||||
}
|
||||
|
||||
@objc func handleEscapeKey() {
|
||||
print("KSPlayerView: ESC pressed")
|
||||
sendEvent("onExitFullscreen", [:])
|
||||
}
|
||||
|
||||
func setVolume(_ volume: Float) {
|
||||
|
|
@ -979,3 +996,8 @@ extension KSPlayerView {
|
|||
}
|
||||
}
|
||||
|
||||
extension IOSVideoPlayerView {
|
||||
@objc func handleEscapeKey() {
|
||||
self.next?.perform(#selector(handleEscapeKey))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue