Post

Replies

Boosts

Views

Activity

Identify AppleTv device by its Model Id
Device Id has always been different for devices with different hardware specs, unfortunately this is not the case for the last release Apple TV 4K (3rd generation). Is there a way to identify this new Apple TV on its two different versions (with or without Ethernet)? The issue is that they both have the same Device Id (AppleTv14.1). The difference between them is in Model Id (A2737 vs A2843). Any idea about how to get this Model Identifier? More info: https://en.wikipedia.org/wiki/Apple_TV#Technical_specifications
0
0
1.4k
Feb ’23
Identify Dolby audio tracks in a AVAssetMediaSelectionGroup
In order to provide to our users more information about the different audio tracks available in our streams, I am trying to identify Dolby audio tracks from the AVAssetMediaSelectionGroup that I get from the asset. To do that, I am trying to get the audio codec from each AVMediaSelectionKeyValueOption. That way, from the codec, I could identify this track as Dolby, Stereo, etc... Sadly, I did not find this information available in AVMediaSelectionKeyValueOption. Is there some way that I could use to get this data? For the log, this is I am currently able to get from each media selection: (lldb) po playerItem.asset.mediaSelectionGroup(forMediaCharacteristic: .audible) ▿ Optional<AVMediaSelectionGroup>   - some : <AVAssetMediaSelectionGroup: 0x28306fa00, options = (     "<AVMediaSelectionKeyValueOption: 0x28306d480, language = en, mediaType = 'soun', title = English, default = YES>",     "<AVMediaSelectionKeyValueOption: 0x28306d380, language = nar, mediaType = 'soun', title = Other (nar)>" ), allowsEmptySelection = YES>
2
0
1.1k
Oct ’21
Implementing iPod wheel style scrubbing gesture with the new Siri Remote
I am trying to implement the new iPod wheel style scrubbing gesture that was recently added to AVPlayerController on my custom Player UI built on top of AVPlayer . I can not find any new API reporting this kind of gestures from the remote control, is there some API that I am missing that is actually reporting these gestures? Otherwise, how would you recommend to implement something like that? Should I use the GameController SDK in order to get the actual position of the user's finger?
1
0
1.2k
Jun ’21
How to get initial buffer size of AVPlayer
In order to measure the quality of service of video playback in my App, I need to measure the initial buffer size of AVPlayer when the content actually start playing. To do so, I am adding a one-time periodic time observer to the first millisecond of the playback and inspecting from there the property segmentsDownloadedDuration of the last AVPlayerItemAccessLogEvent. Sadly the values that I am getting with this approach don't match the values that I see server-side. Server-side, if I multiply the numbers of segments initially requested by segments duration, the value that I get mismatch by up to 6 seconds compared with the reports from my client App. Is there any better approach for getting this data? Is there something we might be missing or doing wrong? You can find here below an example of the client approach: import UIKit import AVFoundation class PlaygroundViewController: UIViewController {     override func viewDidLoad() { &#9;&#9;&#9;&#9;super.viewDidLoad()         let videoURL = URL(string: "https://devstreaming-cdn.apple.com/videos/streaming/examples/img_bipbop_adv_example_ts/master.m3u8")!         // Setup Player Layer         playerLayer = AVPlayerLayer(player: player)         playerLayer.frame = view.bounds         view.layer.addSublayer(playerLayer)         // Setup Player Item         let asset = AVAsset(url: videoURL)         playerItem = AVPlayerItem(asset: asset)         // Setup AVPlayer         player = AVPlayer(playerItem: playerItem)         // Setup one time observer         var contentStartedObserver: Any?         contentStartedObserver = player?.addPeriodicTimeObserver(forInterval: CMTimeMake(value: 1, timescale: 1000), queue: DispatchQueue.main, using: {             [weak self] _ in             print("Content Started Playing")             guard let accessLog = self?.playerItem.accessLog() else { return }             guard let lastEvent = accessLog.events.last else { return }             print(">> Buffered Duration:")             print(lastEvent.segmentsDownloadedDuration)             // Ok, we are done. Remove the observer &#9;&#9;&#9;&#9;&#9;&#9;self?.player?.removeTimeObserver(contentStartedObserver)         })         // Play         playerLayer.player = player         player.play()     }     // MARK: - Private     private var playerLayer: AVPlayerLayer!     private var player: AVPlayer!     private var playerItem: AVPlayerItem! }
0
0
2.1k
Jan ’21