Trying to customize AVPlayerView. Right now, J plays the video backwards, L plays it forwards. For the app I'm making, I'd like to disable these keys.
I thought the way to do this would be to subclass AVPlayerView. I found some code that allowed me to disable the scrollwheel, and it works. But when I try to use almost the same code to disable (in this case) the J key, the J key still plays the video backwards. Any idea what I should try? Thanks.
code so far: (I have this as a second class in my viewController file.)
I thought the way to do this would be to subclass AVPlayerView. I found some code that allowed me to disable the scrollwheel, and it works. But when I try to use almost the same code to disable (in this case) the J key, the J key still plays the video backwards. Any idea what I should try? Thanks.
code so far: (I have this as a second class in my viewController file.)
Code Block class CustomAVPlayerView : AVPlayerView { override func scrollWheel(with event: NSEvent) { if self.superview != nil { self.nextResponder?.scrollWheel(with: event) } } override func keyDown(with event: NSEvent) { if self.superview != nil { if event.keyCode == 38 { self.nextResponder?.keyDown(with: event) } } } }