Last active
February 10, 2019 19:54
-
-
Save stmps/78ebb0b3d8979b333b0b to your computer and use it in GitHub Desktop.
example jwplayer HTML for live playback of an RTMP stream
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> | |
<head> | |
<script type="text/javascript" src="/jwplayer/jwplayer.js"></script> | |
</head> | |
<body style="margin:0;padding:0"> | |
<div id="player">Loading the player...</div> | |
<script type="text/javascript"> | |
var aURL = window.location.href; | |
var streamkey = 'spelunky'; | |
if (aURL.indexOf('?') != -1) { | |
streamkey = aURL.slice(aURL.indexOf('?') + 1); | |
} | |
jwplayer("player").setup({ | |
file: "rtmp://stream.tgs.id.au/livestream/flv:" + streamkey, | |
image: "/spelunky.gif", | |
width: "100%", | |
aspectratio: "16:9", | |
title: "stream.tgs.id.au", | |
rtmp: { bufferlength: 0.2 }, | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment