Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.
brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus| - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
| { | |
| ... | |
| ... | |
| ... | |
| RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation | |
| moduleName:@"MyAwesomeApp" | |
| initialProperties:@{} | |
| launchOptions:launchOptions]; |
| # Get YouTube ID from various YouTube URL | |
| # Ruby port from JavaScript version: https://gist.github.com/takien/4077195/ | |
| def get_youtube_id(url) | |
| id = '' | |
| url = url.gsub(/(>|<)/i,'').split(/(vi\/|v=|\/v\/|youtu\.be\/|\/embed\/)/) | |
| if url[2] != nil | |
| id = url[2].split(/[^0-9a-z_\-]/i) | |
| id = id[0]; | |
| else |