- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我对 MPMoviePlayerController 有疑问。我使用一个实例来播放 m3u8 音频源:
AVAudioSession *audioSession = [AVAudioSession sharedInstance];
NSError *setCategoryError = nil;
[audioSession setCategory:AVAudioSessionCategoryPlayback error:&setCategoryError];
if (setCategoryError) {
}
NSError *activationError = nil;
[audioSession setActive:YES error:&activationError];
if (activationError) {
}
self.player =
[[MPMoviePlayerController alloc] initWithContentURL: [NSURL URLWithString:url]];
player.view.hidden = YES;
player.shouldAutoplay = YES;
[player release];
[btnContainer addSubview: player.view];
player.useApplicationAudioSession = NO;
它被设计为当应用程序进入后台时播放,并且一切正常。
问题是当它在后台时我接到来电。在这种情况下,流会暂停,但在通话结束后不会返回。事实上,控制台说
2011-01-12 12:02:27.729 RAC1[1571:307] MP _playbackInterruptionDidEndNotification :: NSConcreteNotification 0x155890 {name = AVController_PlaybackInterruptionDidEndNotification; object = <AVController: 0x180d50>; userInfo = {
"AVController_InterruptionStatusNotificationParameter" = "call.declined";
"AVController_InterruptorNameNotificationParameter" = Phone;
}}, _state = 6
2011-01-12 12:02:27.730 RAC1[1571:307] MP _playbackInterruptionDidEndNotification :: resuming playback!
应用程序确实将流显示为MPMoviePlaybackStatePlaying
,但声音似乎停止了。我尝试过这样做
[[AVAudioSession sharedInstance] setActive: YES error: &err]
但似乎失败了。
有人知道吗?
谢谢!
最佳答案
看来我需要
[[UIApplication sharedApplication] beginReceivingRemoteControlEvents];
在我的viewController的viewDidAppear
中......
关于iphone - 后台 MPMoviePlayerController/AVAudioSession 来电后不会重新开始播放,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4668548/
我的一位客户刚刚告诉我,在使用我为他们开发的应用程序时,他们接到来电,但 iPhone 上没有显示警报。相反,调用电话的人听到一条消息,表明用户的服务暂时不可用。 如果我们暂时搁置以下可能性:调用电话
我正在尝试在 Android 上实现 iOS callkit 行为。我收到来自 firebase 的推送通知,我想向用户显示“来电”屏幕。为此,我使用了 android.telecom 包和其他类中的
我使用 WebRTC 制作了一个简单的调用应用程序。我已建立连接,现在可以从一个浏览器调用另一个浏览器。 我仍然无法弄清楚并且在 WebRTC 标准中找不到的一件事是......我如何拒绝通话提议。
我正在使用 Twilio Java API,但我似乎无法构建将调用 Sip 分机的响应。 TwiMLResponse twiml = new TwiMLResponse(); Sip sip = ne
“如何挂断来电(当然是在 Android 中)?” 首先,我知道这个问题已经被问过和回答过好几次了,而回答总是“你不能”。但是如果我们看看市场,我们会得到一些应用程序(所有私有(private)软件,
场景如下: 显示一个 Activity (active)。如果有电话来电,Activity 应该接收到 Intent(将“来电屏幕”发送到后台/从显示屏上隐藏它),并且 Activity 本身对用户保
我用过这个方法How do I get my AVPlayer to play while app is in background?让 AVPlayer 在后台播放,以便用户可以在浏览 safari
我正在编写一个基于闹钟的应用程序,我正在寻找一种持续唤醒用户的方法。理想情况下,我希望电话能够振动、响铃和显示消息。我尝试了几种不同的选择,这是我目前拥有的: 让后台服务启动振动和播放音乐的 Acti
我的对象使用 javascript 对象原型(prototype)。 我定义了以下内容: Game = function(id, userId, tiles){ this._userId =
我正在开发 VOIP 调用应用程序。当来电显示高达 android 5.0 版时,来电显示在锁定屏幕的顶部,但从 6.0 版开始显示为通知。未出现调用屏幕。 在做了一些研发之后,在 setConten
我在 Android 上编写自己的启动器,当我使用此启动器接到 Skype 电话时,我看到来电窗口,但我无法接听电话...之后我什么也做不了,它是封锁所有。使用默认启动器和其他启动器,Skype 可以
现在怎么样了 很多问题都讨论过这个问题,但都没有提供好的解决方案。事情看起来很简单,有了 BroadcastReceiver 之后真的很容易拦截和阻止调用。出现的主要问题是默认的 Android
我正在开发一个应用程序,这个应用程序需要在某些事件发生时向用户提供明确的指示。 到目前为止我唯一能做的就是在通知区域发出通知。但是,我需要提供更明显的通知,类似于来电时电话响铃时的行为。 据我了解,a
不幸的是,Twilio 文档不够清晰,无法回答我的问题,所以我来了。 当我的应用程序在前台/后台运行时,我能够在用户调用时接收 Twilio 传入连接,并且我可以正确处理此问题(在应用程序内显示弹出窗
这可能是个愚蠢的问题,我有点菜鸟。我正在阅读这篇文章:How do I access call log for android? 在代码底部的答案中,他们有这一行: int type = Intege
我是一名优秀的程序员,十分优秀!