-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1) Fixed Signaling-Server.js for backward “checkPresence” compatibility. 2) Added new demo: Capture & Share screen from any HTTPs domain: https://rtcmulticonnection.herokuapp.com/demos/Cross-Domain-Screen-Captu ring.html So you don’t need to deploy chrome extension yourself. Simply use getScreenId.js as you can see in the above demo. 3) Fixed mute/unmute on cordova/iOS 4) Now using our own TURN-servers. Now you will get better results!!!
- Loading branch information
Showing
14 changed files
with
332 additions
and
32 deletions.
There are no files selected for viewing
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
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,229 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||
<meta charset="utf-8"> | ||
<meta name="format-detection" content="telephone=no"> | ||
<meta name="msapplication-tap-highlight" content="no"> | ||
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width"> | ||
|
||
<link rel="stylesheet" href="https://cdn.webrtc-experiment.com/style.css"> | ||
|
||
<title>Capture & Share Screen from any domain! using RTCMultiConnection-v3</title> | ||
|
||
<meta name="description" content="Capture & Share Screen from any domain! using RTCMultiConnection v3" /> | ||
<meta name="keywords" content="WebRTC,RTCMultiConnection,Demos,Experiments,Samples,Examples" /> | ||
|
||
<style> | ||
* { | ||
word-wrap:break-word; | ||
} | ||
video { | ||
object-fit: fill; | ||
width: 100%; | ||
} | ||
button, | ||
input, | ||
select { | ||
font-weight: normal; | ||
padding: 2px 4px; | ||
text-decoration: none; | ||
display: inline-block; | ||
text-shadow: none; | ||
font-size: 16px; | ||
outline: none; | ||
} | ||
|
||
.make-center { | ||
text-align: center; | ||
padding: 5px 10px; | ||
} | ||
|
||
img, input, textarea { | ||
max-width: 100% | ||
} | ||
|
||
@media all and (max-width: 500px) { | ||
.fork-left, .fork-right, .github-stargazers { | ||
display: none; | ||
} | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<article> | ||
|
||
<header style="text-align: center;"> | ||
<h1>Capture & Share Screen from any domain! using RTCMultiConnection-v3</h1> | ||
<p> | ||
<a href="https://rtcmulticonnection.herokuapp.com/">HOME</a> | ||
<span> © </span> | ||
<a href="http://www.MuazKhan.com/" target="_blank">Muaz Khan</a> . | ||
<a href="http://twitter.com/WebRTCWeb" target="_blank" title="Twitter profile for WebRTC Experiments">@WebRTCWeb</a> . | ||
<a href="https://github.com/muaz-khan?tab=repositories" target="_blank" title="Github Profile">Github</a> . | ||
<a href="https://github.com/muaz-khan/RTCMultiConnection/issues?state=open" target="_blank">Latest issues</a> . | ||
<a href="https://github.com/muaz-khan/RTCMultiConnection/commits/master" target="_blank">What's New?</a> | ||
</p> | ||
</header> | ||
|
||
<div class="github-stargazers"></div> | ||
|
||
<blockquote> | ||
You MUST have to install this chrome extension:<br> | ||
<a href="https://chrome.google.com/webstore/detail/screen-capturing/ajhifddimkapgcifgcodmmfdlknahffk">https://chrome.google.com/webstore/detail/screen-capturing/ajhifddimkapgcifgcodmmfdlknahffk</a> | ||
<br><br> | ||
Now try this HTML demo file on any HTTPs domain and it will work! | ||
|
||
<br><br> | ||
<strong>Note:</strong> You may need to set "<a href="https://github.com/muaz-khan/RTCMultiConnection#set-different-socket-url">connection.socketURL</a>" in this HTML file. | ||
</blockquote> | ||
|
||
<section class="experiment"> | ||
<div class="make-center"> | ||
<input type="text" id="room-id" value="abcdef" autocorrect=off autocapitalize=off size=20> | ||
<button id="open-room">Open Room</button> | ||
<button id="join-room">Join Room</button> | ||
<button id="open-or-join-room">Auto Open Or Join Room</button> | ||
</div> | ||
|
||
<div id="videos-container"></div> | ||
</section> | ||
|
||
<!-- <script src="/dist/rmc3.min.js"></script> --> | ||
<script src="https://cdn.webrtc-experiment.com:443/rmc3.min.js"></script> | ||
|
||
<script src="/dev/globals.js"></script> | ||
|
||
<!-- capture screen from any HTTPs domain! --> | ||
<script src="https://cdn.webrtc-experiment.com:443/getScreenId.js"></script> | ||
|
||
<!-- socket.io for signaling --> | ||
<script src="/socket.io/socket.io.js"></script> | ||
|
||
<script> | ||
// ...................................................... | ||
// .......................UI Code........................ | ||
// ...................................................... | ||
|
||
document.getElementById('open-room').onclick = function() { | ||
this.disabled = true; | ||
connection.open(document.getElementById('room-id').value); | ||
|
||
document.getElementById('room-id').onkeyup(); | ||
}; | ||
|
||
document.getElementById('join-room').onclick = function() { | ||
this.disabled = true; | ||
connection.join(document.getElementById('room-id').value); | ||
|
||
document.getElementById('room-id').onkeyup(); | ||
}; | ||
|
||
document.getElementById('open-or-join-room').onclick = function() { | ||
this.disabled = true; | ||
connection.openOrJoin(document.getElementById('room-id').value); | ||
|
||
document.getElementById('room-id').onkeyup(); | ||
}; | ||
|
||
// ...................................................... | ||
// ..................RTCMultiConnection Code............. | ||
// ...................................................... | ||
|
||
var connection = new RTCMultiConnection(); | ||
|
||
// by default, socket.io server is assumed to be deployed on your own URL | ||
connection.socketURL = '/'; | ||
|
||
// comment-out below line if you do not have your own socket.io server | ||
// connection.socketURL = 'https://rtcmulticonnection.herokuapp.com:443/'; | ||
|
||
connection.socketMessageEvent = 'cross-domain-screen-capture-demo'; | ||
|
||
var roomid = ''; | ||
if(localStorage.getItem('rmc-room-id')) { | ||
roomid = localStorage.getItem('rmc-room-id'); | ||
} | ||
else { | ||
roomid = connection.token(); | ||
} | ||
document.getElementById('room-id').value = roomid; | ||
document.getElementById('room-id').onkeyup = function() { | ||
localStorage.setItem('rmc-room-id', this.value); | ||
}; | ||
|
||
connection.session = { | ||
screen: true, | ||
oneway: true | ||
}; | ||
|
||
connection.sdpConstraints.mandatory = { | ||
OfferToReceiveAudio: false, | ||
OfferToReceiveVideo: true | ||
}; | ||
|
||
connection.videosContainer = document.getElementById('videos-container'); | ||
connection.onstream = function(event) { | ||
connection.videosContainer.appendChild(event.mediaElement); | ||
event.mediaElement.play(); | ||
setTimeout(function() { | ||
event.mediaElement.play(); | ||
}, 5000); | ||
}; | ||
|
||
// Using getScreenId.js to capture screen from any domain | ||
// You do NOT need to deploy Chrome Extension YOUR-Self!! | ||
connection.getScreenConstraints = function(callback, audioPlusTab) { | ||
if (isAudioPlusTab(connection, audioPlusTab)) { | ||
audioPlusTab = true; | ||
} | ||
|
||
getScreenConstraints(function(error, screen_constraints) { | ||
if (!error) { | ||
screen_constraints = connection.modifyScreenConstraints(screen_constraints); | ||
callback(error, screen_constraints); | ||
} | ||
}, audioPlusTab); | ||
}; | ||
</script> | ||
|
||
<section class="experiment own-widgets latest-commits"> | ||
<h2 class="header" id="updates" style="color: red;padding-bottom: .1em;"><a href="https://github.com/muaz-khan/RTCMultiConnection/commits/master">Latest Updates</a></h2> | ||
<div id="github-commits"></div> | ||
</section> | ||
|
||
<section class="experiment own-widgets"> | ||
<h2 class="header" id="updates" style="color: red;padding-bottom: .1em;"><a href="https://github.com/muaz-khan/RTCMultiConnection/issues">Latest Issues</a></h2> | ||
<div id="github-issues"></div> | ||
</section> | ||
|
||
<section class="experiment"> | ||
<h2 class="header" id="feedback">Feedback</h2> | ||
<div> | ||
<textarea id="message" style="height: 8em; margin: .2em; width: 98%; border: 1px solid rgb(189, 189, 189); outline: none; resize: vertical;" placeholder="Have any message? Suggestions or something went wrong?"></textarea> | ||
</div> | ||
<button id="send-message" style="font-size: 1em;">Send Message</button><small style="margin-left:1em;">Enter your email too; if you want "direct" reply!</small> | ||
</section> | ||
|
||
<a href="https://github.com/muaz-khan/RTCMultiConnection" class="fork-left"></a> | ||
|
||
<script> | ||
window.useThisGithubPath = 'muaz-khan/RTCMultiConnection'; | ||
</script> | ||
<script src="https://cdn.webrtc-experiment.com/commits.js" async></script> | ||
|
||
</article> | ||
|
||
<footer> | ||
<p> | ||
<a href="https://www.webrtc-experiment.com">WebRTC Experiments</a> © <a href="https://plus.google.com/+MuazKhan" rel="author" target="_blank">Muaz Khan</a> | ||
<a href="mailto:[email protected]" target="_blank">[email protected]</a> | ||
<a href="https://github.com/muaz-khan" target="_blank">Github</a> | ||
</p> | ||
</footer> | ||
|
||
</body> | ||
|
||
</html> |
Oops, something went wrong.