2***@qq.com
2***@qq.com
  • 发布:2025-11-06 12:28
  • 更新:2025-11-06 15:12
  • 阅读:53

【报Bug】微信内置浏览器无法自动播放下一个视频

分类:uni-app

产品分类: uniapp/H5

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: 10

HBuilderX类型: 正式

HBuilderX版本号: 4.76

浏览器平台: 微信内置浏览器

浏览器版本: 微信内置浏览器版本

项目创建方式: HBuilderX

App下载地址或H5⽹址: https://static-mp-d82591b7-3eb7-4495-93a5-65679e28ea19.next.bspapp.com/#/

示例代码:
<template>  
    <view class="content">  
        <image class="logo" src="/static/logo.png"></image>  
        <video v-for="video in vList" :show-progress="true" :controls="true" :key="video.id"  
            :id="'videoPlayer' + video.id" :src="video.url" preload="auto" x5-video-player-fullscreen="true"  
            :custom-cache="false" object-fit="cover" x5-video-player-type="h5" :show-center-play-btn="false"  
            v-show="video.id === currentVideoId" :muted="video.muted" @ended="onEnded(video.id)"  
            @error="onVideoError(video.id, $event)"></video>  
        <view class="play-video-box">  
            <view class="play-video-item" @click="handlePlayVideo">  
                <button type="primary">播放视频</button>  
            </view>  
        </view>  
    </view>  
</template>  
<script>  
    export default {  
        data() {  
            return {  
                title: 'Hello',  
                currentVideoId: 0,  
                vList: [{  
                    id: 0,  
                    url: 'https://www.w3school.com.cn/example/html5/mov_bbb.mp4',  
                    muted: false  
                }, {  
                    id: 1,  
                    url: 'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/2minute-demo.mp4',  
                    muted: false  
                }],  
            }  
        },  
        methods: {  
            handlePlayVideo() {  
                this.playVideoById(0)  
            },  
            onEnded(videoId) {  
                this.playVideoById(1)  
            },  
            playVideoById(videoId) {  
                this.pauseAllVideos();  
                const videoIndex = this.vList.findIndex(video => video.id === videoId);  
                if (videoIndex !== -1) {  
                    this.currentVideoId = videoId;  
                    this.$nextTick(() => {  
                        const videoPlayer = uni.createVideoContext('videoPlayer' + videoId, this);  
                        videoPlayer.play();  
                    });  
                }  
            },  
            pauseAllVideos() {  
                this.vList.forEach(video => {  
                    const videoPlayer = uni.createVideoContext('videoPlayer' + video.id, this);  
                    videoPlayer.pause();  
                });  
            },  
        }  
    }  
</script>

操作步骤:

微信内置浏览器打开100%复现
只有 android 系统有问题,iOS一切正常(微信内置浏览器也是正常)

预期结果:

微信内置浏览器一切正常

实际结果:

微信内置浏览器打开无法播放视频

bug描述:

微信内置浏览器无法自动播放下一个视频,详细请看代码

在PC浏览器和手机默认浏览器一切都是正常。

附件有2个视频,1个是微信内置浏览器有BUG无法播放,1个是手机浏览器一切正常可以播放

只有 android 系统有问题,iOS一切正常(微信内置浏览器也是正常)

2025-11-06 12:28 负责人:无 分享
已邀请:
2***@qq.com

2***@qq.com (作者)

官网人员关注看看

暴躁东北虎

暴躁东北虎

这个是微信内置浏览器的限制吧?我看报错提示是要求需要用户手势触发,搜索也说是微信浏览器的限制

  • 2***@qq.com (作者)

    原生桥接是什么

    2025-11-06 15:15

  • 暴躁东北虎

    回复 2***@qq.com: WeixinJSBridge呗,但没这个功能吧?微信官方很早出过这个公告了

    https://developers.weixin.qq.com/community/develop/doc/000e640d77cfa001132a6cb8456c01?highLine=%25E8%2587%25AA%25E5%258A%25A8%25E6%2592%25AD%25E6%2594%25BE

    2025-11-06 15:32

要回复问题请先登录注册