Due to legal restrictions I need to avoid that the user of my App can skip the content that is currently playing by AVPlayerViewController.
To do so, I am setting false to the properties isSkipBackwardEnabled and isSkipForwardEnabled. But this does not seems to have any effect on the skipping behaviour, I can still click left or right on Siri Remote to seek 10 seconds back or forward.
This there a way to prevent skipping content in AVPlayerViewController?
You can find right below an example code reproducing the issue:
To do so, I am setting false to the properties isSkipBackwardEnabled and isSkipForwardEnabled. But this does not seems to have any effect on the skipping behaviour, I can still click left or right on Siri Remote to seek 10 seconds back or forward.
This there a way to prevent skipping content in AVPlayerViewController?
You can find right below an example code reproducing the issue:
Code Block import UIKit import AVFoundation import AVKit class ViewController: AVPlayerViewController { override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) skippingBehavior = .default isSkipBackwardEnabled = false isSkipForwardEnabled = false play(stream: URL(string: "https://devstreaming-cdn.apple.com/videos/streaming/examples/img_bipbop_adv_example_ts/master.m3u8")!) } // MARK: - Private private func play(stream: URL) { let asset = AVAsset(url: stream) let playetItem = AVPlayerItem(asset: asset) player = AVPlayer(playerItem: playetItem) player?.play() } }