小程序网络视频组件错误
1.错误提示如下
3[渲染层网络层错误] Failed to load media http://www.xxx.net/download/1.mp4#devtools_no_referrer
net::ERR_FAILED
From server 112.126.62.195(env: Windows,mp,1.06.2401020; lib: 3.3.4)
2.解决文章请参考
本文链接:https://blog.csdn.net/csdn1940879828/article/details/129968652
微信小程序引入网络视频的时候:出现 渲染层网络层错误 Failed to load media
给组件加入autoplay后错误消失
3.原来代码
wxml端代码如下:
<!-- 视频区域 -->
<video show-center-play-btn="{{false}}"
controls="{{false}}"
id="video"
src='{{src}}'
></video>
<!-- 播放按钮 -->
<view class='video_play_container'>
<image bindtap="videoPlay" class='video_btn' src='/template/exhibition_video/taobao_imgs/play.png'/>
<image bindtap="videoPause" class='video_btn' src='/template/exhibition_video/taobao_imgs/pause.png'/>
</view>
js端代码如下:
data: {
src:"http://www.xxxx.net/download/1.mp4"
},
4.整改后的代码
wxml端代码如下:
<!-- 视频区域 -->
<video show-center-play-btn="{{false}}"
controls="{{false}}"
id="video"
src='{{src}}'
autoplay="false"
></video>
<!-- 播放按钮 -->
<view class='video_play_container'>
<image bindtap="videoPlay" class='video_btn' src='/template/exhibition_video/taobao_imgs/play.png'/>
<image bindtap="videoPause" class='video_btn' src='/template/exhibition_video/taobao_imgs/pause.png'/>
</view>
js端代码如下:
data: {
src:"http://www.xxxx.net/download/1.mp4"
},