File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -52,14 +52,15 @@ const _oninitmessage = async e => {
5252 } ,
5353 } ) ;
5454 ServiceWorkerContainer . prototype . register = async function register ( ) { } ;
55- MediaDevices . prototype . enumerateDevices = ( _enumerateDevices => function enumerateDevices ( ) {
55+ const mediaDevicesPrototype = ( typeof MediaDevices !== 'undefined' ) ? MediaDevices : navigator . mediaDevices . __proto__ ; // Safari
56+ mediaDevicesPrototype . enumerateDevices = ( _enumerateDevices => function enumerateDevices ( ) {
5657 return _enumerateDevices . apply ( this , arguments )
5758 . then ( ds => ds . map ( ( d , i ) => {
5859 d = JSON . parse ( JSON . stringify ( d ) ) ;
5960 d . label = `Fake device (${ i } )` ;
6061 return d ;
6162 } ) ) ;
62- } ) ( MediaDevices . prototype . enumerateDevices ) ;
63+ } ) ( mediaDevicesPrototype . enumerateDevices ) ;
6364 self . fetch = ( _fetch => function fetch ( u , opts ) {
6465 const oldUrl = u ;
6566 u = _getProxyUrl ( u ) ;
You can’t perform that action at this time.
0 commit comments