看板 MacDev 關於我們 聯絡資訊
最近做了一個廣播 App, 支援背景播放. 使用 AVPlayer 跟 AVAudioSession. 很多使用者說, 內建計時器的停止播放功能無法觸發. 我 try 了某些音樂 App, 確實可以使用內建計時器停止, 但是某些不能. 不過我在 stackoverflow 找不到相關資訊. Google 'timer stop playing' 只找到怎用計時器停止. 監聽了所有 AVAudioSession, 都沒相關觸發, 所有 AVAudioSession Category 都設過了, 還是沒辦法. 有人試過內建計時器停止 audio 相關的 Notification 嗎? -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 123.194.145.196 ※ 文章網址: https://www.ptt.cc/bbs/MacDev/M.1430841789.A.E6E.html
appleway: AVAudioSessionCategorySoloAmbient 確定沒用? 05/06 05:02
shinrenpan: SoloAmbient 退到背景會沒聲音吧? 05/06 10:58
hearther: https://goo.gl/W36fLV 在多處理 05/07 14:26
hearther: UIEventSubtypeRemoteControlStop 就可以了 05/07 14:26
shinrenpan: 加完中斷點也發現會觸發 remoteControlReceivedWithEv 05/07 16:33
shinrenpan: ent: 之前沒做 UIEventSubtypeRemoteControlStop 05/07 16:33
ckvir: 你可以找obc 的api, 找到之後會有對應的 swift api 06/09 10:48