videojs hls재생

catch me if u can!·2021년 2월 9일
0

참조

https://videojs.com/
https://docs.videojs.com/player
https://videojs.github.io/videojs-contrib-hls/
https://github.com/videojs/http-streaming

코드

<head>
  <link href="./video-js.min.css" rel="stylesheet">
  <script src="./video.min.js"></script>
  <script src="./videojs-http-streaming.min.js"></script>
</head>

<body>
  <video id="vplay" width="640" height="480" class="video-js vjs-default-skin" preload="auto" data-setup='{}' controls="false">Your browser does not support the video tag.</video>
</body>

<script>
var $vplay = videojs("vplay");
$vplay.src({
	src:"....m3u8",
	type:"application/x-mpegurl"
});
//
//$vplay.play();
//$vplay.pause();
//$vplay.on("error", error=>console.error(error));
</script>

2021-05-11 videojs-contrib-hls가 deprecated 되어서 videojs-http-streaming 으로 변경, 아래 환경에서 테스트 ( video.js 7.11.8, http-streaming 2.8.0 )

profile
마쿠투소케 난쿠로나이사

0개의 댓글