videojs插件什么属性能在chrome浏览器进行自动播放,不需要设置muted

来源:8-1 videojs(1)

慕尼黑7895541

2020-08-28 19:11:28

<!DOCTYPE html>

<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->

<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->

<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->

<!--[if gt IE 8]><!--> 

<html class="no-js"> <!--<![endif]-->

    <head>

        <meta charset="utf-8">

        <meta http-equiv="X-UA-Compatible" content="IE=edge">

        <title></title>

        <meta name="description" content="">

        <meta name="viewport" content="width=device-width, initial-scale=1">

        <link rel="stylesheet" href="./videojs/video-js.min.css">

        <script type="text/javascript" src="./videojs/video.min.js"></script>

    </head>

    <body>

        <!--[if lt IE 7]>

            <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="#">upgrade your browser</a> to improve your experience.</p>

        <![endif]-->

        <video id="my-video" class="video-js vjs-big-play-centered" controls data-setup="{}" autoplay muted>

            <!-- scr如果放在video则导致data-setup属性的播放功能失效 -->

            <source src="./data/imooc.mp4">

        </video>

        <script src="" async defer></script>

    </body>

</html>


写回答

1回答

好帮手慕久久

2020-08-29

同学你好,videojs本身提供了autoplay属性,设置为true后就是开启自动播放,但是目前测试,谷歌浏览器依旧是不支持,将自动播放禁掉了,同学了解一下即可。

祝学习愉快!

0

0 学习 · 6815 问题

查看课程