Stream video from camera phone and use it in Ionic on Android

I am trying to build a mobile phone app for object detection with tensorFlow Js using Ionic Framework from live stream video captured through phone camera.i searched everywhere but nothing with ionic,i found something similar but with browser. this is what i found and i want to do something like this but with ionic,any help please.


      (async ()=>{
          const stream = await navigator.mediaDevices.getUserMedia({
              audio : false,
              video : {facingMode : 'environment'}

 = stream;
      }) ()

File.html :
<div><video #video autoplay muted></video></div>