Skip to content

doxyme/media-access

 
 

Repository files navigation

Installation

yarn add git://github.com/doxyme/media-access

Usage

import DoxyMe from '@doxyme/media-access'

try {
  const stream = await DoxyMe.requestMediaAccess()
  // User allowed browser to access camera/microphone
  console.log(stream)
      
  // Attach stream to video element
  const video = document.querySelector('#dokbot-video')
  video.srcObject = stream
} catch (err) {
  // There was an error, or the user rejected access, etc.
  console.error(err)
}

DoxyMe.on('localVolumeChange', volume => {
  console.log(volume)
})
// Alternatively, import the mocked version

import DoxyMe from '@doxyme/media-access/mock'

// Usage is the same
// ...

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •