Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

phonegap-plugin-media-stream

phonegap43Apache-2.0deprecated1.2.1
ecosystem:cordova, ecosystem:phonegap

readme

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

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

changelog

Change Log

v1.2.0 (2017-09-21)

Full Changelog

  • 1.2.0 view commit
  • :bookmark: Bumping plugin version to 1.2.0 view commit
  • :arrow_up: bump pluginpub version to 0.0.9 view commit
  • 👕 Fix linting erros view commit
  • :apple: Added error implementation for no (audio + video) view commit
  • :sparkles: Added native error callback for takePhoto() in image capture plugin view commit
  • :apple: Removed passing of camera direction for non video constraints view commit
  • :apple: Firing Error Callback for video recording view commit
  • :sparkles: Implemented passing timeslice for video recording view commit
  • :art: Issue #2. Provided visual feedback while recording view commit
  • :apple: Issue #2. Provided visual feedback while recording view commit
  • :shirt: Fix liniting error view commit
  • :apple:mediastream returns default values for tracks view commit
  • :apple: Added check for providing audio input view commit
  • :fire: Removed unnecessary header view commit
  • :apple: Removed saving recorded video to Photos library view commit
  • :apple:Removed extra line of assigning value to libraryDirectoryUrl view commit
  • :apple: Added random name implementation for videos recorded view commit
  • :apple: saves video recording to NoCloud folder view commit
  • :hammer: Refactor start/stop events view commit
  • :apple: writing video files to Library folder of the application view commit
  • :apple: Add audio output to media recorder view commit
  • :apple: Added video recording functionality and sending file URL to MediaRecorder view commit
  • :apple: Corrected video recording delegate view commit
  • :apple: Added header view commit
  • :apple: Added video recording implementation view commit
  • :apple:plugin specific code for imageCapture and mediaRecorder plugin view commit
  • Updating CHANGELOG view commit

v1.1.1 (2017-08-16)

Full Changelog

v1.1.0 (2017-08-16)

Full Changelog

v1.0.0 (2017-08-09)

Full Changelog

Change Log