@uppy/webcam
Version:
Uppy plugin that takes photos or records videos using the device's camera.
40 lines (37 loc) • 1.24 kB
JavaScript
var _require = require('preact'),
h = _require.h;
module.exports = function RecordButton(_ref) {
var recording = _ref.recording,
onStartRecording = _ref.onStartRecording,
onStopRecording = _ref.onStopRecording,
i18n = _ref.i18n;
console.log('is recording', recording);
if (recording) {
return h(
'button',
{ 'class': 'uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--video',
type: 'button',
title: i18n('stopRecording'),
'aria-label': i18n('stopRecording'),
onclick: onStopRecording },
h(
'svg',
{ 'aria-hidden': 'true', 'class': 'UppyIcon', width: '100', height: '100', viewBox: '0 0 100 100' },
h('rect', { x: '15', y: '15', width: '70', height: '70' })
)
);
}
return h(
'button',
{ 'class': 'uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--video',
type: 'button',
title: i18n('startRecording'),
'aria-label': i18n('startRecording'),
onclick: onStartRecording },
h(
'svg',
{ 'aria-hidden': 'true', 'class': 'UppyIcon', width: '100', height: '100', viewBox: '0 0 100 100' },
h('circle', { cx: '50', cy: '50', r: '40' })
)
);
};