Posts

Showing posts from June, 2015

Youtube Video Player

To play Youtube video within the app we have 2 ways: 1. Open Youtube App (if installed) or launch Safari to play video: [[ UIApplication sharedApplication ] openURL :[ NSURL URLWithString : @"http://www.youtube.com/watch?v=Xk1zfQOklJY" ]]; In this case we don't have a choice to bring back the user to our app. So we better use the 2nd way. 2. Embed Youtube iOS Player Helper: I have used  youtube-ios-player-helper  Version -  0.1.3 Select  YTPlayerView.h ,  YTPlayerView.m , and the  Assets  folder from my Github repository  CODE . Drag these files and folders into your project. Make sure the  Copy items into destination group’s folder  option is checked. When dragging the Assets folder, make sure that the  Create Folder References for any added folders  option is checked. Drag a UIView the desired size of your player onto your Storyboard. Change the UIView's class in the Identity Inspector tab to YTPlayerView Import "YTPlayerView.