Skip to content

Instantly share code, notes, and snippets.

View unferna's full-sized avatar
:shipit:
Coding!

Fernando Florez Gomez unferna

:shipit:
Coding!
View GitHub Profile
@Ali72
Ali72 / CoreMediaError.swift
Last active May 17, 2024 15:38
AVPlayer CoreMedia Errors
/**
-NOTE:
After AVPlayerItem faces an error you can create CoreMedia Error from the underlying Error inside AVPlayerItem error.
With the `CoreMediaError` enum, you can convert errors to more readable ones,handle AVPlayerItem Common errors,
and show the proper messages to your users.
**/
public enum CoreMediaError:Error {
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],