Mfuns-cn / Mfuns-Compose

喵御宅 WebApp、Android 和 PC 客户端

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

无法观看视频

ilharp opened this issue · comments

概述

App 无法观看视频。

日志

日志 1:

D/NetworkSecurityConfig: No Network Security Config specified, using platform default
I/chromium: [INFO:CONSOLE(11)] "A parser-blocking, cross site (i.e. different eTLD+1) script, https://unpkg.com/dplayer@1.26.0/dist/DPlayer.min.js, is invoked via document.write. The network request for this script MAY be blocked by the browser in this or a future page load due to poor network connectivity. If blocked in this page load, it will be confirmed in a subsequent console message. See https://www.chromestatus.com/feature/5718547946799104 for more details."
I/chromium: [INFO:CONSOLE(1)] "
     %c DPlayer v1.26.0 63275c8 %c http://dplayer.js.org 
    ", source: https://unpkg.com/dplayer@1.26.0/dist/DPlayer.min.js (1)

可能由于安全规则导致。


日志 2:

I/chromium: [INFO:CONSOLE(6)] "Can not detect viewport width.", source: https://www.mfuns.cn/css/css85/assets/js/owl.carousel.min.js?ver=1.6.85.01 (6)

可能由于 Context 使用 Application Context 导致。

问题已解决。

点击视频,日志报错为:

I/chromium: [INFO:CONSOLE(1)] "Uncaught TypeError: Cannot read property 'getItem' of null", source: https://unpkg.com/dplayer@1.26.0/dist/DPlayer.min.js (1)

根据提示找到 DPlayer 调用 getItem() 的部分,仅一处:

https://github.com/DIYgod/DPlayer/blob/808dd623d6b3facf321f27f9358c5fe97b3931a3/src/js/utils.js#L96-L102

可知是 LocalStorage 相关问题。查询 WebView 相关 API,设置:

setDomStorageEnabled(true);

问题解决。