Skip to content

Instantly share code, notes, and snippets.

@nico-lab
Created January 27, 2020 11:12
Show Gist options
  • Save nico-lab/df3324326a4f5d247add8eebafca580f to your computer and use it in GitHub Desktop.
Save nico-lab/df3324326a4f5d247add8eebafca580f to your computer and use it in GitHub Desktop.
HLSを再生するサンプルHTML
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8" />
<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
<title>hlsjs</title>
</head>
<body>
<video id="video_smaple" controls>
<script>
if(Hls.isSupported()) {
var video = document.getElementById('video_smaple'); //videoタグと同じIDにする
var hls = new Hls();
hls.loadSource('master.m3u8'); //ここで.m3u8ファイルを指定
hls.attachMedia(video);
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment