MPMoviePlayerViewController,在后台播放视频的声音

编程入门 行业动态 更新时间:2024-10-27 18:25:26
本文介绍了MPMoviePlayerViewController,在后台播放视频的声音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在用MPMoviePlayerViewController播放视频流. 在我的应用程序的info.plist中,我已将UIBackgroundModes设置为audio. 当我在播放视频的过程中暂停播放时按主页按钮时,返回到应用程序后,播放将再次继续. 它开箱即用,无需更改某些内容. 但是在某些应用程序中(例如茉莉花),当我按主页"按钮时,视频的声音会在后台继续播放. 所以我有两个问题: 1)魔术是什么?如何在不显示视频流本身的情况下在后台播放视频声音?我找不到任何有效的解决方案. 2)如果难以实施,我可以保留所有内容吗?我已将UIBackgroundModes设置为audio却没有在后台实际播放音频,因此我认为我的应用有机会在审核阶段被拒绝.我对吗?还是对于视频流应用程序,即使没有任何内容在后台播放,也允许设置UIBackgroundModes吗? 预先感谢.

I'm playing the video stream with MPMoviePlayerViewController. In my app's info.plist I have set UIBackgroundModes to audio. When I press home button while playing video playback is paused, after going back to application playback continues again. It works out of the box without having to change something. But in some applications (e.g. Jasmine) when I press Home button video's sound playing is continued in background. So I have 2 questions: 1) What's the magic? How to play video's sound in background without showing video stream itself? I can't find any working solutions. 2) If it is hard to implement, can I leave everything as it is? I have set UIBackgroundModes to audio without actually playing audio in background, so I assume my app has chances to be rejected on review stage. Am I right? Or for video streaming applications setting UIBackgroundModes is allowed even if nothing is playing in background? Thanks in advance.

推荐答案

  • 您必须将音频流分离为背景模式
  • 您的应用肯定会被拒绝.我也寻求技术解决方案;)
  • 更多推荐

    MPMoviePlayerViewController,在后台播放视频的声音

    本文发布于:2023-11-27 03:20:15,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1636356.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:后台   声音   视频   MPMoviePlayerViewController

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!