Skip to content

Instantly share code, notes, and snippets.

@dbiesecke
Created July 14, 2020 10:41
Show Gist options
  • Save dbiesecke/9812064fc380f4d46d918443d3d39764 to your computer and use it in GitHub Desktop.
Save dbiesecke/9812064fc380f4d46d918443d3d39764 to your computer and use it in GitHub Desktop.
MPEGTS JavaScript Player
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/jsmpeg-player@3/build/jsmpeg-player.min.js"></script>
<script>
function testStream() {
var videoUrl = document.getElementById("myinput").value;
new JSMpeg.VideoElement('#videoWrapper', videoUrl);
}
</script>
</head>
<body>
<input id="myinput" type="text" name="query" class="form-control" placeholder="url"></input>
<button onclick="testStream()">Test</button>
<div id="videoWrapper"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment