Note that there are some explanatory texts on larger screens.

plurals
  1. POObjective-C iOS MPMoviePlayerController not play movie nothing return
    text
    copied!<p>Thats must play movie in TVOut if it exist if not thats must play movie in internal screen. But it not play movie just shown blue screen as i set player background player.view.backgroundColor = [UIColor blueColor];</p> <p>If i set tvout hardware in emulator then it show player blue screen on tvout and return message in console:</p> <blockquote> <p>2013-12-17 23:57:59.576 RAT[8609:70b] Application windows are expected to have a root view controller at the end of application launch</p> </blockquote> <p>Code is:</p> <pre><code>// // ViewController.m // RAT // // Created by Dmitriy Pushkarev on 28/11/13. // Copyright (c) 2013 ЯB RoyalBlue. All rights reserved. // #import "ViewController.h" @interface ViewController () @end @implementation ViewController MPMoviePlayerController *player; UIWindow *newwindow; - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. player = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:@"http://devimages.apple.com/iphone/samples/bipbop/gear1/prog_index.m3u8"]]; [player prepareToPlay]; [player play]; [player.view setFrame:self.view.bounds]; player.view.backgroundColor = [UIColor blueColor]; player.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; CGSize maxSize; if([[UIScreen screens]count] &gt; 1) { NSLog(@"external screen"); newwindow = [[UIWindow alloc] init]; // There is a external display. UIScreenMode *maxScreenMode; for(int i = 0; i &lt; [[[[UIScreen screens] objectAtIndex:1] availableModes]count]; i++) { UIScreenMode *current = [[[[UIScreen screens]objectAtIndex:1]availableModes]objectAtIndex:i]; if(current.size.width &gt; maxSize.width) { maxSize = current.size; maxScreenMode = current; } } UIScreen *external = [[UIScreen screens] objectAtIndex:1]; external.currentMode = maxScreenMode; newwindow.screen = external; // setting external display size. CGPoint point = CGPointMake(0.0f, 0.0f); // CGSize size = CGSizeMake(1024.0f, 768.0f); CGSize size = maxSize; CGRect frame = player.view.frame; frame.origin = point; frame.size.width = size.width; frame.size.height = size.height; [player.view setFrame:frame]; [player setControlStyle:MPMovieControlModeHidden]; [player prepareToPlay]; [player play]; [newwindow addSubview:player.view]; [newwindow makeKeyAndVisible]; } else { [self.view addSubview:player.view]; [player.view becomeFirstResponder]; NSLog(@"Display not connected"); } /////////////////////////////// } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } @end </code></pre> <p>Progress... Ok. I update code and now it's works on internal display only. On TVout i see only blue screen and listen sound from video but nothing to view only blue.</p> <p>And console message - Application windows are expected to have a root view controller at the end of application launch</p> <p>More progress.. All works fine! But i get message in log: Application windows are expected to have a root view controller at the end of application launch</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload