Does this actually work?
I'm using github.com/andyet/SimpleWebRTC to share a screen. 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 = 'example.com/webrtcAdapter.js';
document.body.appendChild(webrtcAdapterScript);
// 2. insert getscreenmedia script
let screenMediaScript = document.createElement('script');
screenMediaScript.type = 'text/javascript';
screenMediaScript.src = '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: '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);
TheSheriff
Co-Founder, Founder, Entrepreneur & Problem Solver
Turns out its not the extension or the code that's the issue. It just doesn't like being/cant be accessed over https ngrok.