0

I am looking for playing a remote mp4 video on tvOS with AVPlayer. (I am already successful in playing the video but there is one confusion) I have looked different forums and there is one method that i can use with AVURLAsset and the method is

 func loadValuesAsynchronouslyForKeys(_ keys: [String],
                   completionHandler handler: (() -> Void)?)

I have seen people are using playable, duration and tracks as keys. I don't know what these keys do. My question is that where i can check documentation for the different keys for this function.

Also i don't understand what this line means in apple documentation

A “key” is any property in a class that implements this protocol. 

https://developer.apple.com/library/prerelease/mac/documentation/AVFoundation/Reference/AVAsynchronousKeyValueLoading_Protocol/index.html#//apple_ref/occ/intfm/AVAsynchronousKeyValueLoading/loadValuesAsynchronouslyForKeys:completionHandler:

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Madu
  • 4,849
  • 9
  • 44
  • 78

1 Answers1

1

AVAsynchronousKeyValueLoading is a protocol implemented by a number of classes, including AVURLAsset which is what you are using. Therefore, you can check the documentation for AVURLAsset (and its parent class, AVAsset), where you will find the function of playable, tracks, duration and other keys.

Chris
  • 484
  • 5
  • 7