简体   繁体   English

AVPlayerViewController视频的音频背景播放,并支持多种格式

[英]AVPlayerViewController video's audio background playing and support for multiple formats

I have to do a Video streaming app (using a remote url) in swift. 我必须快速制作一个视频流应用程序(使用远程URL)。 But there is no any exact video format . 但是没有确切的视频格式 Sometimes it can be m3u8 sometimes mp4 etc.. but my video player should support for what ever the format comes from the back end. 有时可能是m3u8有时可能是mp4等。但是我的视频播放器应该支持后端提供的格式。

Also when the app is in background, the audio should play and when the app comes foreground video should play without any time delay between the vide and the audio. 同样,当应用程序在后台运行时,应播放音频,而当应用程序运行时,应在前景视频和音频之间没有任何时间延迟地播放前景视频。

I want to know whether is it possible to achieve my objectives using AVPlayerViewController or else what is the best player that I can use to achieve my targets. 我想知道是否可以使用AVPlayerViewController实现我的目标,否则我可以用来实现目标的最佳播放器是什么。 Please help me. 请帮我。 Thanks 谢谢

AVPlayerViewController supports m3u8 and mp4 both format. AVPlayerViewController支持m3u8和mp4两种格式。 For playing video's audio you need some extra configuration. 要播放视频的音频,您需要一些额外的配置。 You can check from here... 您可以从这里检查...

How do I get my AVPlayer to play while app is in background? 当应用程序在后台运行时,如何使我的AVPlayer播放?

Is it possible to play video using Avplayer in Background? 是否可以在后台使用Avplayer播放视频?

So according to me AVPlayerViewController is best option for your requirement. 因此,根据我的说法,AVPlayerViewController是满足您需求的最佳选择。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM