PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, September 28, 2022

[FIXED] How to include 1x 1080p and 2x 4K video assets for tvOS

 September 28, 2022     asset-catalog, tvos     No comments   

Issue

I have an app that plays videos using AVFoundation APIs. These videos are currently placed into the project as separate files. They're 1080p videos, but now I have new 4K versions that I would like to use when the app is run on 4K Apple TVs, and it should continue using the 1080p assets on HD Apple TVs. I don't want both resolutions included in the app as that would dramatically increase the download size. App thinning does this for image assets placed in the asset catalog for 1x and 2x scales, but unfortunately it seems this isn't available for videos. Is there a way to provide 1x and 2x video assets such that the appropriate resolution is provided based on the Apple TV hardware downloading the app? Perhaps with on-demand resources? I do want the assets to always be available - the user shouldn't have to download them after the app is installed.


Solution

In response to feedback I submitted, I was informed this is possible if you use a Data Asset in Asset Catalog and the NSDataAsset API to retrieve the video. Tag the 4K version of the asset with the “APPLE 3” graphics feature class and put the 1080p version in the Any/Any slot. This will ensure the 4K version of the video asset is included for 4K Apple TV devices and the 1080p version is included for the others.



Answered By - Jordan H
Answer Checked By - Timothy Miller (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing