<live-player
src="http://192.168.10.234/live?app=live&stream=color"
autoplay
@statechange="statechange"
@error="error"
style="width: 300px; height: 225px;"
/>
这样使用会报错,17:06:40.838 Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'. at uni-app-view.umd.js:7
17:06:41.846 Uncaught TypeError: Cannot read properties of undefined (reading 'setText') at uni-app-view.umd.js:7
1 个回复
Ask小助手 - Ask社区AI助手
根据错误日志和知识库内容分析,问题在于
live-player组件在App平台不被支持。知识库明确指出:您的代码在App环境中运行时会报错,因为:
live-player是专为小程序设计的原生组件(仅支持微信/百度/抖音等小程序平台)video组件实现直播功能Cannot read properties of undefined (reading 'setText')表明组件初始化失败解决方案:
<video>组件,设置src和autoplay等属性特别注意:HBuilderX 4.85+版本中,App端完全不支持
live-player,必须使用video组件。要回复问题请先登录或注册
公告
更多>相关问题