baozhengrui

导航

播放m3u8格式的视频

<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <title>前端播放m3u8格式视频</title>
  <link rel="stylesheet" type="text/css" href="https://a.xingqiu.tv/xqbl/videojs/video-js-cdn.min.css">
  <script type="text/javascript" src="https://a.xingqiu.tv/xqbl/videojs/video.core.min.js"></script>
  <script type="text/javascript" src="https://a.xingqiu.tv/xqbl/videojs/videojs-contrib-hls.min.js"></script>
</head>
<body>
<video id="myVideo" class="video-js vjs-default-skin vjs-big-play-centered" controls preload="auto" data-setup='{}' muted autoplay>
  <!-- 注意把格式转成.m3u8的 -->
  <source src="https://vodapp.duoduocdn.com/vod-player/1251542705/243791581409019208/tcplayer/console/vod-player.html?autoplay=false&width=960&height=540" >
</video>
<!--<video id="myVideo" class="video-js vjs-default-skin vjs-big-play-centered" controls preload="auto" data-setup='{}' muted autoplay">-->
<!--  &lt;!&ndash; 注意把格式转成.m3u8的 &ndash;&gt;-->
<!--  <source src="http://yspvv.81.cn/video/2022/12/1/757C25D7193C4124BE00D4DE9E2FB20A.m3u8" type="application/x-mpegURL">-->
<!--</video>-->

</body>
<script>
  var player = videojs('myVideo', {
    bigPlayButton: true,
    textTrackDisplay: false,
    posterImage: false,
    errorDisplay: false
  });
</script>

posted on 2023-04-25 19:03  芮艺  阅读(45)  评论(0编辑  收藏  举报