Skip to content

wwdn7/Chrome-Screen-Share-Extension

Repository files navigation

Google Chrome [desktopCapture extension]

This chrome extension simply captures content of your screen. It returns source-id to callee; and that source-id can be used as chromeMediaSourceId in WebRTC applications to capture screen's MediaStream.

Description Download Install
Access/capture screen from any HTTPs domain. Source Code Install from Google Web Store

How to modify?

  1. Download ZIP or TAR
  2. Windows users can use WinZip/WinRAR/7Zip however MacOSX/Linux users can use tar -zxvf desktopCapture.tar.gz to extract the archive
  3. Add your own domain [here at line #17]
  4. LocalHost users can test directly by adding unpacked extension.. via chrome://extensions/
  5. Otherwise you can make ZIP of the entire directory and upload at Google dashboard

Here is how to modify allowed-domains in manifest.json file:

{
    "content_scripts": [ {
       "js": [ "content-script.js" ],
       "all_frames": true,
       "run_at": "document_end",
       "matches": ["https://www.domain.com/*"]
    }]
}

How to publish?

Learn more about how to publish a chrome extension in Google App Store:

How to use?

Download and link Screen-Capturing.js:

Now you can use getScreenConstraints method to capture your screen:

getScreenConstraints(function(error, screen_constraints) {
    if (error) {
        return alert(error);
    }

    navigator.getUserMedia = navigator.webkitGetUserMedia || navigator.mozGetUserMedia;
    navigator.getUserMedia({
        video: screen_constraints
    }, function(stream) {
        var video = document.querySelector('video');
        video.src = URL.createObjectURL(stream);
        video.play();
    }, function(error) {
        alert(JSON.stringify(error, null, '\t'));
    });
});

For more Screen-Capturing.js snippets/help:

Other Extensions

Description Download Install
Record full screen, apps' screen, youtube audio, and more. Source Code Install from Google Web Store
Share full screen, apps' screen, youtube audio, and more. Source Code Install from Google Web Store
Access/capture screen from any HTTPs domain. Source Code Install from Google Web Store
Share selected tab (peer-to-peer). Source Code Install from Google Web Store
Share files peer-to-peer. Source Code Install from Google Web Store

List of applications that are using same extension:

  1. RecordRTC.js - a WebRTC wrapper library for audio+video+screen activity recording
  2. RTCMultiConnection.js - a WebRTC wrapper library for peer-to-peer applications
  3. getScreenId.js - a tinny javascript library that be used in any domain, application or WebRTC wrapper library.
  4. Screen.js - a screen capturing library along with multi-user p2p screen streaming.
  5. Pluginfree Screen Sharing - a standalone application, providing multi-user p2p screen streaming in HD format.

Do NOT Deploy Chrome Extension YourSelf!!!!

getScreenId | Capture Screen on Any Domain! This script is a hack used to support single chrome extension usage on any HTTPs domain.

First step, install this chrome extension:

Now use getScreenId.js (on any HTTPs page):

<script src="https://cdn.WebRTC-Experiment.com/getScreenId.js"></script>
<video controls autoplay></video>
<script>
getScreenId(function (error, sourceId, screen_constraints) {
    navigator.getUserMedia = navigator.mozGetUserMedia || navigator.webkitGetUserMedia;
    navigator.getUserMedia(screen_constraints, function (stream) {
        document.querySelector('video').src = URL.createObjectURL(stream);
    }, function (error) {
        console.error(error);
    });
});
</script>

License

Chrome-Extensions are released under MIT licence . Copyright (c) Muaz Khan.

About

利用谷歌浏览器拓展共享屏幕并通过webrtc分享给远端

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published