Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screen Share doesn't work with https ngrok or localhost #741

Open
hipkiss91 opened this issue Aug 8, 2018 · 0 comments
Open

Screen Share doesn't work with https ngrok or localhost #741

hipkiss91 opened this issue Aug 8, 2018 · 0 comments

Comments

@hipkiss91
Copy link

hipkiss91 commented Aug 8, 2018

Does this actually work?
The code works on a "chrome tab" website and the desired outcome of chrome asking me which screen to select happens. But when doing it from a new window/popup window launched from the chrome tab website then it doesn't have the desired outcome. Anyone any thoughts?

All the console logs get triggered. Just no prompt to select screen (same screen selection thing as chromecast)

// 1. insert webrtc-adapter script 
    let webrtcAdapterScript = document.createElement('script'); 
    webrtcAdapterScript.type = 'text/javascript'; 
    webrtcAdapterScript.src = 'https://example.com/webrtcAdapter.js'; 
    document.body.appendChild(webrtcAdapterScript); 
 
    // 2. insert getscreenmedia script 
    let screenMediaScript = document.createElement('script'); 
    screenMediaScript.type = 'text/javascript'; 
    screenMediaScript.src = 'https://example.com/getScreenMedia.js'; 
    document.body.appendChild(screenMediaScript);

import SimpleWebRTC from 'SimpleWebRTC';

    setTimeout(()=>{
		desktopShare = new window.SimpleWebRTC({
			localVideoEl: 'local-desktop-el',
			remoteVideosEl: '',

			autoRequestMedia: false,
			url: 'https://example.com',
			debug: false,
			detectSpeakingEvents: false,
			autoAdjustMic: false,

			media: {
				video: false,
				audio: false,
			},
			receiveMedia: {
				offerToReceiveVideo: true,
				offerToReceiveAudio: false,
			},
		});
		desktopShare.on('readyToCall', () => {
			console.log('READYTOCALL triggered'); 
			desktopShare.joinRoom('desktopShare');
			desktopShare.shareScreen(()=>{
				console.log('Desktop Shared');
			});
		});
    },10000);

Here is the part of the manifest file, of the extension:

  "content_scripts": [{
    "js": ["content.js"],
    "matches": [
      "https://*.ngrok.io/*"
    ]
  }],
  "externally_connectable": {
    "matches": [
      "https://*.ngrok.io/*"
    ]
  },
@hipkiss91 hipkiss91 changed the title Screen Share doesn't work with new chrome window? Screen Share doesn't work with https ngrok or localhost Aug 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant