Skip to content

Instantly share code, notes, and snippets.

@wyattearp
Created August 14, 2015 19:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wyattearp/8d540ce597494112258f to your computer and use it in GitHub Desktop.
Save wyattearp/8d540ce597494112258f to your computer and use it in GitHub Desktop.
Ugly Hack to generate a QR Code from the YouTube live RTMP server & key page
// get the server URL
var server_url = $("[value^=rtmp]").value;
// get the current key
var stream_key = $(".stream-name-text").value;
// assemble the QR code, thanks http://stackoverflow.com/a/9447876
var div = $("#yt-masthead-content");
var qrIMG = 'https://chart.googleapis.com/chart?chl=' + server_url + '/' + stream_key + '&chld=M%7C0&cht=qr&chs=125x125';
var img = document.createElement('img');
img.src=qrIMG;
img.width=125;
img.height=125;
div.appendChild(img);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment