Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow definition of MediaRecorder mimeType #1708

Merged
merged 7 commits into from Jul 8, 2019

Commits on Jul 3, 2019

  1. 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/
    davekiss committed Jul 3, 2019
    Copy the full SHA
    0cc8548 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    ee5fa12 View commit details
    Browse the repository at this point in the history
  3. Lint fix

    davekiss committed Jul 3, 2019
    Copy the full SHA
    526cfe8 View commit details
    Browse the repository at this point in the history

Commits on Jul 5, 2019

  1. Copy the full SHA
    cf109cf View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    7914e14 View commit details
    Browse the repository at this point in the history
  3. Update comment

    davekiss committed Jul 5, 2019
    Copy the full SHA
    6046407 View commit details
    Browse the repository at this point in the history

Commits on Jul 8, 2019

  1. Copy the full SHA
    76fb249 View commit details
    Browse the repository at this point in the history