Upgrade to Pro — share decks privately, control downloads, hide ads and more …

AudioVisual Assets in Vidio App

AudioVisual Assets in Vidio App

This tech-talk will talk about how AVAsset can be played in Vidio iOS Application and other capabilities such as :
- Protecting DRM-Content
- Getting any subtitles and load into AVPlayer (iOS native Player)
- Connecting to AppleTV(AirPlay)
- and Download capabilities (this feature just spike and has not been implemented in Vidio iOS)

KMKLabs

May 10, 2019
Tweet

More Decks by KMKLabs

Other Decks in Programming

Transcript

  1. Overview • How to play media such as video in

    iOS app? ◦ What are relationship between AVPlayer, AVPlayerItem, and AVAsset? • What is AVAsset and AVURLAsset? • What does AVAsset do in Vidio? • How to play AVURLAsset in AVPlayer? • What is DRM Content ◦ How to play DRM Content in Client Side (iOS App) • How to get subtitles to load in AVPlayer? • How to connect with AirPlay?
  2. How to play media in iOS App • Use AVPlayer

    to play media assets, which AVFoundation models using the AVAsset class. • AVFoundation Framework, works with audiovisual assets, control device cameras, process audio, and configure system audio interactions.
  3. Relationship between AVPlayer, AVPlayerItem, and AVAsset (2) • AVPlayer is

    an object that provides the interface to control the player’s transport behavior. • AVPlayerItem is an object used to model the timing and presentation state of an asset played by the player. • AVAsset is The abstract class used to model audiovisual media such as videos and sounds.
  4. AVAsset • "The abstract class used to model timed audiovisual

    media such as videos and sounds." AVAsset is an abstract class, so when you create an asset as shown in the example, you’re actually creating an instance of one of its concrete subclasses called AVURLAsset.
  5. AVURLAsset • "A concrete subclass of AVAsset that's used to

    initialize an asset from a local or remote URL."
  6. AVAsset in Vidio App • Source of an Item to

    play (AVPlayer) • DRM Content • Get subtitles and load into AVPlayer • AirPlay • Download (coming soon)
  7. How to play AVAsset in AVPlayer • Instantiate an AVPlayer

    object either way with or without AVPlayerItem • Call replaceCurrentItem function • Call play function
  8. WHAT IS DRM? • “A set of access control technologies

    for restricting the use of proprietary hardware and copyrighted works to control the use, modification, and distribution”
  9. HOW TO PLAY DRM CONTENT IN CLIENT SIDE (iOS APP)

    FPS: FairPlay Streaming SPC: Server Playback Context CKC: Content Key Context
  10. HOW TO PLAY DRM CONTENT IN CLIENT SIDE (iOS APP)

    • Request FPSkey, get SPCMessage, and load CKC done by AVAssetResourceLoaderDelegate • AVAssetResourceLoader is a property that held by AVAsset
  11. • AVAsset has a function that returns a media selection

    group object that contains one or more options with the specified media characteristic. • AVMediaSelectionGroup is an object that represents a collection of mutually exclusive options for the presentation of media within an asset. How to get subtitles and load into AVPlayer
  12. How to connect with AirPlay (1) • Basically, AirPlay mirroring

    the AVURLAsset(the content) that in AVPlayer to AppleTV device. • So the only thing you need is implementing AVRoutePickerView in your View • AVRoutePickerView is an object that displays controls for picking playback routes.