Comments (11)
@790587047 我提交了PR
, 我验证了一下,默认的UIWebView
和WKWebView
都无法播放视频,mobile safari可以,所以我模拟了safari的User-Agent
. 原因应该是百度判断User-Agent
的时候出现了误判,不修改的话会通过iframe
出发调用百度盒子,导致播放不了。
from webbrowser.
@zhongwuzw 好的,谢谢作者,我这边改了下确实是可以了,想问下这个排查思路是什么呢?确实是只有百度的有问题,其他平台的视频的都是没问题的,但是safari又可以的,所以比较尴尬。
from webbrowser.
@790587047 排查思路是首先最小化复现步骤,如去掉所有逻辑操作,单独测试UIWebView
和WKWebView
, 原生空间是否存在问题,如果存在问题,判断Mobile Safari
是否存在问题,不存在,基本定位为User-Agent
的问题,因为识别Client
只能通过User-Agent
,接下来就是使用UIWeiView
来调试百度网页,可以看到点击播放视频时,js
会使用iframe
来触发百度全家桶。
from webbrowser.
@zhongwuzw 好的,谢谢。还有个问题想请教下,也是测试视频的时候发现的,https://videojs.com (需要翻墙) 这个网站顶部的视频,点开后拉到结束,然后结束后再点开,重复几次就会闪退,目前测试到的就是这种使用系统自带的播放的就会,还在测别的网站,报的堆栈信息是这个,是系统的内部的错误,有什么排查思路可以解决这种情况的
- thread #11, name = 'WebThread', stop reason = EXC_BAD_ACCESS (code=1, address=0x7d26c00100000050)
- frame #0: 0x00000001dfade38c WebCore
WebCore::PlaybackSessionModelMediaElement::updateForEventName(WTF::AtomicString const&) + 680 frame #1: 0x00000001e0419c28 WebCore
WebCore::EventTarget::fireEventListeners(WebCore::Event&, WTF::Vector<WTF::RefPtr<WebCore::RegisteredEventListener, WTF::DumbPtrTraitsWebCore::RegisteredEventListener >, 1ul, WTF::CrashOnOverflow, 16ul>) + 736
frame #2: 0x00000001e0417548 WebCoreWebCore::EventTarget::fireEventListeners(WebCore::Event&) + 260 frame #3: 0x00000001e0414460 WebCore
WebCore::dispatchEventInDOM(WebCore::Event&, WebCore::EventPath const&) + 152
frame #4: 0x00000001e0414128 WebCoreWebCore::EventDispatcher::dispatchEvent(WebCore::Node&, WebCore::Event&) + 700 frame #5: 0x00000001e05c9d90 WebCore
WebCore::HTMLMediaElement::dispatchEvent(WebCore::Event&) + 192
frame #6: 0x00000001e041c780 WebCoreWebCore::GenericEventQueue::dispatchOneEvent() + 168 frame #7: 0x00000001e08cb918 WebCore
WebCore::TaskDispatcherWebCore::Timer::sharedTimerFired() + 204
frame #8: 0x00000001e08e8ec0 WebCoreWebCore::ThreadTimers::sharedTimerFiredInternal() + 352 frame #9: 0x00000001e092d7ac WebCore
WebCore::timerFired(__CFRunLoopTimer*, void*) + 28
frame #10: 0x00000001d6e32bf0 CoreFoundation__CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 28 frame #11: 0x00000001d6e32920 CoreFoundation
__CFRunLoopDoTimer + 864
frame #12: 0x00000001d6e32154 CoreFoundation__CFRunLoopDoTimers + 248 frame #13: 0x00000001d6e2d030 CoreFoundation
__CFRunLoopRun + 1880
frame #14: 0x00000001d6e2c5b8 CoreFoundationCFRunLoopRunSpecific + 436 frame #15: 0x00000001dfc53ba4 WebCore
RunWebThread(void*) + 592
frame #16: 0x00000001d6abd2fc libsystem_pthread.dylib_pthread_body + 128 frame #17: 0x00000001d6abd25c libsystem_pthread.dylib
_pthread_start + 48
frame #18: 0x00000001d6ac0d08 libsystem_pthread.dylib`thread_start + 4
- frame #0: 0x00000001dfade38c WebCore
from webbrowser.
从回溯栈来看,是WebKit
的bug,而且我理解EXC_BAD_ACCESS
这种基本是无解的。你这边可以提交Radar,我建议维持现状。
from webbrowser.
@zhongwuzw safari应该也是用的webkit内核的吧,safari试了好多次,都是不会的,自己重新开个项目写一个最简单的webview还是会,UA的safari版本也是改的最新的,所以比较尴尬。
from webbrowser.
@790587047 我这边在iOS12
模拟器上试了一下没有复现,点击播放视频之后会进入全屏模式,然后来回播放?
from webbrowser.
@zhongwuzw 点击视频之后进入全屏,然后手动拉到结束或者自动结束,然后关闭全屏,关闭之后再点重新播放,次数不定,就会复现,不止那个网站了,今天试了腾讯的也会
from webbrowser.
@790587047 WKWebView
有问题么?WKWebView
使用了多进程模式,渲染进程并不和UIWebView
一样,UIWebView
是单进程的,和用户进程一起,所以WebCore
Crash没有什么办法。
from webbrowser.
@zhongwuzw WKWebView还真没问题~那这个只能换wk才能解决或者说这个如果要扣视频链接出来原生播放怎么阻止原先的web的视频播放,用urlprotocol没办法阻止事件、好僵硬,基本上播视频的都可能存在这个问题。
from webbrowser.
还有个,就是基本上是12系统的,之前的系统基本没测出来
from webbrowser.
Related Issues (20)
- 想请教作者一个问题,类似于UC浏览器的夜间模式是怎么实现的? HOT 5
- 一个网址本地缓存的问题。 HOT 7
- 你好 有问题想请教 HOT 1
- 关于浏览器前进后退网页刷新的问题 HOT 5
- 关于访问网页带有iframe内嵌网页的网址时修改CSS样式 HOT 4
- 项目无法运行 HOT 6
- 编译不了 HOT 2
- 工程编译不通过 HOT 1
- QQ一键登录失败 HOT 3
- 作者你好,请教一个技术问题 HOT 8
- 作者你好,多窗口的那个close按钮,很难点中 HOT 1
- 作者你好,随便找一个可以播放视频的网站,打开以后,返回桌面,会出现崩溃 HOT 3
- 作者,你好,你找一个H5游戏,进入后台,会报gpus_ReturnNotPermittedKillClient。原因是UIWebView进入后台,不允许使用OpenGL。请看下面的链接 HOT 4
- 做得很棒喔 HOT 3
- 你这个浏览器的内核不是Webview啊,还有你这个历史记录里面的数据哪里来的
- 浏览器有没有无痕模式的功能? HOT 1
- 怎么push进来就加载某个网页 HOT 1
- 现在苹果商店不支持UIWEBVIEW了,有木有解决办法?
- UIWebView
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webbrowser.