Failed to execute 'createObjectURL'. No function found

Uncaught TypeError: Failed to execute 'createObjectURL' on 'URL': No function was found that matched the signature provided.
    at index.html:17

This is the error I’m getting when i try the sample code found here:

I’ve basically copied the code word for word.
Running on a windows 10 machine … node version 12.18.4
my package.json looks like this:

{
  "name": "electronshell",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start": "electron .",
    "build:macos": "electron-builder --macos --dir",
    "dist:macos": "electron-builder --macos",
    "build:linux": "electron-builder --linux --dir",
    "dist:linux": "electron-builder --linux",
    "build:windows": "electron-builder --win --dir",
    "dist:windows": "electron-builder --win"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "electron": "^10.1.2",
    "electron-builder": "^22.8.0"
  },

  "dependencies": {
    "simplemde": "^1.11.2"
  },

  "build": {
    "appId": "jldevestapp.id",
    "mac": {
      "category": "public.app-category.utilities"
    },
    "linux": {
      "category": "Utility"
    }
  }
}

And index.js:

const {app, BrowserWindow} = require('electron')
const url = require('url')
const path = require('path')
let win
// Set the path where recordings will be saved
app.setPath("userData", __dirname + "/saved_recordings")
function createWindow() {
   win = new BrowserWindow({width: 800, height: 600})
   win.loadURL(url.format({
      pathname: path.join(__dirname, 'index.html'),
      protocol: 'file:',
      slashes: true
   }))

}
app.on(‘ready’, createWindow)

index.html:

<!DOCTYPE html>
<html>
   <head>
      <meta charset = "UTF-8">
      <title>Audio and Video</title>
   </head>
   <body>
      <video autoplay></video>
      <script type = "text/javascript">
         function errorCallback(e) {
            console.log('Error', e)
         }
         navigator.getUserMedia({video: true, audio: true}, (localMediaStream) => {
            var video = document.querySelector('video')
            video.src = window.URL.createObjectURL(localMediaStream)
            video.onloadedmetadata = (e) => {
               // Ready to go. Do some stuff.
            };
         }, errorCallback)
      </script>
   </body>
</html>

the window launches but when i check the developers tools I see that it’s crashing.