收藏
回答

video组件在真机,无法播放,如何及解决?

<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://www.asjieju.cn
       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;
        }
    }


回答关注问题邀请回答
收藏

3 个回答

登录 后发表内容