Skip to content

Commit

Permalink
Merge pull request #229 from emilio93/master
Browse files Browse the repository at this point in the history
add changes from ed0a400(issue #227 fix) to API Reference
  • Loading branch information
muaz-khan committed Sep 3, 2016
2 parents ed0a400 + c5c1b11 commit d00d7fc
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions docs/api.md
Expand Up @@ -791,21 +791,26 @@ connection.renegotiate(); // with all users

* http://www.rtcmulticonnection.org/docs/addStream/

You can even pass `streamCallback`:
You can even pass `streamCallback` and check if user declined prompt to share
screen:

```javascript
connection.addStream({
screen: true,
oneway: true,
streamCallback: function(screenStream) {
// this will be fired as soon as stream is captured
if (!screenStream) {
alert('User did NOT select to share any stream. He clicked "Cancel" button instead.');
return;
}
screenStream.onended = function() {
document.getElementById('share-screen').disabled = false;

// or show button
$('#share-screen').show();
}
}
};
};
});
```

Expand Down Expand Up @@ -1134,7 +1139,7 @@ Now use below code in any RTCMultiConnection-v3 (screen) demo:

```html
<script src="/dev/globals.js"></script>

<!-- capture screen from any HTTPs domain! -->
<script src="https://cdn.webrtc-experiment.com:443/getScreenId.js"></script>

Expand Down

0 comments on commit d00d7fc

Please sign in to comment.