Skip to content

Instantly share code, notes, and snippets.

@andrewn
Created January 22, 2015 17:46
Show Gist options
  • Save andrewn/0c56b59bebc98c92da20 to your computer and use it in GitHub Desktop.
Save andrewn/0c56b59bebc98c92da20 to your computer and use it in GitHub Desktop.
HLS mediaplayerelement
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>HTML5 MediaElement - HLS</title>
<script src="../build/jquery.js"></script>
<script src="../build/mediaelement-and-player.min.js"></script>
<link rel="stylesheet" href="../build/mediaelementplayer.min.css" />
</head>
<body>
<h1>MediaElementPlayer.js</h1>
<h2>HLS Wrapper</h2>
<video width="640" height="360" id="player1">
<!-- Pseudo HTML5 -->
<source type="application/x-mpegURL" src="!!HLS STREAM HERE!!" />
</video>
<script>
$('video').mediaelementplayer({
success: function(media, node, player) {
$('#' + node.id + '-mode').html('mode: ' + media.pluginType);
}
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment