Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

phonegap-plugin-media-stream

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

phonegap-plugin-media-stream

------------------------

  • 1.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
decreased by-50%
Maintainers
2
Weekly downloads
 
Created
Source

phonegap-plugin-media-stream Build Status


This plugin provides an implementation of the W3C Media Capture API which allows authorized web applications to access streams from the device's audio and video capturing interfaces, i.e. to use the data available from the camera and the microphone. The streams exposed by the API can be bound directly to the HTML or elements or read and manipulated in the code, including further more specific processing via Image Capture API, Media Recorder API or Real-Time Communication.

Installation

phonegap plugin add phonegap-plugin-media-stream

phonegap plugin add https://github.com/phonegap/phonegap-plugin-media-stream.git

The mediaDevices Object

The mediaDevices object has the following methods:

getUserMedia(optional MediaStreamConstraints constraints)

The getUserMedia method call prompts the user for permission to capture audio or video input. The method returns a promise that when resolved returns a MediaStream object. You can constrain what type of media streams are return by passing in an option MediaStreamConstraints object.

Example
navigator.mediaDevices.getUserMedia({
    'audio': true,
    'video': {
        facingMode: 'user'
    }
}).then(function(mediaStream) {
  // do something with the media stream
});

getSupportedConstraints()

The getSupportedConstraints method returns an object which describes which constraints the device supports. You can check the constraints before making a call to getUserMedia to make sure that the functionality you want is supported.

Example
var constraints = navigator.mediaDevices.getSupportedConstraints();
console.log(constraints);

Quirks

The iOS implementation that this plugin provides does not allow you to attach the returned MediaStream object to a audio or video tag. Rather you will use the MeidaStream object to get a MediaStreamTrack to pass to the Image (see phonegap-plugin-image-capture) or Audio capture API.

Contributing

LICENSE

Keywords

FAQs

Package last updated on 16 Aug 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc