Html5 videojs player framework 视频播放

Html5 videojs player framework 视频播放

官方:https://videojs.com/

<head>
  <link href="https://vjs.zencdn.net/8.0.4/video-js.css" rel="stylesheet" />

  <!-- If you'd like to support IE8 (for Video.js versions prior to v7) -->
  <!-- <script src="https://vjs.zencdn.net/ie8/1.1.2/videojs-ie8.min.js"></script> -->
</head>

<body>
  <video
    id="my-video"
    class="video-js"
    controls
    preload="auto"
    width="640"
    height="264"
    poster="MY_VIDEO_POSTER.jpg"
    data-setup="{}"
  >
    <source src="MY_VIDEO.mp4" type="video/mp4" />
    <source src="MY_VIDEO.webm" type="video/webm" />
    <p class="vjs-no-js">
      To view this video please enable JavaScript, and consider upgrading to a
      web browser that
      <a href="https://videojs.com/html5-video-support/" target="_blank"
        >supports HTML5 video</a
      >
    </p>
  </video>

  <script src="https://vjs.zencdn.net/8.0.4/video.min.js"></script>
</body>

1、poster=”MY_VIDEO_POSTER.jpg” 视频封面。

2、source  video/mp4 格式的文件地址。

3、source  video/webm 格式的文件地址。

发表回复

您的电子邮箱地址不会被公开。