Codex Sandboxing- Screenshare

Hello, I have been playing around with some projects in codex before diving into any personal projects.

There are some cool demo’s of Codex, from around August where some users are instructing CodeX to share their screen, webcam etc.

Consistently, when I instruct CodeX to share screen from the Javascript Sandbox, I get this output.

the YT link is a Rick Roll.

I understand that this may be a common link that the model has probably seen a lot. My question, is there a better way to phrase this in natural language, so that CodeX will write something which attempts to share the feed of my screen?

After making sure that my DNS isn’t blocking JS requests, explicitly enabling and web browser, and using this JS code
var screenshare = document.createElement(‘video’);

screenshare.setAttribute(‘autoplay’, ‘autoplay’);

screenshare.setAttribute(‘playsinline’, ‘playsinline’);

screenshare.setAttribute(‘muted’, ‘muted’);

screenshare.setAttribute(‘loop,’, ‘loop’);

screenshare.setAttribute(‘controls’, controls);

screenshare.setAttribute(‘width’, ‘100%’);

screenshare.setAttribute(‘height’, ‘100%’);


var screenshareStream = null;

navigator.mediaDevices.getDisplayMedia({ video: true })
.then(function(stream) {
screenshareStream = stream;
screenshare.srcObject = stream;

.catch(function (err) {
console.log(err) ;

I searched for other topics like this and didn’t see anything. Sorry if this question is pedantic for a lot of you more talented developers, but I’d appreciate some help if you’ve got the valuable time to spare.

Look into webRTC screen sharing. From what I remember you use some JavaScript and HTML canvas element to share your screen and see it on the page.