Stephan König
Stephan König

Reputation: 143

Youtube video not playing fullscreen on iPad

I have a problem here, which I couldn't find a solution yet.

In my app, I have a tableView which parses the youtube videos from my channel. If selecting an item, it pushes to a UIWebView, which shows the youtube website with my video embedded.

However, when I tab play on the iPhone it opens the native fullscreen player. But on the iPad there are two issues:

  1. It doesn't open in fullscreen, the navigation bar still remains visible. Also it's not the native player but the a resized youtube player.

  2. My vids are all in 1080p, however on the iPad I can only select 720p.

Here is the code from my WebView:

#import "ViewController.h"
#import <MediaPlayer/MediaPlayer.h>

@interface ViewController ()

@end

@implementation ViewController
@synthesize videoURL = _videoURL;

- (void)viewDidLoad
{
    [super viewDidLoad];
    NSURL *url = [NSURL URLWithString:self.videoURL];
    NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url];
    [self.webView loadRequest:urlRequest];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
}

@end

And here from the header file:

#import <UIKit/UIKit.h>

@interface ViewController : UIViewController
@property (weak, nonatomic) IBOutlet UIWebView *webView;
@property (nonatomic, strong) NSString *videoURL;
@end

How can I make it to use the native player on iPad as well? And is there a possibility to open the video directly without showing the youtube website? I've already tried to select and deselect "Allow inline rendering" with no change of the behavior.

I appreciate your help...

Upvotes: 1

Views: 1978

Answers (1)

Casey
Casey

Reputation: 166

Here is a link to my solution for a similar Thumbnail -onTouch-> Fullscreen on iPad and iPhone need. https://stackoverflow.com/a/25695708/3397249

Upvotes: 1

Related Questions