久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<i id='WsWS4'><tr id='WsWS4'><dt id='WsWS4'><q id='WsWS4'><span id='WsWS4'><b id='WsWS4'><form id='WsWS4'><ins id='WsWS4'></ins><ul id='WsWS4'></ul><sub id='WsWS4'></sub></form><legend id='WsWS4'></legend><bdo id='WsWS4'><pre id='WsWS4'><center id='WsWS4'></center></pre></bdo></b><th id='WsWS4'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='WsWS4'><tfoot id='WsWS4'></tfoot><dl id='WsWS4'><fieldset id='WsWS4'></fieldset></dl></div>

<small id='WsWS4'></small><noframes id='WsWS4'>

      • <bdo id='WsWS4'></bdo><ul id='WsWS4'></ul>
      <legend id='WsWS4'><style id='WsWS4'><dir id='WsWS4'><q id='WsWS4'></q></dir></style></legend><tfoot id='WsWS4'></tfoot>
      1. iOS - 未收到 UIEventTypeRemoteControl 事件

        iOS - UIEventTypeRemoteControl events not received(iOS - 未收到 UIEventTypeRemoteControl 事件)
      2. <tfoot id='kbNhX'></tfoot>
        <i id='kbNhX'><tr id='kbNhX'><dt id='kbNhX'><q id='kbNhX'><span id='kbNhX'><b id='kbNhX'><form id='kbNhX'><ins id='kbNhX'></ins><ul id='kbNhX'></ul><sub id='kbNhX'></sub></form><legend id='kbNhX'></legend><bdo id='kbNhX'><pre id='kbNhX'><center id='kbNhX'></center></pre></bdo></b><th id='kbNhX'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='kbNhX'><tfoot id='kbNhX'></tfoot><dl id='kbNhX'><fieldset id='kbNhX'></fieldset></dl></div>

          <tbody id='kbNhX'></tbody>
          <bdo id='kbNhX'></bdo><ul id='kbNhX'></ul>

          <small id='kbNhX'></small><noframes id='kbNhX'>

            <legend id='kbNhX'><style id='kbNhX'><dir id='kbNhX'><q id='kbNhX'></q></dir></style></legend>

                  本文介紹了iOS - 未收到 UIEventTypeRemoteControl 事件的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我在 AppDelegate (didFinishLaunching) 中有這個(gè):

                  I have this in the AppDelegate (didFinishLaunching):

                  [[UIApplication sharedApplication] beginReceivingRemoteControlEvents];
                  

                  我嘗試在相關(guān)視圖控制器中處理事件,但結(jié)果參差不齊(一些視圖控制器會(huì)收到事件,而另一些則不會(huì),即使他們是第一響應(yīng)者).我嘗試子類化 UIApplication.那沒有用.現(xiàn)在我正在嘗試?yán)^承 UIWindow 并執(zhí)行此操作(請參閱評(píng)論):

                  I tried handling the events in the relevant view controllers but that was spotty (some view controllers would get the events and others wouldn't, even when they were first responders). I tried subclassing UIApplication. That didn't work. Now I'm trying to subclass UIWindow and do this (see the comments):

                  - (void)sendEvent:(UIEvent *)event {
                  if (event.type == UIEventTypeRemoteControl) {
                      NSLog(@"I wish this happened"); //this never happens
                  }
                  else
                  {
                      NSLog(@"some other event"); //this does happen on any other interaction
                      [super sendEvent:event];
                  }
                  }
                  
                  - (void) remoteControlReceivedWithEvent: (UIEvent *) receivedEvent {
                  
                  if (receivedEvent.type == UIEventTypeRemoteControl) {
                      NSLog(@"got remote event"); // this never happens either
                      switch (receivedEvent.subtype) {
                  
                          case UIEventSubtypeRemoteControlTogglePlayPause:
                          {
                              NSLog(@"handle play/pause");
                              break;
                          }
                  
                  
                          default:
                              break;
                      }
                  }
                  }
                  

                  我已經(jīng)在 info plist 中嘗試過使用和不使用它:

                  I have tried both with and without this in the info plist:

                  <key>UIBackgroundModes</key>
                  <array>
                          <string>audio</string>
                  </array>
                  

                  沒有區(qū)別.正如 Apple 文檔所述,您可以使用音頻控件模擬遠(yuǎn)程控制事件(雙擊主頁按鈕并在底部滾動(dòng)到它們).當(dāng)我按下播放或暫停時(shí),它只會(huì)播放我的 iTunes 資料庫中的音頻.我也試過蘋果耳機(jī)上的按鈕.什么都沒有.

                  Doesn't make a difference. As the Apple docs state, you can simulate remote control events with the audio controls (double tap home button and scroll to them on the bottom). When I press play or pause, it just plays audio from my iTunes library. I have tried the buttons on the Apple headphones as well. Nothing.

                  我想要做的就是檢測遙控器上的播放/暫停按鈕,并處理該事件.我還需要做什么才能捕捉到這些事件?

                  All I want to do is detect the play/pause button on a remote control, and handle the event. What else do I need to do to catch these events?

                  推薦答案

                  好吧,我的生命中還有幾個(gè)小時(shí)進(jìn)入蘋果的黑洞.事實(shí)證明,您只能在使用 AVAudioPlayer 播放某種音頻或播放有音頻的視頻文件后才能捕獲遠(yuǎn)程控制事件.這在這里的任何地方都沒有記錄.

                  ok, a few more hours of my life into black hole of Apple. Turns out that you can only capture remote control events after you have played audio of some kind using the AVAudioPlayer, or if you play a video file that has audio. This is not documented anywhere here.

                  因此,在我嘗試捕獲遠(yuǎn)程控制事件之前,我必須先播放一個(gè)虛擬靜音音頻文件.希望這可以幫助某人.

                  So in my case I have to play a dummy silent audio file first before I try to capture remote control events. Hope this helps someone down the line.

                  (更新)請注意,更新的文檔現(xiàn)在聲明如下:

                  (Update) Please note that the updated documentation now states the following:

                  要接收遠(yuǎn)程控制事件,您的應(yīng)用必須做三件事:

                  To receive remote control events, your app must do three things:

                  • 成為第一響應(yīng)者.呈現(xiàn)多媒體內(nèi)容的視圖或視圖控制器必須是第一響應(yīng)者.
                  • 開啟遠(yuǎn)程控制事件的傳遞.您的應(yīng)用必須明確請求開始接收遠(yuǎn)程控制事件.
                  • 開始播放音頻.您的應(yīng)用必須是正在播放"應(yīng)用.重申,即使您的應(yīng)用是第一響應(yīng)者并且您已轉(zhuǎn)身在事件傳遞時(shí),您的應(yīng)用不會(huì)接收遠(yuǎn)程控制事件直到它開始播放音頻.
                  • Be the first responder. The view or view controller that presents the multimedia content must be the first responder.
                  • Turn on the delivery of remote control events. Your app must explicitly request to begin receiving remote control events.
                  • Begin playing audio. Your app must be the "Now Playing" app. Restated, even if your app is the first responder and you have turned on event delivery, your app does not receive remote control events until it begins playing audio.

                  這篇關(guān)于iOS - 未收到 UIEventTypeRemoteControl 事件的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  CLLocation returning negative speed(CLLocation 返回負(fù)速度)
                  Locations in Core Data sorted by distance via NSFetchedResultsController?(通過 NSFetchedResultsController 按距離排序的核心數(shù)據(jù)中的位置?)
                  Swift: Geofencing / geolocations near user location(Swift:用戶位置附近的地理圍欄/地理位置)
                  How to get Location (latitude amp; longitude value) in variable on iOS?(如何在 iOS 上的變量中獲取位置(緯度和經(jīng)度值)?)
                  How to track the device location (iOS and Android) device using Phonegap(如何使用 Phonegap 跟蹤設(shè)備位置(iOS 和 Android)設(shè)備)
                  Easiest way of getting reverse geocoded current location from iOS(從 iOS 獲取反向地理編碼當(dāng)前位置的最簡單方法)
                  <tfoot id='Jpeyw'></tfoot>

                    <tbody id='Jpeyw'></tbody>
                    <bdo id='Jpeyw'></bdo><ul id='Jpeyw'></ul>

                      <small id='Jpeyw'></small><noframes id='Jpeyw'>

                        1. <legend id='Jpeyw'><style id='Jpeyw'><dir id='Jpeyw'><q id='Jpeyw'></q></dir></style></legend>
                          <i id='Jpeyw'><tr id='Jpeyw'><dt id='Jpeyw'><q id='Jpeyw'><span id='Jpeyw'><b id='Jpeyw'><form id='Jpeyw'><ins id='Jpeyw'></ins><ul id='Jpeyw'></ul><sub id='Jpeyw'></sub></form><legend id='Jpeyw'></legend><bdo id='Jpeyw'><pre id='Jpeyw'><center id='Jpeyw'></center></pre></bdo></b><th id='Jpeyw'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Jpeyw'><tfoot id='Jpeyw'></tfoot><dl id='Jpeyw'><fieldset id='Jpeyw'></fieldset></dl></div>

                          • 主站蜘蛛池模板: 精品久久一区二区三区 | 亚洲高清一区二区三区 | 久久亚洲国产精品 | 亚洲日韩中文字幕 | 久久中文字幕电影 | 国产精品午夜电影 | 国产精品免费一区二区三区四区 | 91免费电影| 视频一区在线 | 中文字幕精 | av网站免费在线观看 | 午夜av免费| 国产精品亚洲综合 | 国产精品资源在线 | 91精品国产综合久久福利软件 | 亚洲国产aⅴ成人精品无吗 亚洲精品久久久一区二区三区 | 一级黄色影片在线观看 | 国产中文字幕在线 | 欧美一区日韩一区 | 四虎免费视频 | 黄色大片观看 | 欧美激情久久久久久 | 日韩欧美日韩在线 | 欧美日韩在线一区二区 | 久久日韩精品一区二区三区 | 国产高清无av久久 | 成人免费视频观看 | 中文字幕成人av | 精品国产免费人成在线观看 | 天天干夜夜操 | 免费国产精品久久久久久 | 一区二区三区四区在线免费观看 | 欧美区在线观看 | 男人午夜视频 | 日韩 欧美 二区 | 国产精品视频网址 | 希岛爱理在线 | 免费v片在线观看 | 国产精品久久久久无码av | av大全在线观看 | 自拍偷拍第一页 |