Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save andrewminerd/12e90f7b7ac9ba599336fc10a50bc85a to your computer and use it in GitHub Desktop.
Save andrewminerd/12e90f7b7ac9ba599336fc10a50bc85a to your computer and use it in GitHub Desktop.
Updating cables.gl patch.js for iOS
In patch.js..
#1) Look for:
c=document.createElement("video");
Add the following after the semicolon:
c.setAttribute('playsinline',1);
Should now look something like...
...,c=document.createElement("video");c.setAttribute('playsinline',1);const d="webcam"+CABLES.uuid();...
#2) Look for:
||navigator.mozGetUserMedia,
Before comma, add:
||function(spec, success, fail) { navigator.mediaDevices.getUserMedia(spec).then(success, fail); }
Should now look like:
...,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedi
a||navigator.mozGetUserMedia||function(spec, success, fail) { navigator.mediaDevices.getUserMedia(spec).then(success, fail); },navigator.getUserMedia...
Done!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment