Post

Replies

Boosts

Views

Activity

Touch events not working on tvOS w/ AVPlayerViewController
The observed behavior appears to be related to the changes made to AVPlayerViewController in tvOS 13. On tvOS 12, touchesBegan is called whenever the center of the remote gets an indirect select touch gesture. (Not a click; just resting a finger on the remote without pressure). On tvOS 13 and beyond, the view controller no longer gets touch events. How can a parent view controller get an indirect UITouch events that has an AVPlayerViewController subview? Additional Notes Adding a custom UITapGestureRecongnizer did not work. It appears that AVPlayerViewController intercepts the gesture and never passes it on to the next responder. Embedding the AVPlayerViewController as a child did not work and is excluded from the sample code for simplicity pressesBegan on tvOS 13 gets called for indirect touches (not a press). It's not clear whether an event is a indirect or direct. import UIKit import AVKit class ViewController: UIViewController {   private var playerViewController: AVPlayerViewController!   override func viewDidLoad() {     super.viewDidLoad()     playerViewController = AVPlayerViewController()     playerViewController.player = AVPlayer(url: url)     playerViewController.player?.play()     view.addSubview(playerViewController.view)     playerViewController.view.frame = view.bounds   }   override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {     super.touchesBegan(touches, with: event)     print(#function) // Not called on tvOS 14 or tvOS 13   } } private let url = URL(string: "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4")!
0
0
730
Nov ’20
AVPlayer initial left select gesture on Siri remote jumps to beginning
Radar-AVPlayer-early-skip-backwards Project created to report a bug on making a left-select gesture on the Siri remote to jump back 10 seconds in a live stream but then going to the beginning of the stream. !avplayer-left-click - https://github.com/break2k/Radar-AVPlayer-early-skip-backwards/blob/master/preview/radar-avplayer-left-click.gif Example Project: https://github.com/break2k/Radar-AVPlayer-early-skip-backwards/edit/master/README.md Description When an AVPlayer returns the status .readyToPlay, a user should be able to make a click on the left side of the Siri remote to jump back 10 seconds. Unfortunately, it will jump to the beginning of the stream. Background Our live stream has the possibility to scrub back 3600 seconds (1 hour). So, the live position when tuned into the stream is the AVPlayerItem currentTime of 3600. When we print the currentTime(), we can see that it is 0 as soon as we reproduce this bug. Expected Whenever a user clicks on the left side of the Siri remote (left-select), the AVPlayer should seek 10 seconds back. Except it in the pause state where the left and right-click gestures do nothing. Steps Start the app Instantly make click on the left side of the Siri remote. Environment Xcode Version 11.5 (11E608c) Apple TV 4K tvOS 13.4 (17L256)
0
0
443
Jul ’20