按下播放后 UIWebView 上的 QuickTime 播放器 iOS 9 发出警告 [英] QuickTime player iOS 9 on UIWebView giving warning after play is pressed

查看:26
本文介绍了按下播放后 UIWebView 上的 QuickTime 播放器 iOS 9 发出警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在页面加载时在 UIWebView (iOS 9.2.1) 上播放 m3u8 链接 按下时会出现 quickTime 播放器的播放图标(仅在 iPhone 设备上)播放器填满所有屏幕,日志给出了这个警告:

I want to play a m3u8 link on UIWebView (iOS 9.2.1) when the page is loaded the play icon of the quickTime player appears when pressed (only on iPhone devices) the player fills the all screen and the log gives this warning :

This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes.  This will cause an exception in a future release.
 Stack:(
    0   CoreFoundation                      0x23e74123 <redacted> + 150
    1   libobjc.A.dylib                     0x2361ae17 objc_exception_throw + 38
    2   CoreFoundation                      0x23e74051 <redacted> + 0
    3   Foundation                          0x24754acb <redacted> + 170
    4   Foundation                          0x245fa3bf <redacted> + 38
    5   UIKit                               0x280b69d5 <redacted> + 52
    6   UIKit                               0x280b73bb <redacted> + 222
    7   UIKit                               0x287d0293 <redacted> + 322
    8   UIKit                               0x282b155d <redacted> + 148
    9   UIKit                               0x27facd13 <redacted> + 714
    10  QuartzCore                          0x260abf99 <redacted> + 128
    11  QuartzCore                          0x260a7695 <redacted> + 348
    12  QuartzCore                          0x260a7529 <redacted> + 16
    13  QuartzCore                          0x260a6a49 <redacted> + 368
    14  QuartzCore                          0x260a66fb <redacted> + 614
    15  WebCore                             0x27b7a61b <redacted> + 274
    16  CoreFoundation                      0x23e3768f <redacted> + 14
    17  CoreFoundation                      0x23e3727d <redacted> + 452
    18  CoreFoundation                      0x23e355eb <redacted> + 794
    19  CoreFoundation                      0x23d88bf9 CFRunLoopRunSpecific + 520
    20  CoreFoundation                      0x23d889e5 CFRunLoopRunInMode + 108
    21  WebCore                             0x2713547f <redacted> + 422
    22  libsystem_pthread.dylib             0x23bad85b <redacted> + 138
    23  libsystem_pthread.dylib             0x23bad7cf _pthread_start + 110
    24  libsystem_pthread.dylib             0x23bab724 thread_start + 8
)
This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes.  This will cause an exception in a future release.
 Stack:(
    0   CoreFoundation                      0x23e74123 <redacted> + 150
    1   libobjc.A.dylib                     0x2361ae17 objc_exception_throw + 38
    2   CoreFoundation                      0x23e74051 <redacted> + 0
    3   Foundation                          0x24754acb <redacted> + 170
    4   Foundation                          0x245fa3bf <redacted> + 38
    5   UIKit                               0x280b69d5 <redacted> + 52
    6   UIKit                               0x287cfc89 <redacted> + 132
    7   UIKit                               0x280b76bf <redacted> + 86
    8   Foundation                          0x245fa499 <redacted> + 256
    9   UIKit                               0x280b69d5 <redacted> + 52
    10  UIKit                               0x280b73bb <redacted> + 222
    11  UIKit                               0x287d0293 <redacted> + 322
    12  UIKit                               0x282b155d <redacted> + 148
    13  UIKit                               0x27facd13 <redacted> + 714
    14  QuartzCore                          0x260abf99 <redacted> + 128
    15  QuartzCore                          0x260a7695 <redacted> + 348
    16  QuartzCore                          0x260a7529 <redacted> + 16
    17  QuartzCore                          0x260a6a49 <redacted> + 368
    18  QuartzCore                          0x260a66fb <redacted> + 614
    19  WebCore                             0x27b7a61b <redacted> + 274
    20  CoreFoundation                      0x23e3768f <redacted> + 14
    21  CoreFoundation                      0x23e3727d <redacted> + 452
    22  CoreFoundation                      0x23e355eb <redacted> + 794
    23  CoreFoundation                      0x23d88bf9 CFRunLoopRunSpecific + 520
    24  CoreFoundation                      0x23d889e5 CFRunLoopRunInMode + 108
    25  WebCore                             0x2713547f <redacted> + 422
    26  libsystem_pthread.dylib             0x23bad85b <redacted> + 138
    27  libsystem_pthread.dylib             0x23bad7cf _pthread_start + 110
    28  libsystem_pthread.dylib             0x23bab724 thread_start + 8
)
This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes.  This will cause an exception in a future release.
 Stack:(
    0   CoreFoundation                      0x23e74123 <redacted> + 150
    1   libobjc.A.dylib                     0x2361ae17 objc_exception_throw + 38
    2   CoreFoundation                      0x23e74051 <redacted> + 0
    3   Foundation                          0x24754acb <redacted> + 170
    4   Foundation                          0x245fe877 <redacted> + 38
    5   Foundation                          0x245fa503 <redacted> + 362
    6   UIKit                               0x280b69d5 <redacted> + 52
    7   UIKit                               0x280b73bb <redacted> + 222
    8   UIKit                               0x287d0293 <redacted> + 322
    9   UIKit                               0x282b155d <redacted> + 148
    10  UIKit                               0x27facd13 <redacted> + 714
    11  QuartzCore                          0x260abf99 <redacted> + 128
    12  QuartzCore                          0x260a7695 <redacted> + 348
    13  QuartzCore                          0x260a7529 <redacted> + 16
    14  QuartzCore                          0x260a6a49 <redacted> + 368
    15  QuartzCore                          0x260a66fb <redacted> + 614
    16  WebCore                             0x27b7a61b <redacted> + 274
    17  CoreFoundation                      0x23e3768f <redacted> + 14
    18  CoreFoundation                      0x23e3727d <redacted> + 452
    19  CoreFoundation                      0x23e355eb <redacted> + 794
    20  CoreFoundation                      0x23d88bf9 CFRunLoopRunSpecific + 520
    21  CoreFoundation                      0x23d889e5 CFRunLoopRunInMode + 108
    22  WebCore                             0x2713547f <redacted> + 422
    23  libsystem_pthread.dylib             0x23bad85b <redacted> + 138
    24  libsystem_pthread.dylib             0x23bad7cf _pthread_start + 110
    25  libsystem_pthread.dylib             0x23bab724 thread_start + 8
)

这不会发生在任何 iPad 设备上,只有 iPhone 设备才会发生.

This doesn't happen on any iPad devices only iPhone ones.

即使在更瘦"的应用程序上尝试过,仍然发出同样的警告,我正在使用 UIWebView 的加载请求:

Even tried it on a "skinnier" application still same warning and I'm using the load request of the UIWebView in :

dispatch_async(dispatch_get_main_queue(), ^{
    NSString *rec = [_m3u8 string"];
    NSURL *url = [NSURL URLWithString:rec];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    self.WebView.allowsInlineMediaPlayback = YES;
    [self.WebView loadRequest:request];
});

感谢任何提供帮助的人.

Thanks to anyone who helps.

推荐答案

UIWebView 仍然没有多大成功,但是有一个名为WKWebView"的对象是 来实现:

Well still not much success with UIWebView however there is an object called "WKWebView" that is a part of <WebKit/WebKit.h> to implement :

#import <WebKit/WebKit.h>

然后在您的 viewDidLoad 等中初始化:

Then to init in your viewDidLoad etc :

WKWebView *w = [[WKWebView alloc]initWithFrame:self.view.bounds];
NSURL *url = [NSURL URLWithString:@"yourLink.m3u8"];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[w loadRequest:request];
[self.view addSubview:w];

再向您的 .plist 文件添加一件事:

One more thing add to your .plist file :

应用传输安全设置 - 字典.

App Transport Security Settings - Dictionary.

允许任意加载 = YES.

Allow arbitrary loads = YES.

它比 UIWebView 快得多,而且我没有在日志中收到上面提到的警告.

Its much faster then UIWebView and i don't get the warning mentioned above in the log.

干杯.

这篇关于按下播放后 UIWebView 上的 QuickTime 播放器 iOS 9 发出警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆