Open kooler opened 10 years ago
Try same demo here; and it is working. Try this one too:
<html>
<body>
<script src="https://www.webrtc-experiment.com/screen-sharing/screen.js"></script>
<script src="https://cdn.firebase.com/v0/firebase.js"></script>
<button id='share-screen'>Share Your Screen</button>
<script>
var screen = new Screen();
screen.onaddstream = function (e) {
document.body.appendChild(e.video);
};
// using firebase for signaling
screen.firebase = 'chat';
// check pre-shared screens
screen.check();
document.getElementById('share-screen').onclick = function () {
screen.share();
this.disabled = true;
};
</script>
</body>
</html>
You need to use same screen-name
for share
and check
methods:
screen.check('aaa');
screen.share('aaa');
// or
screen.check('bbb');
screen.share('bbb');
// or otherwise, pass directly to the constructor
var screen = new Screen('screen-unique-identifier');
screen.check();
screen.share();
Hello,
I'm trying to use minimal setup to enable screen sharing according to: https://github.com/muaz-khan/WebRTC-Experiment/tree/master/screen-sharing but unfortunately it doesn't work -- screen stream added to user that shares it but nothing happens on receiving side.
Code I use:
You can check it online here: https://dl.dropboxusercontent.com/u/178301/screen.html