Video

public enum Video
extension Video: CustomStringConvertible
extension Video: RawRepresentable
extension Video: MediaSubtype
extension Video: Hashable

Represents the video media type. See the official documentation for details.

You typically use Video as a MediaType.

let video = Video.mp4()
let mediaType = MediaType.video(video) // Creates: video/mp4

You can use standard switch statement to access video values.

func isSupported(video: Video) -> Bool {
  switch video {
  case .mp4, .H264: return true
  default: return false
  }
}

isSupported(audio: .mp4()) // Returns: true
isSupported(audio: .H264()) // Returns: true
isSupported(audio: .vc1()) // Returns: false

See also

MediaType