<view wx:if="{{product.video_url}}" class="details-section">
<text class="details-title">视频</text>
<video src="{{product.video_url}}" controls autoplay="{{false}}" enable-danmu="{{false}}" style="width: 100%; height: 300rpx; object-fit: cover; border-radius: 8rpx;">
</video>
</view>
{"code":200,"msg":"查询成功","data":{"id":2985,"name":"11111111111","category_id":9,"price":"0.00","video_url":"https://www.asjieju.cn/videos/2025-09-23/1758611137611-flower.mp4","conver_img":"https://www.asjieju.cn/uploads/2025-09-23/17586086687360.png","conver_img1":null,"conver_img2":null,"conver_img3":null,"qrcode_img":null,"description":"<p>11111</p>","created_at":"2025-09-23T06:24:35.000Z","updated_at":"2025-09-23T07:05:40.000Z","oe_id":null,"is_del":1,"state":1,"sort_order":0,"lastID":2984,"nextID":""}}
nginx已经配置了,公网和开发者工具可以访问视频文件,downloadFile合法域名和request合法域名已经配置https:
location /uploads/ {
root /www/wwwroot/node/public;
index index.html;
expires 30d;
add_header Cache-Control "public";
}
# 其他静态文件目录(如果需要)
location /videos/ {
root /www/wwwroot/node/public;
expires 30d;
add_header Cache-Control "public";
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods 'GET, HEAD, OPTIONS';
add_header Access-Control-Allow-Headers 'Range';
add_header Accept-Ranges bytes;
types {
video/mp4 mp4;
}
}
你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)
开发者工具可以显示视频内容,说明不是代码问题,而是微信小程序的线上环境问题。代码片段,核心代码都在上面了。
h: 100%; heightstyle="width: 100%; hsrc="https://www.asjieju.cn/videos/2025-09-23/1758611137611-flower.mp4"eight: 150px; object-fit: cover; border-radius: 4px;": 150px; object-fit: cover; border-radius: 4px;"
建议创建一个不能播放的代码片段,参考
https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html