@uppy/webcam
Advanced tools
Comparing version 1.8.7 to 1.8.8
@@ -14,4 +14,4 @@ var _require = require('preact'), | ||
d: "M57.3 8.433c4.59 0 8.1 3.51 8.1 8.1v29.7c0 4.59-3.51 8.1-8.1 8.1H8.7c-4.59 0-8.1-3.51-8.1-8.1v-29.7c0-4.59 3.51-8.1 8.1-8.1h9.45l4.59-7.02c.54-.54 1.35-1.08 2.16-1.08h16.2c.81 0 1.62.54 2.16 1.08l4.59 7.02h9.45zM33 14.64c-8.62 0-15.393 6.773-15.393 15.393 0 8.62 6.773 15.393 15.393 15.393 8.62 0 15.393-6.773 15.393-15.393 0-8.62-6.773-15.393-15.393-15.393zM33 40c-5.648 0-9.966-4.319-9.966-9.967 0-5.647 4.318-9.966 9.966-9.966s9.966 4.319 9.966 9.966C42.966 35.681 38.648 40 33 40z", | ||
"fill-rule": "evenodd" | ||
fillRule: "evenodd" | ||
})); | ||
}; |
@@ -1,3 +0,5 @@ | ||
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } | ||
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
var _require = require('preact'), | ||
@@ -42,8 +44,8 @@ h = _require.h, | ||
return h("div", { | ||
class: "uppy uppy-Webcam-container" | ||
className: "uppy uppy-Webcam-container" | ||
}, h("div", { | ||
class: "uppy-Webcam-videoContainer" | ||
className: "uppy-Webcam-videoContainer" | ||
}, h("video", { | ||
class: "uppy-Webcam-video " + (this.props.mirror ? 'uppy-Webcam-video--mirrored' : ''), | ||
autoplay: true, | ||
className: "uppy-Webcam-video " + (this.props.mirror ? 'uppy-Webcam-video--mirrored' : ''), | ||
autoPlay: true, | ||
muted: true, | ||
@@ -53,9 +55,9 @@ playsinline: true, | ||
})), h("div", { | ||
class: "uppy-Webcam-footer" | ||
className: "uppy-Webcam-footer" | ||
}, h("div", { | ||
class: "uppy-Webcam-videoSourceContainer" | ||
className: "uppy-Webcam-videoSourceContainer" | ||
}, shouldShowVideoSourceDropdown ? VideoSourceSelect(this.props) : null), h("div", { | ||
class: "uppy-Webcam-buttonContainer" | ||
className: "uppy-Webcam-buttonContainer" | ||
}, shouldShowSnapshotButton ? SnapshotButton(this.props) : null, ' ', shouldShowRecordButton ? RecordButton(this.props) : null), h("div", { | ||
class: "uppy-Webcam-recordingLength" | ||
className: "uppy-Webcam-recordingLength" | ||
}, shouldShowRecordingLength ? RecordingLength(this.props) : null))); | ||
@@ -62,0 +64,0 @@ }; |
@@ -7,4 +7,6 @@ var _class, _temp; | ||
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } | ||
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
var _require = require('preact'), | ||
@@ -123,5 +125,5 @@ h = _require.h; | ||
fill: "none", | ||
"fill-rule": "evenodd" | ||
fillRule: "evenodd" | ||
}, h("rect", { | ||
class: "uppy-ProviderIconBg", | ||
className: "uppy-ProviderIconBg", | ||
fill: "#03BFEF", | ||
@@ -134,3 +136,3 @@ width: "32", | ||
fill: "#FFF", | ||
"fill-rule": "nonzero" | ||
fillRule: "nonzero" | ||
}))); | ||
@@ -230,2 +232,6 @@ }; | ||
_proto.isAudioOnly = function isAudioOnly() { | ||
return this.opts.modes.length === 1 && this.opts.modes[0] === 'audio-only'; | ||
}; | ||
_proto.getConstraints = function getConstraints(deviceId) { | ||
@@ -239,3 +245,3 @@ var _this$opts$videoConst; | ||
var acceptsAudio = this.opts.modes.indexOf('video-audio') !== -1 || this.opts.modes.indexOf('audio-only') !== -1; | ||
var acceptsVideo = this.opts.modes.indexOf('video-audio') !== -1 || this.opts.modes.indexOf('video-only') !== -1 || this.opts.modes.indexOf('picture') !== -1; | ||
var acceptsVideo = !this.isAudioOnly() && (this.opts.modes.indexOf('video-audio') !== -1 || this.opts.modes.indexOf('video-only') !== -1 || this.opts.modes.indexOf('picture') !== -1); | ||
@@ -277,9 +283,10 @@ var videoConstraints = _extends({}, (_this$opts$videoConst = this.opts.videoConstraints) != null ? _this$opts$videoConst : { | ||
var currentDeviceId = null; | ||
var tracks = _this2.isAudioOnly() ? stream.getAudioTracks() : stream.getVideoTracks(); | ||
if (!options || !options.deviceId) { | ||
currentDeviceId = stream.getVideoTracks()[0].getSettings().deviceId; | ||
currentDeviceId = tracks[0].getSettings().deviceId; | ||
} else { | ||
stream.getVideoTracks().forEach(function (videoTrack) { | ||
if (videoTrack.getSettings().deviceId === options.deviceId) { | ||
currentDeviceId = videoTrack.getSettings().deviceId; | ||
tracks.forEach(function (track) { | ||
if (track.getSettings().deviceId === options.deviceId) { | ||
currentDeviceId = track.getSettings().deviceId; | ||
} | ||
@@ -687,2 +694,2 @@ }); | ||
return Webcam; | ||
}(Plugin), _class.VERSION = "1.8.7", _temp); | ||
}(Plugin), _class.VERSION = "1.8.8", _temp); |
@@ -6,8 +6,8 @@ var _require = require('preact'), | ||
return h("div", { | ||
class: "uppy-Webcam-permissons" | ||
className: "uppy-Webcam-permissons" | ||
}, h("div", { | ||
class: "uppy-Webcam-permissonsIcon" | ||
className: "uppy-Webcam-permissonsIcon" | ||
}, props.icon()), h("h1", { | ||
class: "uppy-Webcam-title" | ||
className: "uppy-Webcam-title" | ||
}, props.hasCamera ? props.i18n('allowAccessTitle') : props.i18n('noCameraTitle')), h("p", null, props.hasCamera ? props.i18n('allowAccessDescription') : props.i18n('noCameraDescription'))); | ||
}; |
@@ -12,7 +12,7 @@ var _require = require('preact'), | ||
return h("button", { | ||
class: "uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--video", | ||
className: "uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--video", | ||
type: "button", | ||
title: i18n('stopRecording'), | ||
"aria-label": i18n('stopRecording'), | ||
onclick: onStopRecording, | ||
onClick: onStopRecording, | ||
"data-uppy-super-focusable": true | ||
@@ -22,3 +22,3 @@ }, h("svg", { | ||
focusable: "false", | ||
class: "uppy-c-icon", | ||
className: "uppy-c-icon", | ||
width: "100", | ||
@@ -36,7 +36,7 @@ height: "100", | ||
return h("button", { | ||
class: "uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--video", | ||
className: "uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--video", | ||
type: "button", | ||
title: i18n('startRecording'), | ||
"aria-label": i18n('startRecording'), | ||
onclick: onStartRecording, | ||
onClick: onStartRecording, | ||
"data-uppy-super-focusable": true | ||
@@ -46,3 +46,3 @@ }, h("svg", { | ||
focusable: "false", | ||
class: "uppy-c-icon", | ||
className: "uppy-c-icon", | ||
width: "100", | ||
@@ -49,0 +49,0 @@ height: "100", |
@@ -10,9 +10,9 @@ var _require = require('preact'), | ||
return h("button", { | ||
class: "uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--picture", | ||
className: "uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--picture", | ||
type: "button", | ||
title: i18n('takePicture'), | ||
"aria-label": i18n('takePicture'), | ||
onclick: onSnapshot, | ||
onClick: onSnapshot, | ||
"data-uppy-super-focusable": true | ||
}, CameraIcon()); | ||
}; |
@@ -12,3 +12,3 @@ var _require = require('preact'), | ||
className: "uppy-u-reset uppy-Webcam-videoSource-select", | ||
onchange: function onchange(event) { | ||
onChange: function onChange(event) { | ||
onChangeVideoSource(event.target.value); | ||
@@ -15,0 +15,0 @@ } |
{ | ||
"name": "@uppy/webcam", | ||
"description": "Uppy plugin that takes photos or records videos using the device's camera.", | ||
"version": "1.8.7", | ||
"version": "1.8.8", | ||
"license": "MIT", | ||
@@ -29,3 +29,3 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@uppy/utils": "^3.4.2", | ||
"@uppy/utils": "^3.5.0", | ||
"preact": "8.2.9" | ||
@@ -36,3 +36,3 @@ }, | ||
}, | ||
"gitHead": "4bf107236340dc98f8584f15a06e13ffa9fc31f4" | ||
"gitHead": "6771545fe70134088a5441ef5c2f7b872e32d812" | ||
} |
@@ -6,5 +6,5 @@ const { h } = require('preact') | ||
<svg aria-hidden="true" focusable="false" fill="#0097DC" width="66" height="55" viewBox="0 0 66 55"> | ||
<path d="M57.3 8.433c4.59 0 8.1 3.51 8.1 8.1v29.7c0 4.59-3.51 8.1-8.1 8.1H8.7c-4.59 0-8.1-3.51-8.1-8.1v-29.7c0-4.59 3.51-8.1 8.1-8.1h9.45l4.59-7.02c.54-.54 1.35-1.08 2.16-1.08h16.2c.81 0 1.62.54 2.16 1.08l4.59 7.02h9.45zM33 14.64c-8.62 0-15.393 6.773-15.393 15.393 0 8.62 6.773 15.393 15.393 15.393 8.62 0 15.393-6.773 15.393-15.393 0-8.62-6.773-15.393-15.393-15.393zM33 40c-5.648 0-9.966-4.319-9.966-9.967 0-5.647 4.318-9.966 9.966-9.966s9.966 4.319 9.966 9.966C42.966 35.681 38.648 40 33 40z" fill-rule="evenodd" /> | ||
<path d="M57.3 8.433c4.59 0 8.1 3.51 8.1 8.1v29.7c0 4.59-3.51 8.1-8.1 8.1H8.7c-4.59 0-8.1-3.51-8.1-8.1v-29.7c0-4.59 3.51-8.1 8.1-8.1h9.45l4.59-7.02c.54-.54 1.35-1.08 2.16-1.08h16.2c.81 0 1.62.54 2.16 1.08l4.59 7.02h9.45zM33 14.64c-8.62 0-15.393 6.773-15.393 15.393 0 8.62 6.773 15.393 15.393 15.393 8.62 0 15.393-6.773 15.393-15.393 0-8.62-6.773-15.393-15.393-15.393zM33 40c-5.648 0-9.966-4.319-9.966-9.967 0-5.647 4.318-9.966 9.966-9.966s9.966 4.319 9.966 9.966C42.966 35.681 38.648 40 33 40z" fillRule="evenodd" /> | ||
</svg> | ||
) | ||
} |
@@ -22,5 +22,5 @@ const { h, Component } = require('preact') | ||
const shouldShowRecordButton = this.props.supportsRecording && ( | ||
isModeAvailable(this.props.modes, 'video-only') || | ||
isModeAvailable(this.props.modes, 'audio-only') || | ||
isModeAvailable(this.props.modes, 'video-audio') | ||
isModeAvailable(this.props.modes, 'video-only') | ||
|| isModeAvailable(this.props.modes, 'audio-only') | ||
|| isModeAvailable(this.props.modes, 'video-audio') | ||
) | ||
@@ -32,11 +32,11 @@ const shouldShowSnapshotButton = isModeAvailable(this.props.modes, 'picture') | ||
return ( | ||
<div class="uppy uppy-Webcam-container"> | ||
<div class="uppy-Webcam-videoContainer"> | ||
<video class={`uppy-Webcam-video ${this.props.mirror ? 'uppy-Webcam-video--mirrored' : ''}`} autoplay muted playsinline srcObject={this.props.src || ''} /> | ||
<div className="uppy uppy-Webcam-container"> | ||
<div className="uppy-Webcam-videoContainer"> | ||
<video className={`uppy-Webcam-video ${this.props.mirror ? 'uppy-Webcam-video--mirrored' : ''}`} autoPlay muted playsinline srcObject={this.props.src || ''} /> | ||
</div> | ||
<div class="uppy-Webcam-footer"> | ||
<div class="uppy-Webcam-videoSourceContainer"> | ||
<div className="uppy-Webcam-footer"> | ||
<div className="uppy-Webcam-videoSourceContainer"> | ||
{shouldShowVideoSourceDropdown ? VideoSourceSelect(this.props) : null} | ||
</div> | ||
<div class="uppy-Webcam-buttonContainer"> | ||
<div className="uppy-Webcam-buttonContainer"> | ||
{shouldShowSnapshotButton ? SnapshotButton(this.props) : null} | ||
@@ -46,3 +46,3 @@ {' '} | ||
</div> | ||
<div class="uppy-Webcam-recordingLength"> | ||
<div className="uppy-Webcam-recordingLength"> | ||
{shouldShowRecordingLength ? RecordingLength(this.props) : null} | ||
@@ -49,0 +49,0 @@ </div> |
@@ -10,4 +10,4 @@ /** | ||
return `${Math.floor( | ||
seconds / 60 | ||
)}:${String(seconds % 60).padStart(2, 0)}` | ||
seconds / 60 | ||
)}:${String(seconds % 60).padStart(2, 0)}` | ||
} |
@@ -66,3 +66,3 @@ const { h } = require('preact') | ||
}) | ||
} | ||
}, | ||
} | ||
@@ -86,5 +86,5 @@ } | ||
<svg aria-hidden="true" focusable="false" width="32" height="32" viewBox="0 0 32 32"> | ||
<g fill="none" fill-rule="evenodd"> | ||
<rect class="uppy-ProviderIconBg" fill="#03BFEF" width="32" height="32" rx="16" /> | ||
<path d="M22 11c1.133 0 2 .867 2 2v7.333c0 1.134-.867 2-2 2H10c-1.133 0-2-.866-2-2V13c0-1.133.867-2 2-2h2.333l1.134-1.733C13.6 9.133 13.8 9 14 9h4c.2 0 .4.133.533.267L19.667 11H22zm-6 1.533a3.764 3.764 0 0 0-3.8 3.8c0 2.129 1.672 3.801 3.8 3.801s3.8-1.672 3.8-3.8c0-2.13-1.672-3.801-3.8-3.801zm0 6.261c-1.395 0-2.46-1.066-2.46-2.46 0-1.395 1.065-2.461 2.46-2.461s2.46 1.066 2.46 2.46c0 1.395-1.065 2.461-2.46 2.461z" fill="#FFF" fill-rule="nonzero" /> | ||
<g fill="none" fillRule="evenodd"> | ||
<rect className="uppy-ProviderIconBg" fill="#03BFEF" width="32" height="32" rx="16" /> | ||
<path d="M22 11c1.133 0 2 .867 2 2v7.333c0 1.134-.867 2-2 2H10c-1.133 0-2-.866-2-2V13c0-1.133.867-2 2-2h2.333l1.134-1.733C13.6 9.133 13.8 9 14 9h4c.2 0 .4.133.533.267L19.667 11H22zm-6 1.533a3.764 3.764 0 0 0-3.8 3.8c0 2.129 1.672 3.801 3.8 3.801s3.8-1.672 3.8-3.8c0-2.13-1.672-3.801-3.8-3.801zm0 6.261c-1.395 0-2.46-1.066-2.46-2.46 0-1.395 1.065-2.461 2.46-2.461s2.46 1.066 2.46 2.46c0 1.395-1.065 2.461-2.46 2.461z" fill="#FFF" fillRule="nonzero" /> | ||
</g> | ||
@@ -105,4 +105,4 @@ </svg> | ||
recordingStoppedMaxSize: 'Recording stopped because the file size is about to exceed the limit', | ||
recordingLength: 'Recording length %{recording_length}' | ||
} | ||
recordingLength: 'Recording length %{recording_length}', | ||
}, | ||
} | ||
@@ -118,3 +118,3 @@ | ||
'audio-only', | ||
'picture' | ||
'picture', | ||
], | ||
@@ -126,3 +126,3 @@ mirror: true, | ||
preferredVideoMimeType: null, | ||
showRecordingLength: false | ||
showRecordingLength: false, | ||
} | ||
@@ -161,3 +161,3 @@ | ||
videoSources: [], | ||
currentDeviceId: null | ||
currentDeviceId: null, | ||
}) | ||
@@ -172,4 +172,4 @@ } | ||
...this.opts.videoConstraints, | ||
...newOpts?.videoConstraints | ||
} | ||
...newOpts?.videoConstraints, | ||
}, | ||
}) | ||
@@ -197,8 +197,13 @@ | ||
isAudioOnly () { | ||
return this.opts.modes.length === 1 && this.opts.modes[0] === 'audio-only' | ||
} | ||
getConstraints (deviceId = null) { | ||
const acceptsAudio = this.opts.modes.indexOf('video-audio') !== -1 || | ||
this.opts.modes.indexOf('audio-only') !== -1 | ||
const acceptsVideo = this.opts.modes.indexOf('video-audio') !== -1 || | ||
this.opts.modes.indexOf('video-only') !== -1 || | ||
this.opts.modes.indexOf('picture') !== -1 | ||
const acceptsAudio = this.opts.modes.indexOf('video-audio') !== -1 | ||
|| this.opts.modes.indexOf('audio-only') !== -1 | ||
const acceptsVideo = !this.isAudioOnly() | ||
&& (this.opts.modes.indexOf('video-audio') !== -1 | ||
|| this.opts.modes.indexOf('video-only') !== -1 | ||
|| this.opts.modes.indexOf('picture') !== -1) | ||
@@ -209,3 +214,3 @@ const videoConstraints = { | ||
// when specific device is selected | ||
...(deviceId ? { deviceId, facingMode: null } : {}) | ||
...(deviceId ? { deviceId, facingMode: null } : {}), | ||
} | ||
@@ -215,3 +220,3 @@ | ||
audio: acceptsAudio, | ||
video: acceptsVideo ? videoConstraints : false | ||
video: acceptsVideo ? videoConstraints : false, | ||
} | ||
@@ -231,3 +236,3 @@ } | ||
this.setPluginState({ | ||
hasCamera: hasCamera | ||
hasCamera, | ||
}) | ||
@@ -241,8 +246,10 @@ | ||
let currentDeviceId = null | ||
const tracks = this.isAudioOnly() ? stream.getAudioTracks() : stream.getVideoTracks() | ||
if (!options || !options.deviceId) { | ||
currentDeviceId = stream.getVideoTracks()[0].getSettings().deviceId | ||
currentDeviceId = tracks[0].getSettings().deviceId | ||
} else { | ||
stream.getVideoTracks().forEach((videoTrack) => { | ||
if (videoTrack.getSettings().deviceId === options.deviceId) { | ||
currentDeviceId = videoTrack.getSettings().deviceId | ||
tracks.forEach((track) => { | ||
if (track.getSettings().deviceId === options.deviceId) { | ||
currentDeviceId = track.getSettings().deviceId | ||
} | ||
@@ -257,3 +264,3 @@ }) | ||
currentDeviceId, | ||
cameraReady: true | ||
cameraReady: true, | ||
}) | ||
@@ -264,3 +271,3 @@ }) | ||
cameraReady: false, | ||
cameraError: err | ||
cameraError: err, | ||
}) | ||
@@ -290,5 +297,4 @@ this.uppy.info(err.message, 'error') | ||
const acceptableMimeTypes = preferredVideoMimeTypes.filter((candidateType) => | ||
MediaRecorder.isTypeSupported(candidateType) && | ||
getFileTypeExtension(candidateType)) | ||
const acceptableMimeTypes = preferredVideoMimeTypes.filter((candidateType) => MediaRecorder.isTypeSupported(candidateType) | ||
&& getFileTypeExtension(candidateType)) | ||
if (acceptableMimeTypes.length > 0) { | ||
@@ -312,5 +318,5 @@ options.mimeType = acceptableMimeTypes[0] | ||
const { restrictions } = this.uppy.opts | ||
if (this.recordingChunks.length > 1 && | ||
restrictions.maxFileSize != null && | ||
!stoppingBecauseOfMaxSize) { | ||
if (this.recordingChunks.length > 1 | ||
&& restrictions.maxFileSize != null | ||
&& !stoppingBecauseOfMaxSize) { | ||
const totalSize = this.recordingChunks.reduce((acc, chunk) => acc + chunk.size, 0) | ||
@@ -343,3 +349,3 @@ // Exclude the initial chunk from the average size calculation because it is likely to be a very small outlier | ||
this.setPluginState({ | ||
isRecording: true | ||
isRecording: true, | ||
}) | ||
@@ -364,3 +370,3 @@ } | ||
this.setPluginState({ | ||
isRecording: false | ||
isRecording: false, | ||
}) | ||
@@ -483,5 +489,5 @@ return this.getVideo() | ||
source: this.id, | ||
name: name, | ||
name, | ||
data: new Blob([blob], { type: mimeType }), | ||
type: mimeType | ||
type: mimeType, | ||
} | ||
@@ -503,5 +509,5 @@ }) | ||
source: this.id, | ||
name: name, | ||
name, | ||
data: new Blob([blob], { type: mimeType }), | ||
type: mimeType | ||
type: mimeType, | ||
} | ||
@@ -521,3 +527,3 @@ | ||
this._stop() | ||
this._start({ deviceId: deviceId }) | ||
this._start({ deviceId }) | ||
} | ||
@@ -528,3 +534,3 @@ | ||
this.setPluginState({ | ||
videoSources: devices.filter((device) => device.kind === 'videoinput') | ||
videoSources: devices.filter((device) => device.kind === 'videoinput'), | ||
}) | ||
@@ -575,6 +581,6 @@ }) | ||
cameraReady: false, | ||
recordingLengthSeconds: 0 | ||
recordingLengthSeconds: 0, | ||
}) | ||
const target = this.opts.target | ||
const { target } = this.opts | ||
if (target) { | ||
@@ -581,0 +587,0 @@ this.mount(target, this) |
@@ -8,3 +8,3 @@ const Uppy = require('@uppy/core') | ||
global.MediaRecorder = { | ||
isTypeSupported: () => true | ||
isTypeSupported: () => true, | ||
} | ||
@@ -20,3 +20,3 @@ | ||
global.MediaRecorder = { | ||
isTypeSupported: (ty) => ty === 'video/webm' | ||
isTypeSupported: (ty) => ty === 'video/webm', | ||
} | ||
@@ -32,3 +32,3 @@ | ||
global.MediaRecorder = { | ||
isTypeSupported: (ty) => ty === 'video/webm' | ||
isTypeSupported: (ty) => ty === 'video/webm', | ||
} | ||
@@ -44,7 +44,7 @@ | ||
global.MediaRecorder = { | ||
isTypeSupported: () => true | ||
isTypeSupported: () => true, | ||
} | ||
const uppy = new Uppy({ | ||
restrictions: { allowedFileTypes: ['video/mp4', 'video/webm'] } | ||
restrictions: { allowedFileTypes: ['video/mp4', 'video/webm'] }, | ||
}).use(Webcam) | ||
@@ -58,7 +58,7 @@ expect( | ||
global.MediaRecorder = { | ||
isTypeSupported: (ty) => ty === 'video/webm' | ||
isTypeSupported: (ty) => ty === 'video/webm', | ||
} | ||
const uppy = new Uppy({ | ||
restrictions: { allowedFileTypes: ['video/mp4', 'video/webm'] } | ||
restrictions: { allowedFileTypes: ['video/mp4', 'video/webm'] }, | ||
}).use(Webcam) | ||
@@ -72,7 +72,7 @@ expect( | ||
global.MediaRecorder = { | ||
isTypeSupported: () => true | ||
isTypeSupported: () => true, | ||
} | ||
const uppy = new Uppy({ | ||
restrictions: { allowedFileTypes: ['video/mp4', 'video/webm'] } | ||
restrictions: { allowedFileTypes: ['video/mp4', 'video/webm'] }, | ||
}) | ||
@@ -87,7 +87,7 @@ .use(Webcam, { preferredVideoMimeType: 'video/webm' }) | ||
global.MediaRecorder = { | ||
isTypeSupported: () => false | ||
isTypeSupported: () => false, | ||
} | ||
const uppy = new Uppy({ | ||
restrictions: { allowedFileTypes: ['video/mp4', 'video/webm'] } | ||
restrictions: { allowedFileTypes: ['video/mp4', 'video/webm'] }, | ||
}).use(Webcam) | ||
@@ -94,0 +94,0 @@ expect( |
@@ -5,5 +5,5 @@ const { h } = require('preact') | ||
return ( | ||
<div class="uppy-Webcam-permissons"> | ||
<div class="uppy-Webcam-permissonsIcon">{props.icon()}</div> | ||
<h1 class="uppy-Webcam-title">{props.hasCamera ? props.i18n('allowAccessTitle') : props.i18n('noCameraTitle')}</h1> | ||
<div className="uppy-Webcam-permissons"> | ||
<div className="uppy-Webcam-permissonsIcon">{props.icon()}</div> | ||
<h1 className="uppy-Webcam-title">{props.hasCamera ? props.i18n('allowAccessTitle') : props.i18n('noCameraTitle')}</h1> | ||
<p>{props.hasCamera ? props.i18n('allowAccessDescription') : props.i18n('noCameraDescription')}</p> | ||
@@ -10,0 +10,0 @@ </div> |
@@ -7,10 +7,10 @@ const { h } = require('preact') | ||
<button | ||
class="uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--video" | ||
className="uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--video" | ||
type="button" | ||
title={i18n('stopRecording')} | ||
aria-label={i18n('stopRecording')} | ||
onclick={onStopRecording} | ||
onClick={onStopRecording} | ||
data-uppy-super-focusable | ||
> | ||
<svg aria-hidden="true" focusable="false" class="uppy-c-icon" width="100" height="100" viewBox="0 0 100 100"> | ||
<svg aria-hidden="true" focusable="false" className="uppy-c-icon" width="100" height="100" viewBox="0 0 100 100"> | ||
<rect x="15" y="15" width="70" height="70" /> | ||
@@ -24,10 +24,10 @@ </svg> | ||
<button | ||
class="uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--video" | ||
className="uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--video" | ||
type="button" | ||
title={i18n('startRecording')} | ||
aria-label={i18n('startRecording')} | ||
onclick={onStartRecording} | ||
onClick={onStartRecording} | ||
data-uppy-super-focusable | ||
> | ||
<svg aria-hidden="true" focusable="false" class="uppy-c-icon" width="100" height="100" viewBox="0 0 100 100"> | ||
<svg aria-hidden="true" focusable="false" className="uppy-c-icon" width="100" height="100" viewBox="0 0 100 100"> | ||
<circle cx="50" cy="50" r="40" /> | ||
@@ -34,0 +34,0 @@ </svg> |
@@ -7,7 +7,7 @@ const { h } = require('preact') | ||
<button | ||
class="uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--picture" | ||
className="uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--picture" | ||
type="button" | ||
title={i18n('takePicture')} | ||
aria-label={i18n('takePicture')} | ||
onclick={onSnapshot} | ||
onClick={onSnapshot} | ||
data-uppy-super-focusable | ||
@@ -14,0 +14,0 @@ > |
module.exports = function supportsMediaRecorder () { | ||
/* eslint-disable compat/compat */ | ||
return typeof MediaRecorder === 'function' && !!MediaRecorder.prototype && | ||
typeof MediaRecorder.prototype.start === 'function' | ||
return typeof MediaRecorder === 'function' && !!MediaRecorder.prototype | ||
&& typeof MediaRecorder.prototype.start === 'function' | ||
/* eslint-enable compat/compat */ | ||
} |
@@ -8,5 +8,5 @@ const { h } = require('preact') | ||
className="uppy-u-reset uppy-Webcam-videoSource-select" | ||
onchange={(event) => { onChangeVideoSource(event.target.value) }} | ||
onChange={(event) => { onChangeVideoSource(event.target.value) }} | ||
> | ||
{videoSources.map((videoSource) => | ||
{videoSources.map((videoSource) => ( | ||
<option | ||
@@ -18,3 +18,4 @@ key={videoSource.deviceId} | ||
{videoSource.label} | ||
</option>)} | ||
</option> | ||
))} | ||
</select> | ||
@@ -21,0 +22,0 @@ </div> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
127804
1782
Updated@uppy/utils@^3.5.0