本文介绍了在XCode 5中播放视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨..



我在XCode 5中使用stoaryboard我创建了一个播放视频的应用程序,我使用了MPMoviePlayerVeiwControlrer类并使用它mnethod进行播放和添加作为主视图中的子视图



当我运行applciation并点击播放按钮时,电影播放器​​显示加载视频文件但不播放它只显示加载完成



任何人都可以指导我



i使用下面的代码



NSURL * url = [[NSURL alloc] initWithString:@" http://www.ebookfrenzy.com/ios_book/movie/movie.mov"];



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



[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector (moviePlayBackDidFinish :)名称:MPMoviePlayerPlaybackDidFinishNotification对象:moviePlayer];



moviePlayer.co ntrolStyle = MPMovieControlStyleDefault;

moviePlayer.shouldAutoplay = YES;

[self.view addSubview:moviePlayer.view];

[moviePlayer setFullscreen:YES动画:是]



也使用mp4文件,但仍然显示只在视图中加载的条件

Hi..

Am working with stoaryboard in XCode 5 i create a applcaition for playing video for that i used MPMoviePlayerVeiwControlrer class and use it mnethod for play and add as a subview in main view

when i run the applciation and click on play button the movieplayer is showing with loadding the video file but not playing it's showing only loading that is get completed

can anybody guide me

i use this below code

NSURL *url=[[NSURL alloc] initWithString:@"http://www.ebookfrenzy.com/ios_book/movie/movie.mov"];

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

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayBackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:moviePlayer];

moviePlayer.controlStyle=MPMovieControlStyleDefault;
moviePlayer.shouldAutoplay=YES;
[self.view addSubview:moviePlayer.view];
[moviePlayer setFullscreen:YES animated:YES]

also use mp4 file but still same condition showing only loading in view

推荐答案


这篇关于在XCode 5中播放视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-10 21:16