2010-06-28 39 views
5

He desarrollado una aplicación universal que se ejecuta tanto en IPad como en iPhone. Estoy usando un componente de MPMoviePlayerController en esto.iOS 4 + MPMoviePlayerController

ahora se lanza el iOS4, hoy recibí una mala noticia sobre el rechazo de mi aplicación debido a este bloqueo de MPMoviePlayerController.

iDemoPlayer= [[MPMoviePlayerController alloc] initWithContentURL:aUrl]; 
[iDemoPlayer play]; 

Este es mi código src para reproducir el video.

en el iPhone OS 4.0 liberación me encontré con que

"If you link a Universal application against iPhone SDK 3.2, you must be prepared to embed the movie player view in your interface when running on iOS 4 and later"

ref

http://developer.apple.com/iphone/library/releasenotes/General/RN-iPhoneSDK-4_0/index.html

Pueden ustedes ayudarme, lo updation más que tenga que hacer para que se aceptará otra vez! !!!!!

Gracias,

Sagar

Respuesta

5

Uf, Symbian convenciones de denominación de variables.

if ([MPMoviePlayerController instancesRespondToSelector:@selector(view)]) { 
    // Running on 3.2+ 
    iDemoPlayer2 = [[MPMoviePlayerViewController alloc] initWithContentURL:aUrl]; 
    // Assuming self is a UIViewController 
    [self presentMoviePlayerViewControllerAnimated:iDemoPlayer2]; 
    // This line might be needed 
    [self.moviePlayer play]; 
} else { 
    iDemoPlayer= [[MPMoviePlayerController alloc] initWithContentURL:aUrl]; 
    [iDemoPlayer play]; 
} 
2

Si desea continuar utilizando un reproductor de pantalla completa como lo era antes de OS 4.0, modifique su código de la siguiente manera. Es probable que previamente había dos líneas que parecían:

MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:someURL]; 
[moviePlayer play];

Ahora se necesita una vista en la que colocar el reproductor de películas. Estamos suponiendo que esto es en un UIViewController y hemos utilizado más adelante self.view:

MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:someURL]; 

if ([moviePlayer respondsToSelector:@selector(view)]) { 
    moviePlayer.controlStyle = MPMovieControlStyleFullscreen; 
    [moviePlayer.view setFrame:self.view.bounds]; 
    [self.view addSubview:moviePlayer.view]; 
} 

[moviePlayer play];

Su reproductor de películas ahora debe seguir comportándose de manera similar en OS 4.0 y anteriores.

+0

que arroja este error: - [MPMoviePlayerControllerOld setControlStyle:]: Selector no reconocido enviado a la instancia 0x8029340' –

+0

que arroja el mismo error para mí :(¿podría proporcionar más información al respecto? – Sindico

Cuestiones relacionadas