xcode 将音频和视频流式传输到 IOS 应用程序中

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11591620/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 00:57:38  来源:igfitidea点击:

Streaming audio and video into IOS app

iosxcodeaudiovideostream

提问by Paul

I am creating an iPhone app on Xcode with build in video and music, the trouble is I want to keep the whole app below 20MB

我正在 Xcode 上创建一个内置视频和音乐的 iPhone 应用程序,问题是我想将整个应用程序保持在 20MB 以下

I've compressed the videos to a OK standard but I'm still over the 20MB

我已将视频压缩为 OK 标准,但仍然超过 20MB

Is there a way I can just stream the videos from a server, so when I click on my video / Audio button in the app it plays like it was saved within the app.

有没有办法可以只从服务器流式传输视频,所以当我点击应用程序中的视频/音频按钮时,它会像保存在应用程序中一样播放。

Many Thanks

非常感谢

回答by Andrei G.

Try this:

尝试这个:

MPMoviePlayerViewController *movieView = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL URLWithString:@"http://movieurl"]];

[self presentMoviePlayerViewControllerAnimated:movieView];

don't forget to import MediaPlayerFramework

不要忘记导入 MediaPlayerFramework

If you need more control over streaming, playback or the view itself, see MPMoviePlayerController Class Reference

如果您需要对流媒体、播放或视图本身进行更多控制,请参阅MPMoviePlayerController 类参考