Created
April 27, 2014 22:24
-
-
Save lfender6445/11357060 to your computer and use it in GitHub Desktop.
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
<template name='video'> | |
<p align="center"><input type="button" id="share_screen" value="Share screen"/></p> | |
<p align="center"><video id="video" autoplay='autoplay'></video></p> | |
<script language="javascript"> | |
navigator.getUserMedia = navigator.webkitGetUserMedia || navigator.getUserMedia; | |
$('#share_screen').click(function() { | |
navigator.getUserMedia({ | |
audio: false, | |
video: { | |
mandatory: { | |
chromeMediaSource: 'screen', | |
maxWidth: 1280, | |
maxHeight: 720 | |
}, | |
optional: [] | |
} | |
}, function(stream) { | |
document.getElementById('video').src = window.URL.createObjectURL(stream);; | |
$('#share_screen').hide(); | |
}, function(e) { | |
console.log(e); | |
alert('Error, my friend. Screen stream is not available. Try in latest Chrome with Screen sharing enabled in about:flags.'); | |
} | |
) | |
}) | |
</script> | |
</template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment