Pregunta

Estoy investigando la transmisión de vídeo para una aplicación iPhone que voy a tener que escribir en un futuro próximo. La aplicación hace mucho aparte de flujo de vídeo, pero de aspecto de vídeo es la parte que no tengo ninguna experiencia con.

Alguien sabe de ningún buenos artículos en la escritura de transmisión de aplicaciones de vídeo?

Google me parece inundar con enlaces que tienen todo lo que no debe hacer lo que busco.

Gracias,

m

¿Fue útil?

Solución

Apple proporciona una buena documentación en el marco de los medios de comunicación i Ntheir docs.

Búsqueda de MPMoviePlayerController. El siguiente código de muestra se reproduce una película desde una dirección URL. (Descargo de responsabilidad, este código levantado de Apple).

-(void)playMovieAtURL:(NSURL*)theURL 

{
    MPMoviePlayerController* theMovie=[[MPMoviePlayerController alloc] initWithContentURL:theURL]; 
    theMovie.scalingMode=MPMovieScalingModeAspectFill; 
    theMovie.userCanShowTransportControls=NO;

    // Register for the playback finished notification. 

    [[NSNotificationCenter defaultCenter] addObserver:self 
                                            selector:@selector(myMovieFinishedCallback:) 
                                                name:MPMoviePlayerPlaybackDidFinishNotification 
                                              object:theMovie]; 

    // Movie playback is asynchronous, so this method returns immediately. 
    [theMovie play]; 
} 

// When the movie is done,release the controller. 
-(void)myMovieFinishedCallback:(NSNotification*)aNotification 
{
    MPMoviePlayerController* theMovie=[aNotification object]; 
    [[NSNotificationCenter defaultCenter] removeObserver:self 
                                                    name:MPMoviePlayerPlaybackDidFinishNotification 
                                                  object:theMovie]; 

    // Release the movie instance created in playMovieAtURL
    [theMovie release]; 
}

Otros consejos

Me gustaría encontrar en este tema también. Me gustaría incrustar un vídeo en una aplicación para iPad, algo así como la aplicación Associated Press iPad con los videos.

Al parecer, usted puede hacer este tipo de vídeo incrustado en OS 3.2 y versiones posteriores. documentación de Apple para MPMoviePlayerController describe cómo se puede hacer esto:

http://developer.apple .com / iPhone / biblioteca / documentación / MediaPlayer / Referencia / MPMoviePlayerController_Class / MPMoviePlayerController / MPMoviePlayerController.html

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top