N
O
D
E
M
E
D
I
A
Thinking
首页
产品
文档
博客
订单
文档
常见错误及问题
2026年 5月 20日 下午12:14
## 1.安全原因导致播放失败 控制台打印 ``` VM6:1 Mixed Content: The page at 'https://www.nodemedia.cn/uploads/nodeplayer.html' was loaded over HTTPS, but requested an insecure resource 'http://alplay.nodemedia.cn/live/cam_180.flv'. This request has been blocked; the content must be served over HTTPS. ``` 页面由https访问,但流地址是http或者ws,出于浏览器安全策略限制,无法播放。 解决办法: 1. 页面改为http访问 2. 流地址改为https或在wss ## 2.跨域原因导致播放失败 控制台打印 ``` Access to fetch at 'http://xxxxx.com/live/demo.flv' from origin 'http://demo.nodemedia.cn' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled. ``` 流可以通过ffplay或者vlc播放,但不能在网页上播放 原因是浏览器对http访问有跨域限制,需要流媒体服务端或者CDN商处设置跨域头。 ``` Access-Control-Allow-Origin: * ``` ## 3.IIS下wasm返回404错误 使用IIS作为webserver,程序已经上传到服务器,访问js文件正常,但访问wasm文件返回404错误。 To get rid of the 404 add a new Mime Type for Wasm, it's not currently in IIS 10 (or below). Click Start > Run > type InetMgr > expand Sites > select the app > Mime Types > Add: Extension: .wasm (dot wasm) MIMEType: application/wasm ## 4.Apache,Nginx提供web服务,wasm错误 该错误在浏览器控制台红色打印,可以正常播放,但一定要解决。否则会影响内存性能,解码效率降低。 ``` [ERROR] wasm streaming compile failed: TypeError: Failed to execute 'compile' on 'WebAssembly': Incorrect response MIME type. Expected 'application/wasm'. [ERROR] falling back to ArrayBuffer instantiation ``` web server 未提供wasm后缀文件的mime描述 ### apache修改 mime.types,添加 ``` application/wasm wasm ``` ### nginx修改mime.types,添加 ``` application/wasm wasm; ``` ## 5.chrome无法访问更私有的地址 升级chrome 91后,默认无法从开放的地址往更私有的地址访问。 比如从公网访问web,播放内网的流媒体地址。 ``` Access to fetch at 'http://192.168.0.2:8000/live/bbb.flv' from origin 'http://demo.nodemedia.cn' has been blocked by CORS policy: The request client is not a secure context and the resource is in more-private address space `private`. ``` 打开浏览器的 chrome://flags/#block-insecure-private-network-requests 将这项设置为关闭 ## 6.safari上,自动播放,没有声音 Apple限制所有平台safari浏览器(iOS上所有浏览器都是safari内核)在自动播放时必须静音。 需要由一个真实的用户交互来触发音频恢复,可以是按钮,屏幕触摸等。 start()方法上有恢复,但因为是代码播放的,所以不算。 此时的解决方法是在交互上做一个按钮之类的,触发后调用audioResume ()这个方法也能恢复。 NodePlayer.js的对象只需要触发一次,后面对象重用再播放其它流时不需要二次触发。 可以在进入页面前就创建好对象,在用户点按进入播放页面时,就触发音频恢复,这样自动播放就有声了。 ## 7.无法同时打开超过16个画面 chrome限制最大WebGL Context为16,超过这个数以后会出警告 ``` WARNING: Too many active WebGL contexts. Oldest context will be lost. ``` 前面已创建的视图也会崩溃错误 
嘿,我是小R,需要帮助随时找我哦
QQ客服:281269007
邮件支持
扫码加微信
回到顶部