How to play youtube video using MPMoviePlayerController?

Monika Patel

I want to play video of youtube url. I'm using below code but it is not working.

-(void)playVideoFromURL
{
    NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%s","https://www.youtube.com/embed/96ReVjMAXEE?autoplay=1&vq=small"]];
    self.videoController = [[MPMoviePlayerController alloc] initWithContentURL:url];
    [self.videoController setControlStyle:MPMovieControlStyleNone];
    self.videoController.repeatMode=MPMovieRepeatModeOne;
    self.videoController.fullscreen=YES;
    self.videoController.scalingMode=MPMovieScalingModeFill;
    self.videoController.view.frame=CGRectMake(0,0,self.videoplayview.frame.size.width, self.videoplayview.frame.size.height);
    [self.videoplayview addSubview:self.videoController.view];
    [self.videoController play];
}
Yogesh Mv

You cannot play a YouTube vidoe URL in MPMoviePlayerController. For this you have to use

youtube-iso-player-helper - But you cannot play private video URL in youtube-iso-player-helper

XCDYoutubeKit - It is against YouTube Terms and Service.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

To play video in MPMoviePlayerController using URL - iOS

From Dev

how to play youtube video using jwplayer in ios ?

From Dev

How to play a video with the YouTube API using YouTubePlayerFragment?

From Dev

Playing youtube video with MPMoviePlayerController

From Dev

How to play youtube video?

From Dev

How to play youtube video?

From Dev

Play a Youtube video using JavaFX

From Dev

MPMoviePlayerController doesn't play video

From Dev

How to add a button to play YouTube video full screen using JavaScript?

From Dev

How to play video using Youtube Data API v3 and video id in Windows Universal App

From Dev

MPMoviePlayerController streaming video not play Audio on iPad

From Dev

How to play YouTube video in WebView on Google Glass

From Dev

How to play youtube video in UIWebView muted?

From Dev

How to play a youtube video in ember application

From Dev

How to play and pause a Youtube video in the console?

From Dev

How to play youtube video upon click of an image?

From Dev

How to play YouTube video in WebView on Google Glass

From Dev

how to play Youtube Video in VLC Player

From Dev

How to play youtube video in UIWebView muted?

From Dev

How to make a Youtube player popout and play a video?

From Dev

Play youtube video in Background using YouTube Helper Library iOS

From Dev

How to rotate a video 90º in MPMovieplayercontroller

From Dev

How to rotate a video 90º in MPMovieplayercontroller

From Dev

i play a video stored in a subfolder in ios6 documents using MPMoviePlayerController ,but it doesn't work

From Dev

Youtube restricted video play

From Dev

how to show only list of video links and play using Youtube Searching API

From Dev

Using YTPlayerView to play embedded YouTube video in iOS failed with restriction error

From Dev

Play private YouTube video using YoutubePlayerView from YoutubeAndroidPlayerAPI?

From Dev

Is it possible to play a video file (eg .avi) using youtube player?

Related Related

  1. 1

    To play video in MPMoviePlayerController using URL - iOS

  2. 2

    how to play youtube video using jwplayer in ios ?

  3. 3

    How to play a video with the YouTube API using YouTubePlayerFragment?

  4. 4

    Playing youtube video with MPMoviePlayerController

  5. 5

    How to play youtube video?

  6. 6

    How to play youtube video?

  7. 7

    Play a Youtube video using JavaFX

  8. 8

    MPMoviePlayerController doesn't play video

  9. 9

    How to add a button to play YouTube video full screen using JavaScript?

  10. 10

    How to play video using Youtube Data API v3 and video id in Windows Universal App

  11. 11

    MPMoviePlayerController streaming video not play Audio on iPad

  12. 12

    How to play YouTube video in WebView on Google Glass

  13. 13

    How to play youtube video in UIWebView muted?

  14. 14

    How to play a youtube video in ember application

  15. 15

    How to play and pause a Youtube video in the console?

  16. 16

    How to play youtube video upon click of an image?

  17. 17

    How to play YouTube video in WebView on Google Glass

  18. 18

    how to play Youtube Video in VLC Player

  19. 19

    How to play youtube video in UIWebView muted?

  20. 20

    How to make a Youtube player popout and play a video?

  21. 21

    Play youtube video in Background using YouTube Helper Library iOS

  22. 22

    How to rotate a video 90º in MPMovieplayercontroller

  23. 23

    How to rotate a video 90º in MPMovieplayercontroller

  24. 24

    i play a video stored in a subfolder in ios6 documents using MPMoviePlayerController ,but it doesn't work

  25. 25

    Youtube restricted video play

  26. 26

    how to show only list of video links and play using Youtube Searching API

  27. 27

    Using YTPlayerView to play embedded YouTube video in iOS failed with restriction error

  28. 28

    Play private YouTube video using YoutubePlayerView from YoutubeAndroidPlayerAPI?

  29. 29

    Is it possible to play a video file (eg .avi) using youtube player?

HotTag

Archive