I want to play youtube videos in my iOS App,I saw that there are many options like embedding video and all in UIWebview
.But i want it like a player.When i click the button then it opens new page and the video should play .
I even searched in google then i heard about this control
"XCDYouTubeVideoPlayerViewController-master" When i integrate this to my project
like
inside my youtube.m
file
in viewdidAppear()
i have added this code
XCDYouTubeVideoPlayerViewController *videoPlayerViewController = [[XCDYouTubeVideoPlayerViewController alloc] initWithVideoIdentifier:@"9bZkp7q19f0"];
[self presentMoviePlayerViewControllerAnimated:videoPlayerViewController];
and then it opening a video player and within seconds the video player closing .Its not playing anything.
When i tried to embed video
webView.frame=CGRectMake(0,0,self.view.frame.size.width, self.view.frame.size.height);
NSLog(@"%@",sharedManager.trailerLink);
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:sharedManager.trailerLink]]];
am getting a window like youtube mobile site please check image.i want only one video in my screen .
Please help me