编写带有嵌入式视频iPhone应用程序
-
22-08-2019 - |
题
我在研究视频流媒体,我可能在不久的将来写一个iPhone应用程序。应用程序是否比视频流之外的整个很多,但是视频的方面是,我有没有经验的部分。
任何人都知道任何好文章的写作上的视频流应用程序?
谷歌似乎淹没我与拥有的一切联系,不要做我所追求的。
谢谢,
米
解决方案
苹果提供关于媒体框架我ntheir文档良好的文档。
搜索的MPMoviePlayerController。下面的示例代码播放电影从一个URL。 (免责声明这个代码来自苹果解除)。
-(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];
}
其他提示
我在看这个问题为好。我想嵌入到一个iPad应用程序的视频,像美联社的iPad应用程序如何处理影片
显然可以在OS 3.2和更高做这类嵌入视频的。苹果的的MPMoviePlayerController文档介绍了如何可以做到这一点:
不隶属于 StackOverflow