问题
I have been searching something useful so that I can play the youtube in my iOS app, just like the You tube app.
But stuck with using the Youtube API. I have been in development field from last 6 Months. Don't know, Javascript and other.
I read Youtube Api documentation(As, I couldn't find useful to play youtube videos on Google. as there some changes in the api implementation after aouth 2.0 , and all code are prior 5.0 on internet ).
And whatever I read in the Youtube API DOCS, I believe I understood only 30-40% (may be because I never did my hands dirty with any other APIs or may be I don't know what exactly to use from API Documents) .
I read few things about iframe. But Dont know How exactly to use them.
Please, If any body has gone through the same problem, Then please guide me. Feels like Hell from Last 2 days.
回答1:
To play YouTube videos in your iOS app use these steps:
- Add MediaPlayer framework in your XCode project.
- Import MediaPlayer.h in your class.
Use below code to play video.
MPMoviePlayerViewController *movieController=[[MPMoviePlayerViewController alloc]initWithContentURL:VideoUrl]; [self presentMoviePlayerViewControllerAnimated:movieController]; [movieController.moviePlayer play];
回答2:
You can use UIWebView
to play youtube videos in ypur app .
来源:https://stackoverflow.com/questions/22498721/integration-of-youtube-in-my-ios-app