I attributed the tag "tokyo" to my .mp4 video, and set it as installed during the app installation.
Originally, I was using a path to load it from my resources, however, now it's different because it's located in the Asset catalog.
After reading the documentation, I tried something like:
NSBundleResourceRequest(tags: ["tokyo"]).beginAccessingResourcesWithCompletionHandler { (error) -> Void in
let tokyoVideo = NSDataAsset(name: "tokyo")
}
To access this video as NSData I could use:
tokyoVideo.data
However, I'm using AVPlayer which takes the parameter as an NSURL, not NSData.
So how do I get the NSURL for my video? Is the Asset catalog only for storing Data and should I be using that to store my video, or is there a better alternative?
I think its possible to use Asset Catalog for video stuff, Its simplify management of images. Use NSDataAsset for it. Review the last row in below table.
Refer this link for more info
The following table lists the types of resources that can be tagged as on-demand resources.