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

<tfoot id='fdgZv'></tfoot>

    • <bdo id='fdgZv'></bdo><ul id='fdgZv'></ul>
      <legend id='fdgZv'><style id='fdgZv'><dir id='fdgZv'><q id='fdgZv'></q></dir></style></legend>

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

        如何在 UIWebview 中获取当前正在播放的视频的 url

        时间:2023-10-22

        <small id='7Qiz8'></small><noframes id='7Qiz8'>

        <tfoot id='7Qiz8'></tfoot>

          <tbody id='7Qiz8'></tbody>
            • <bdo id='7Qiz8'></bdo><ul id='7Qiz8'></ul>

                  <i id='7Qiz8'><tr id='7Qiz8'><dt id='7Qiz8'><q id='7Qiz8'><span id='7Qiz8'><b id='7Qiz8'><form id='7Qiz8'><ins id='7Qiz8'></ins><ul id='7Qiz8'></ul><sub id='7Qiz8'></sub></form><legend id='7Qiz8'></legend><bdo id='7Qiz8'><pre id='7Qiz8'><center id='7Qiz8'></center></pre></bdo></b><th id='7Qiz8'></th></span></q></dt></tr></i><div id='7Qiz8'><tfoot id='7Qiz8'></tfoot><dl id='7Qiz8'><fieldset id='7Qiz8'></fieldset></dl></div>
                1. <legend id='7Qiz8'><style id='7Qiz8'><dir id='7Qiz8'><q id='7Qiz8'></q></dir></style></legend>
                2. 本文介绍了如何在 UIWebview 中获取当前正在播放的视频的 url的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  有什么方法可以获取当前播放视频的链接.我正在加载 m.youtube.com.对于某些视频,它甚至没有进入代表.我也尝试使用 NStimer.但对于某些视频,它不是点击的 url

                  Is there any way to get the link of currently playing video.I am loading m.youtube.com .For some videos it is not even entering the delegates.I tried using a NStimer as well.But for some videos it is not the clicked url

                  推荐答案

                  通过监听 AVPlayerItemBecameCurrentNotification 通知有一个 hacky 方法.当 UIWebView 显示媒体播放器时会触发此通知,并发送 AVPlayerItem 作为通知的对象.

                  There is a hacky way of doing it by listening for the AVPlayerItemBecameCurrentNotification notification. This notification is fired when a UIWebView shows the media player, and it sends an AVPlayerItem as the notification's object.

                  例如:

                  [[NSNotificationCenter defaultCenter] addObserver:self
                                                           selector:@selector(playerItemBecameCurrent:)
                                                               name:@"AVPlayerItemBecameCurrentNotification"
                                                             object:nil];
                  
                  
                  -(void)playerItemBecameCurrent:(NSNotification*)notification {
                      AVPlayerItem *playerItem = [notification object];
                      if(playerItem == nil) return;
                      // Break down the AVPlayerItem to get to the path
                      AVURLAsset *asset = (AVURLAsset*)[playerItem asset];
                      NSURL *url = [asset URL];
                      NSString *path = [url absoluteString];
                  }
                  

                  这适用于任何视频(和音频).但是,我注意到您提到了 YouTube - 值得指出的是,如果 Apple 拒绝您的应用,如果它能够完全下载 YouTube 视频,因为它违反 YouTube 的服务条款.

                  This works for any video (and audio). However, I noticed you mentioned YouTube - it's worth pointing out Apple WILL reject your app if it has the ability to download YouTube videos AT ALL, because it's against YouTube's Terms of Service.

                  这篇关于如何在 UIWebview 中获取当前正在播放的视频的 url的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:更改 uiwebview div 对象的内容 下一篇:用动画翻页(UIWebView)

                  相关文章

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

                  1. <legend id='MxmPW'><style id='MxmPW'><dir id='MxmPW'><q id='MxmPW'></q></dir></style></legend>

                    1. <tfoot id='MxmPW'></tfoot>

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