Skip to content

Instantly share code, notes, and snippets.

@tonyspiro
Created January 11, 2019 06:21
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
<video id="myVideo" controls></video>
<!-- Use HLS.js to support the HLS format in browsers. -->
<script src="https://cdn.jsdelivr.net/npm/hls.js@0.8.2"></script>
<script>
(function(){
// Replace with your asset's playback ID
var playbackId = "oIdQlddn3YGhfCK00Mkj0169KMArk2s701Q";
var url = "https://stream.mux.com/"+playbackId+".m3u8";
// HLS.js-specific setup code
if (Hls.isSupported()) {
var video = document.getElementById("myVideo");
var hls = new Hls();
hls.loadSource(url);
hls.attachMedia(video);
}
})();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment