Skip to content

Instantly share code, notes, and snippets.

@tonyspiro tonyspiro/mux.html
Created Jan 11, 2019

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
You can’t perform that action at this time.