按下播放后,UIWebView上的QuickTime播放器iOS 9会发出警告
我想在UIWebView(iOS 9.2.1)上播放m3u8链接,当页面加载时,按下时会出现quickTime播放器的播放图标(仅在iPhone设备上)播放器填满所有屏幕,日志会发出以下警告:
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 + 150 1 libobjc.A.dylib 0x2361ae17 objc_exception_throw + 38 2 CoreFoundation 0x23e74051 + 0 3 Foundation 0x24754acb + 170 4 Foundation 0x245fa3bf + 38 5 UIKit 0x280b69d5 + 52 6 UIKit 0x280b73bb + 222 7 UIKit 0x287d0293 + 322 8 UIKit 0x282b155d + 148 9 UIKit 0x27facd13 + 714 10 QuartzCore 0x260abf99 + 128 11 QuartzCore 0x260a7695 + 348 12 QuartzCore 0x260a7529 + 16 13 QuartzCore 0x260a6a49 + 368 14 QuartzCore 0x260a66fb + 614 15 WebCore 0x27b7a61b + 274 16 CoreFoundation 0x23e3768f + 14 17 CoreFoundation 0x23e3727d + 452 18 CoreFoundation 0x23e355eb + 794 19 CoreFoundation 0x23d88bf9 CFRunLoopRunSpecific + 520 20 CoreFoundation 0x23d889e5 CFRunLoopRunInMode + 108 21 WebCore 0x2713547f + 422 22 libsystem_pthread.dylib 0x23bad85b + 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 + 150 1 libobjc.A.dylib 0x2361ae17 objc_exception_throw + 38 2 CoreFoundation 0x23e74051 + 0 3 Foundation 0x24754acb + 170 4 Foundation 0x245fa3bf + 38 5 UIKit 0x280b69d5 + 52 6 UIKit 0x287cfc89 + 132 7 UIKit 0x280b76bf + 86 8 Foundation 0x245fa499 + 256 9 UIKit 0x280b69d5 + 52 10 UIKit 0x280b73bb + 222 11 UIKit 0x287d0293 + 322 12 UIKit 0x282b155d + 148 13 UIKit 0x27facd13 + 714 14 QuartzCore 0x260abf99 + 128 15 QuartzCore 0x260a7695 + 348 16 QuartzCore 0x260a7529 + 16 17 QuartzCore 0x260a6a49 + 368 18 QuartzCore 0x260a66fb + 614 19 WebCore 0x27b7a61b + 274 20 CoreFoundation 0x23e3768f + 14 21 CoreFoundation 0x23e3727d + 452 22 CoreFoundation 0x23e355eb + 794 23 CoreFoundation 0x23d88bf9 CFRunLoopRunSpecific + 520 24 CoreFoundation 0x23d889e5 CFRunLoopRunInMode + 108 25 WebCore 0x2713547f + 422 26 libsystem_pthread.dylib 0x23bad85b + 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 + 150 1 libobjc.A.dylib 0x2361ae17 objc_exception_throw + 38 2 CoreFoundation 0x23e74051 + 0 3 Foundation 0x24754acb + 170 4 Foundation 0x245fe877 + 38 5 Foundation 0x245fa503 + 362 6 UIKit 0x280b69d5 + 52 7 UIKit 0x280b73bb + 222 8 UIKit 0x287d0293 + 322 9 UIKit 0x282b155d + 148 10 UIKit 0x27facd13 + 714 11 QuartzCore 0x260abf99 + 128 12 QuartzCore 0x260a7695 + 348 13 QuartzCore 0x260a7529 + 16 14 QuartzCore 0x260a6a49 + 368 15 QuartzCore 0x260a66fb + 614 16 WebCore 0x27b7a61b + 274 17 CoreFoundation 0x23e3768f + 14 18 CoreFoundation 0x23e3727d + 452 19 CoreFoundation 0x23e355eb + 794 20 CoreFoundation 0x23d88bf9 CFRunLoopRunSpecific + 520 21 CoreFoundation 0x23d889e5 CFRunLoopRunInMode + 108 22 WebCore 0x2713547f + 422 23 libsystem_pthread.dylib 0x23bad85b + 138 24 libsystem_pthread.dylib 0x23bad7cf _pthread_start + 110 25 libsystem_pthread.dylib 0x23bab724 thread_start + 8 )
这种情况不会发生在任何只有iPhone的iPad设备上。
甚至在“skinnier”应用程序上尝试了同样的警告,我正在使用UIWebView的加载请求:
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]; });
感谢任何帮助的人。
UIWebView仍然没有太大的成功,但是有一个名为“WKWebView”的对象是
来实现:
#import
然后在viewDidLoad等初始化:
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文件中:
应用程序传输安全设置 – 字典。
允许任意负载= YES。
它比UIWebView快得多,我没有在日志中得到上面提到的警告。
干杯。