Created
January 27, 2020 11:12
-
-
Save nico-lab/df3324326a4f5d247add8eebafca580f to your computer and use it in GitHub Desktop.
HLSを再生するサンプルHTML
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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