将视频添加到 iPhone 应用程序
如何将视频添加到 iPhone 应用程序。使用iPhone SDK 3.2.5? 我看不到实际的视频,但我可以听到它正在播放。
这是代码:
-(void) viewDidLoad{
NSBundle *bundle=[NSBundle mainBundle];
NSString *moviePath = [bundle pathForResource:@"Facebook" ofType:@"mp4"];
NSURL *movieURL=[[NSURL fileURLWithPath:moviePath] retain];
MPMoviePlayerController *theMovie = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];
theMovie.scalingMode = MPMovieScalingModeAspectFill;
[theMovie play];
[super viewDidLoad];
}
How do I add a video to an iPhone app. using iPhone SDK 3.2.5?
I dont see the actual video but I can hear it playing.
Here is the code:
-(void) viewDidLoad{
NSBundle *bundle=[NSBundle mainBundle];
NSString *moviePath = [bundle pathForResource:@"Facebook" ofType:@"mp4"];
NSURL *movieURL=[[NSURL fileURLWithPath:moviePath] retain];
MPMoviePlayerController *theMovie = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];
theMovie.scalingMode = MPMovieScalingModeAspectFill;
[theMovie play];
[super viewDidLoad];
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
首先 – 找出您拥有的视频格式。我猜 iPhone 不支持这一功能。
因此,当您了解这一点后,您可以继续寻找能够播放您的视频的第三方播放器。我确信那里有很多人。我的推荐 – 尝试使用 VLC。
如果您想在 iPhone 上使用默认视频应用程序(当然,这比任何其他替代方案都要好),您可以尝试 Windows 和 Windows 操作系统。 Mac 应用程序 WALTR 2:https://softorino .com/waltr/windows-guides/how-transfer-videos-to-iphone-without-itunes。它适用于任何视频和视频用于 iPhone 播放的音乐,并将它们推送到 iPhone 上的默认应用程序。
First off – find out what video format you are having. I assume it's not the one supported by iPhones.
So when you learn this you can go ahead and look for a third party player that is able to play back your video. I'm sure there are a lot of them there. Recommendation from me – try using VLC.
If you want to use default videos app on your iPhone (which, of course, is way better than any other alternative) you can try out Windows & Mac application WALTR 2: https://softorino.com/waltr/windows-guides/how-transfer-videos-to-iphone-without-itunes. It adapts any video & music for iPhone playback and pushes them to your default app on an iPhone.
您需要为 MPMoviePlayerController 设置框架并将其添加到您的视图中:
You need to set the frame for you MPMoviePlayerController and add it to your view: