Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Pause the stream returned by getUserMedia

// using `await`, remember to use `async function(){}` as needed, or switch to Promise().then() if desired...
const myStream = await navigator.mediaDevices.getUserMedia({audio: true, video: true})
const myTracks = myStream.getTracks();
const myAudio = myTracks.filter(track => track.kind === "audio")[0];
const myVideo = myTracks.filter(track => track.kind === "video")[0];

function toggleTrackMute(track) {
  track.enabled = !track.enabled;
  console.log(`${track.enabled ? 'unmuted' : 'muted'} track.kind`);
}

toggleTrackMute(myAudio)
Comment

PREVIOUS NEXT
Code Example
Javascript :: creating the find method javascript 
Javascript :: adonisjs char 
Javascript :: zalgo text in javascript 
Javascript :: how to convert string to random case in javascript 
Javascript :: user authentication and routing + nodejs + express 
Javascript :: assing multipe ids jquery to event 
Javascript :: check for null 
Javascript :: optional css tippy 
Javascript :: jquery ui sortable between two tables 
Javascript :: array of numbers to array of objects 
Javascript :: javascript prototype chaining 
Javascript :: javascript Arrow Function as an Expressio 
Javascript :: creating js classes 
Javascript :: javascript variable name arguments and eval are not allowed 
Javascript :: ajax introduction 
Javascript :: get max type value in solidity 
Javascript :: javascript addall 
Javascript :: javascipt 
Javascript :: flip image on y axis phaser 
Javascript :: phaser random ellipse 
Javascript :: phaser play animation after repeat 
Javascript :: how to process string calculation in gdscript 
Javascript :: Expresion regular para validar contraseñas 
Javascript :: site:stackoverflow.com two api calls dependent on each other js 
Javascript :: js if animation infinity end 
Javascript :: ... in javascript 
Javascript :: brightness javascript 
Javascript :: node js mongodb update nested object 
Javascript :: react check if browser is in dark mode 
Javascript :: Lazy Loading 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =