Home  >  Q&A  >  body text

html5 - 微信内置浏览器中无法控制video标签的行为

要在微信中访问页面,页面上的video元素不需要浏览器自带的播放控件,同时需要自己写一个按钮控制视频的静音切换

在chrome手机模拟器,手机版chrome中都没有任何问题,但是页面在微信中打开,出现了播放暂停按钮,进度条,全屏等等控件,这些把我自己写的声音按钮挡住了

就算我在css中把按钮移到video覆盖范围之外,但是在微信中点击它不会切换静音,它的功能是用js操作video.muted属性来切换的

SF上之前有个类似问题:http://segmentfault.com/q/1010000002998237
不过没有人给出解决办法,在一些群里面也问了这个问题,普遍回答都是这是微信X5内核的坑......还是希望有前辈能给出解决方法

大家讲道理大家讲道理2741 days ago826

reply all(4)I'll reply

  • 阿神

    阿神2017-04-17 11:48:42

    Video is a big pitfall. Android video has no solution. There is no solution. Of course: sequence frame + audio is a bad idea

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-17 11:48:42

    Have you solved it now?

    reply
    0
  • 怪我咯

    怪我咯2017-04-17 11:48:42

    Youku, iQiyi, etc. are in the whitelist of major rogue browsers. The video will not be hijacked. If it is hijacked, it will be sued until it goes bankrupt. We and other little people can only be hijacked and deceived

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-17 11:48:42

    Regarding the control bar that comes with the browser, you can try using CSS control:

    video::-webkit-media-controls {  
        display:none !important;
    }
    

    reply
    0
  • Cancelreply