uppy/packages/@uppy
Dave Kiss d5b45a82ff Allow definition of MediaRecorder mimeType (#1708)
* Allow definition of MediaRecorder mimeType

This PR introduces a new option for the `@uppy/webcam` plugin called `preferredMimeType` which defaults as `null`.

If a value is passed, the browser's `MediaRecorder` implementation checks if the `preferredMimeType` is supported, and if it thinks it is, will attempt to record using the `preferredMimeType` rather than the browser default.

If the `preferredMimeType` is unsupported, the browser will fall back to using its default recording mime type.

This allows, for example, a user to pass `preferredMimeType: "video/webm"` during the `@uppy/webcam` plugin construction which will instruct the browser to record to a `.webm` container.

Specific codecs may also be passed here. For example, `video/webm;codecs=vp8` may still parse as valid by the browser.

## Limitations
This does not currently change the mime type for captured images on line 282 (`image/jpeg`) and will only pass the `preferredMimeType` to the browser `MediaRecorder` API.

### Reference
https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/MediaRecorder
https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/isTypeSupported
https://cs.chromium.org/chromium/src/third_party/blink/web_tests/fast/mediarecorder/MediaRecorder-isTypeSupported.html?q=MediaRecorder-isTypeSupported&dr
https://www.webmproject.org/about/faq/

* Constantize preferredMimeType

* Lint fix

* Change option name to preferredVideoMimeType

* One more preferredVideoMimeType

* Update comment

* docs: add preferredVideoMimeType
2019-07-08 12:14:53 +02:00
..
aws-s3 Allow overriding of getResponseData() (#1647) 2019-06-24 12:15:39 +02:00
aws-s3-multipart Add metadata support for S3 MultiPart (#1698) 2019-07-01 16:05:32 +02:00
companion Progress fixes for unsized files (#1610) 2019-07-05 15:59:26 +02:00
companion-client companion-client: add fallback for preflight failure 2019-06-20 16:18:19 +01:00
core Merge pull request #1701 from transloadit/add-pretty-focus-styles-everywhere 2019-07-07 19:51:51 +02:00
dashboard Merge pull request #1701 from transloadit/add-pretty-focus-styles-everywhere 2019-07-07 19:51:51 +02:00
drag-drop Log error in uppy.addFile try/catch (#1680) 2019-06-28 20:25:17 +03:00
dropbox Accessibility follow-up PR: make all svgs not focusable in IE11 (#1662) 2019-06-17 17:08:05 +03:00
file-input Log error in uppy.addFile try/catch (#1680) 2019-06-28 20:25:17 +03:00
form form: exclude own metadata, append result instead of overwriting (#1686) 2019-07-03 18:21:06 +03:00
golden-retriever Use opts.id as the plugin ID for all plugins, fixes #1674 2019-06-19 09:58:14 +02:00
google-drive Accessibility follow-up PR: make all svgs not focusable in IE11 (#1662) 2019-06-17 17:08:05 +03:00
informer Release 2019-06-05 19:07:20 +03:00
instagram Accessibility follow-up PR: make all svgs not focusable in IE11 (#1662) 2019-06-17 17:08:05 +03:00
locales Add translations for aria labels in provider views (#1696) 2019-07-05 15:37:13 +03:00
progress-bar Release 2019-06-05 19:07:20 +03:00
provider-views Merge pull request #1701 from transloadit/add-pretty-focus-styles-everywhere 2019-07-07 19:51:51 +02:00
react Use opts.id as the plugin ID for all plugins, fixes #1674 2019-06-19 09:58:14 +02:00
react-native Release 2019-06-05 19:07:20 +03:00
redux-dev-tools Use opts.id as the plugin ID for all plugins, fixes #1674 2019-06-19 09:58:14 +02:00
robodog Log error in uppy.addFile try/catch (#1680) 2019-06-28 20:25:17 +03:00
status-bar Merge pull request #1701 from transloadit/add-pretty-focus-styles-everywhere 2019-07-07 19:51:51 +02:00
store-default Release 2019-06-05 19:07:20 +03:00
store-redux Release 2019-06-05 19:07:20 +03:00
thumbnail-generator eslint jsdoc fixes 2019-06-25 18:27:48 +03:00
transloadit transloadit: reduce excessive polling (#1689) 2019-07-05 14:04:04 +02:00
tus eslint jsdoc fixes 2019-06-25 18:27:48 +03:00
url Log error in uppy.addFile try/catch (#1680) 2019-06-28 20:25:17 +03:00
utils Add translations for aria labels in provider views (#1696) 2019-07-05 15:37:13 +03:00
webcam Allow definition of MediaRecorder mimeType (#1708) 2019-07-08 12:14:53 +02:00
xhr-upload xhr-upload: send global metadata when bundle: true (#1677) 2019-07-05 17:11:57 +02:00