From 43e1e693957e9f8ba1f7fb04e4176b99c3bf8fdd Mon Sep 17 00:00:00 2001 From: Khalid Al-Awady Date: Sun, 8 May 2022 18:52:47 -0700 Subject: [PATCH 1/3] feature(adds proper WAV codec support): - uses the extendable media recorder to allow use of WAV and author mime types - fixes type issues where audio and video tags required undefined rather than null - fixes issue where if mediaRecorderOptions are supplied the recorder stops recording after first audio blob recording --- package.json | 6 +- src/index.ts | 57 ++++++++------ yarn.lock | 215 +++++++++++++++++++++++++++++++++++++++++++++++---- 3 files changed, 241 insertions(+), 37 deletions(-) diff --git a/package.json b/package.json index 6170cc9..90a86ca 100644 --- a/package.json +++ b/package.json @@ -38,5 +38,9 @@ "jsmin": "^1.0.1", "typescript": "^4.4.3" }, - "types": "./lib/index.d.ts" + "types": "./lib/index.d.ts", + "dependencies": { + "extendable-media-recorder": "^6.6.5", + "extendable-media-recorder-wav-encoder": "^7.0.68" + } } diff --git a/src/index.ts b/src/index.ts index 0d5d878..ccd51a4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,6 @@ +import { register, MediaRecorder as ExtendableMediaRecorder, IMediaRecorder } from "extendable-media-recorder"; import { ReactElement, useCallback, useEffect, useRef, useState } from "react"; +import { connect } from 'extendable-media-recorder-wav-encoder'; export type ReactMediaRecorderRenderProps = { error: string; @@ -8,7 +10,7 @@ export type ReactMediaRecorderRenderProps = { pauseRecording: () => void; resumeRecording: () => void; stopRecording: () => void; - mediaBlobUrl: null | string; + mediaBlobUrl: undefined | string; status: StatusMessages; isAudioMuted: boolean; previewStream: MediaStream | null; @@ -23,7 +25,7 @@ export type ReactMediaRecorderHookProps = { onStop?: (blobUrl: string, blob: Blob) => void; onStart?: () => void; blobPropertyBag?: BlobPropertyBag; - mediaRecorderOptions?: MediaRecorderOptions | null; + mediaRecorderOptions?: MediaRecorderOptions | undefined; customMediaStream?: MediaStream | null; stopStreamsOnStop?: boolean; askPermissionOnMount?: boolean; @@ -66,19 +68,26 @@ export function useReactMediaRecorder({ onStart = () => null, blobPropertyBag, screen = false, - mediaRecorderOptions = null, + mediaRecorderOptions = undefined, customMediaStream = null, stopStreamsOnStop = true, askPermissionOnMount = false, }: ReactMediaRecorderHookProps): ReactMediaRecorderRenderProps { - const mediaRecorder = useRef(null); + const mediaRecorder = useRef(null); const mediaChunks = useRef([]); const mediaStream = useRef(null); const [status, setStatus] = useState("idle"); const [isAudioMuted, setIsAudioMuted] = useState(false); - const [mediaBlobUrl, setMediaBlobUrl] = useState(null); + const [mediaBlobUrl, setMediaBlobUrl] = useState(undefined); const [error, setError] = useState("NONE"); + useEffect(() => { + const setup = async () => { + await register(await connect()); + }; + setup(); + }, []); + const getMediaStream = useCallback(async () => { setStatus("acquiring_media"); const requiredMedia: MediaStreamConstraints = { @@ -89,7 +98,6 @@ export function useReactMediaRecorder({ if (customMediaStream) { mediaStream.current = customMediaStream; } else if (screen) { - //@ts-ignore const stream = (await window.navigator.mediaDevices.getDisplayMedia({ video: video || true, })) as MediaStream; @@ -108,12 +116,13 @@ export function useReactMediaRecorder({ mediaStream.current = stream; } else { const stream = await window.navigator.mediaDevices.getUserMedia( - requiredMedia + requiredMedia, ); mediaStream.current = stream; } setStatus("idle"); } catch (error: any) { + console.log(error); setError(error.name); setStatus("idle"); } @@ -125,9 +134,8 @@ export function useReactMediaRecorder({ } if (screen) { - //@ts-ignore if (!window.navigator.mediaDevices.getDisplayMedia) { - throw new Error("This browser doesn't support screen capturing"); + throw new Error("This browser doesn\"t support screen capturing"); } } @@ -136,14 +144,15 @@ export function useReactMediaRecorder({ navigator.mediaDevices.getSupportedConstraints(); const unSupportedConstraints = Object.keys(mediaType).filter( (constraint) => - !(supportedMediaConstraints as { [key: string]: any })[constraint] + !(supportedMediaConstraints as { [key: string]: any })[constraint], ); if (unSupportedConstraints.length > 0) { console.error( `The constraints ${unSupportedConstraints.join( - "," - )} doesn't support on this browser. Please check your ReactMediaRecorder component.` + ",", + // eslint-disable-next-line max-len + )} doesn"t support on this browser. Please check your ReactMediaRecorder component.`, ); } }; @@ -158,7 +167,7 @@ export function useReactMediaRecorder({ if (mediaRecorderOptions && mediaRecorderOptions.mimeType) { if (!MediaRecorder.isTypeSupported(mediaRecorderOptions.mimeType)) { console.error( - `The specified MIME type you supplied for MediaRecorder doesn't support this browser` + `The specified MIME type you supplied for MediaRecorder doesn"t support this browser`, ); } } @@ -170,7 +179,7 @@ export function useReactMediaRecorder({ return () => { if (mediaStream.current) { const tracks = mediaStream.current.getTracks(); - tracks.forEach((track) => track.stop()); + tracks.forEach((track) => track.clone().stop()); } }; }, [ @@ -201,7 +210,9 @@ export function useReactMediaRecorder({ if (!mediaStream.current.active) { return; } - mediaRecorder.current = new MediaRecorder(mediaStream.current, mediaRecorderOptions || undefined); + mediaRecorder.current = new ExtendableMediaRecorder( + mediaStream.current, mediaRecorderOptions || undefined, + ); mediaRecorder.current.ondataavailable = onRecordingActive; mediaRecorder.current.onstop = onRecordingStop; mediaRecorder.current.onstart = onRecordingStart; @@ -226,7 +237,7 @@ export function useReactMediaRecorder({ const [chunk] = mediaChunks.current; const blobProperty: BlobPropertyBag = Object.assign( { type: chunk.type }, - blobPropertyBag || (video ? { type: "video/mp4" } : { type: "audio/wav" }) + blobPropertyBag || (video ? { type: "video/mp4" } : { type: "audio/wav" }), ); const blob = new Blob(mediaChunks.current, blobProperty); const url = URL.createObjectURL(blob); @@ -282,17 +293,17 @@ export function useReactMediaRecorder({ mediaBlobUrl, status, isAudioMuted, - previewStream: mediaStream.current - ? new MediaStream(mediaStream.current.getVideoTracks()) - : null, - previewAudioStream: mediaStream.current - ? new MediaStream(mediaStream.current.getAudioTracks()) - : null, + previewStream: mediaStream.current ? + new MediaStream(mediaStream.current.getVideoTracks()) : + null, + previewAudioStream: mediaStream.current ? + new MediaStream(mediaStream.current.getAudioTracks()) : + null, clearBlobUrl: () => { if (mediaBlobUrl) { URL.revokeObjectURL(mediaBlobUrl); } - setMediaBlobUrl(null); + setMediaBlobUrl(undefined); setStatus("idle"); }, }; diff --git a/yarn.lock b/yarn.lock index 757d754..7d862da 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,15 +2,12 @@ # yarn lockfile v1 -"@types/dom-mediacapture-record@^1.0.2": - version "1.0.7" - resolved "https://registry.yarnpkg.com/@types/dom-mediacapture-record/-/dom-mediacapture-record-1.0.7.tgz#08bacca4296ef521d59049f43e65cf971bbf6be1" - integrity sha512-ddDIRTO1ajtbxaNo2o7fPJggpN54PZf1ZUJKOjto2ENMJE/9GKUvaw3ZRuQzlS/p0E+PnIcssxfoqYJ4yiXSBw== - -"@types/node@^12.12.11": - version "12.12.54" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.54.tgz#a4b58d8df3a4677b6c08bfbc94b7ad7a7a5f82d1" - integrity sha512-ge4xZ3vSBornVYlDnk7yZ0gK6ChHf/CHB7Gl1I0Jhah8DDnEQqBzgohYG4FX4p81TNirSETOiSyn+y1r9/IR6w== +"@babel/runtime@^7.17.9": + version "7.17.9" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.17.9.tgz#d19fbf802d01a8cb6cf053a64e472d42c434ba72" + integrity sha512-lSiBBvodq29uShpWGNbgFdKYNiFDo5/HIYsaCEY9ff4sb10x9jizo2+pRrSyF4jKZCXqgzuqBOQKbUm90gQwJg== + dependencies: + regenerator-runtime "^0.13.4" "@types/prop-types@*": version "15.7.3" @@ -25,17 +22,209 @@ "@types/prop-types" "*" csstype "^3.0.2" +automation-events@^4.0.16: + version "4.0.16" + resolved "https://registry.yarnpkg.com/automation-events/-/automation-events-4.0.16.tgz#38b57ceebdb94e3b9ae7197fba39ec3a95e7d5eb" + integrity sha512-8mIkcXzjyisUaw2O9HC80wOHscEPPD/ROrh/rEKN2B3VJzt3YJH5w0LcpUHyzprqV24HR0eTCelSKoei1FGg1A== + dependencies: + "@babel/runtime" "^7.17.9" + tslib "^2.4.0" + +broker-factory@^3.0.61: + version "3.0.61" + resolved "https://registry.yarnpkg.com/broker-factory/-/broker-factory-3.0.61.tgz#f1dfc84f7e7e8f5e21d36b1652b66eb6d19be2a1" + integrity sha512-ns5dmQLu1f5dankjVH5HbrKcif7g0+RSm4na++gcMShn73KG5ZNq1gbZjrD1pJc8/et4cqu4ouf3FDrmKh0t6Q== + dependencies: + "@babel/runtime" "^7.17.9" + fast-unique-numbers "^6.0.15" + tslib "^2.4.0" + worker-factory "^6.0.61" + +compilerr@^9.0.15: + version "9.0.15" + resolved "https://registry.yarnpkg.com/compilerr/-/compilerr-9.0.15.tgz#8631c0f37d9527b5faecfd22b4f99615d0c2233f" + integrity sha512-x1Xpp4+g4LdvipYpiQD8qXPn4rRZ7C4halnvTTfc+8y1t3AIFRhHh4mDDX9ikQ3FImYDbZ7m6AjsFWGVhe1j5A== + dependencies: + "@babel/runtime" "^7.17.9" + dashify "^2.0.0" + indefinite-article "0.0.2" + tslib "^2.4.0" + csstype@^3.0.2: version "3.0.3" resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.3.tgz#2b410bbeba38ba9633353aff34b05d9755d065f8" integrity sha512-jPl+wbWPOWJ7SXsWyqGRk3lGecbar0Cb0OvZF/r/ZU011R4YqiRehgkQ9p4eQfo9DSDLqLL3wHwfxeJiuIsNag== +dashify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/dashify/-/dashify-2.0.0.tgz#fff270ca2868ca427fee571de35691d6e437a648" + integrity sha512-hpA5C/YrPjucXypHPPc0oJ1l9Hf6wWbiOL7Ik42cxnsUOhWiCB/fylKbKqqJalW9FgkNQCw16YO8uW9Hs0Iy1A== + +extendable-media-recorder-wav-encoder-broker@^7.0.62: + version "7.0.62" + resolved "https://registry.yarnpkg.com/extendable-media-recorder-wav-encoder-broker/-/extendable-media-recorder-wav-encoder-broker-7.0.62.tgz#afdf1b14b5085142672272e9b826cce446b66f64" + integrity sha512-OiwXwlOdUndvFP/paAwZ0Y+gVLSzUVX28ag5pFv4+S9Rg1Kum2CeeZGHVUoeaHQ8WMCeJevna1EzQ9oOtWwwlw== + dependencies: + "@babel/runtime" "^7.17.9" + broker-factory "^3.0.61" + extendable-media-recorder-wav-encoder-worker "^8.0.61" + tslib "^2.4.0" + +extendable-media-recorder-wav-encoder-worker@^8.0.61: + version "8.0.61" + resolved "https://registry.yarnpkg.com/extendable-media-recorder-wav-encoder-worker/-/extendable-media-recorder-wav-encoder-worker-8.0.61.tgz#a15f1cd73b5136f99dd057a0f885fcda942f845c" + integrity sha512-WQsdAMOldjJQJsJHW+/4gLtiNDn/XNmaBRpfnit2hR055VIym/3cwD4yosWz07KiKoxXU6eHycRB2fPNiL9PfQ== + dependencies: + "@babel/runtime" "^7.17.9" + tslib "^2.4.0" + worker-factory "^6.0.61" + +extendable-media-recorder-wav-encoder@^7.0.68: + version "7.0.68" + resolved "https://registry.yarnpkg.com/extendable-media-recorder-wav-encoder/-/extendable-media-recorder-wav-encoder-7.0.68.tgz#db46ffcb1ef71fb18c70f895509d64c02327a185" + integrity sha512-TAjqUzp9CCTe48asy6EDnCyHepAEKivpUdPlBYzLjuMwSaLtriASbhLX+e7u81E6WnjZAHxvu4CHCYTZ/IFoUg== + dependencies: + "@babel/runtime" "^7.17.9" + extendable-media-recorder-wav-encoder-broker "^7.0.62" + extendable-media-recorder-wav-encoder-worker "^8.0.61" + tslib "^2.4.0" + +extendable-media-recorder@^6.6.5: + version "6.6.5" + resolved "https://registry.yarnpkg.com/extendable-media-recorder/-/extendable-media-recorder-6.6.5.tgz#a33eb3ff97899a2f005193d995015892956f47bd" + integrity sha512-aK30tMW0Qe4YVwvOAoARM8XvHgV9b4WMnnN+jp28PrBt5gzaIyW2eniRCFgeqByVyR3PXrMH5HZoZHitWzc0Ng== + dependencies: + "@babel/runtime" "^7.17.9" + media-encoder-host "^8.0.70" + multi-buffer-data-view "^3.0.16" + recorder-audio-worklet "^5.1.22" + standardized-audio-context "^25.3.24" + subscribable-things "^2.1.2" + tslib "^2.4.0" + +fast-unique-numbers@^6.0.15: + version "6.0.15" + resolved "https://registry.yarnpkg.com/fast-unique-numbers/-/fast-unique-numbers-6.0.15.tgz#8c212e6c8d8a5aa28f7d5a1287e10af142f345a6" + integrity sha512-WcGw5cmMdBBx7v2RmEwSHjaVzHjpfkjZuAEE1H3eyZNeOyPeKOmgwDzKt1cUq9ckpz4ZpxozDDki77FOF51n7g== + dependencies: + "@babel/runtime" "^7.17.9" + tslib "^2.4.0" + +indefinite-article@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/indefinite-article/-/indefinite-article-0.0.2.tgz#4bc855257066cfab61ea68beba75d100d6e2506b" + integrity sha1-S8hVJXBmz6th6mi+unXRANbiUGs= + jsmin@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/jsmin/-/jsmin-1.0.1.tgz#e7bd0dcd6496c3bf4863235bf461a3d98aa3b98c" integrity sha1-570NzWSWw79IYyNb9GGj2YqjuYw= -typescript@^3.7.2: - version "3.9.7" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.7.tgz#98d600a5ebdc38f40cb277522f12dc800e9e25fa" - integrity sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw== +media-encoder-host-broker@^7.0.62: + version "7.0.62" + resolved "https://registry.yarnpkg.com/media-encoder-host-broker/-/media-encoder-host-broker-7.0.62.tgz#88a4f7d837802d24d43ad9e5f8896197285c3506" + integrity sha512-dfMYczE5ZQ2iTP4afN1fxxtRLGNVx2OPaMTJ+/+eBpe1rHQc4k4KC31y6bOovRvqX/Av1I21AlRGMEz1dpThZA== + dependencies: + "@babel/runtime" "^7.17.9" + broker-factory "^3.0.61" + fast-unique-numbers "^6.0.15" + media-encoder-host-worker "^9.0.62" + tslib "^2.4.0" + +media-encoder-host-worker@^9.0.62: + version "9.0.62" + resolved "https://registry.yarnpkg.com/media-encoder-host-worker/-/media-encoder-host-worker-9.0.62.tgz#6b2cbedb8cee8dc2198f000f9917a1f68ed9744e" + integrity sha512-4jNR8/MV48h2HwVjftcHEDwhmoZMDn9g8474YO3hQlL+hgousdmzUY9WJg1gnxZUGrOKO7vMwa68NXhkp2StJA== + dependencies: + "@babel/runtime" "^7.17.9" + extendable-media-recorder-wav-encoder-broker "^7.0.62" + tslib "^2.4.0" + worker-factory "^6.0.61" + +media-encoder-host@^8.0.70: + version "8.0.70" + resolved "https://registry.yarnpkg.com/media-encoder-host/-/media-encoder-host-8.0.70.tgz#c50ff3a2136bd2fefded47ac693007273ce28326" + integrity sha512-mNymonSFpzbU9lSGGjzy+iWuW5n6/VEDpA5o76uqPScO6iQdzZCtJyr0BgbmZr4GIKLzuXrvRREsx6g9V9utrg== + dependencies: + "@babel/runtime" "^7.17.9" + media-encoder-host-broker "^7.0.62" + media-encoder-host-worker "^9.0.62" + tslib "^2.4.0" + +multi-buffer-data-view@^3.0.16: + version "3.0.16" + resolved "https://registry.yarnpkg.com/multi-buffer-data-view/-/multi-buffer-data-view-3.0.16.tgz#693b3b5d0f63a9e65fd02dc95e0cb76a33faf2b6" + integrity sha512-qgoVuop4RGk75PN+E3XB1RCCLyaIZIFW4EmQ9Wy1knsc4gks2MsCh2wYNw2qiefJjq5cNhkBm7BBFKOjjEhciA== + dependencies: + "@babel/runtime" "^7.17.9" + tslib "^2.4.0" + +recorder-audio-worklet-processor@^4.2.10: + version "4.2.10" + resolved "https://registry.yarnpkg.com/recorder-audio-worklet-processor/-/recorder-audio-worklet-processor-4.2.10.tgz#0d2d07138beb8e9adf435cd78581d4cf1b5e92ea" + integrity sha512-2CwIl/7oE5Kna2kvLJnyHbnj0cdbEusVJcXFMzAMaz9ub+itXHfzTcQJEjE2FbM0iDSscp8LOzo+yiFHIzZ5oQ== + dependencies: + "@babel/runtime" "^7.17.9" + tslib "^2.4.0" + +recorder-audio-worklet@^5.1.22: + version "5.1.22" + resolved "https://registry.yarnpkg.com/recorder-audio-worklet/-/recorder-audio-worklet-5.1.22.tgz#ee99b998c3ce04edf2a7c3a576fef98ecabb897a" + integrity sha512-H9Poo3m7lT6ocgGpyUiHD6F4dDI+NQPBRyaHnOMJUwKVhSSs5jKvlrQE9ohhGXCyZS6+0Eu2miCbciXsYX4rMA== + dependencies: + "@babel/runtime" "^7.17.9" + broker-factory "^3.0.61" + fast-unique-numbers "^6.0.15" + recorder-audio-worklet-processor "^4.2.10" + standardized-audio-context "^25.3.24" + subscribable-things "^2.1.2" + tslib "^2.4.0" + worker-factory "^6.0.61" + +regenerator-runtime@^0.13.4: + version "0.13.9" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz#8925742a98ffd90814988d7566ad30ca3b263b52" + integrity sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA== + +rxjs-interop@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/rxjs-interop/-/rxjs-interop-2.0.0.tgz#dca61a93789a8304f653d2e159e377cefa348ec7" + integrity sha512-ASEq9atUw7lualXB+knvgtvwkCEvGWV2gDD/8qnASzBkzEARZck9JAyxmY8OS6Nc1pCPEgDTKNcx+YqqYfzArw== + +standardized-audio-context@^25.3.24: + version "25.3.24" + resolved "https://registry.yarnpkg.com/standardized-audio-context/-/standardized-audio-context-25.3.24.tgz#c23f0d50a3e9ff5104824c4473dab5b18502055f" + integrity sha512-7/NFOmgSXJojKZHhiMjosT1ajD+OW6i/q8Nej/4SC6mj3DQ70pVeSmWABi9+TckVi+yaHSGgb0EHNApDN7a/dA== + dependencies: + "@babel/runtime" "^7.17.9" + automation-events "^4.0.16" + tslib "^2.4.0" + +subscribable-things@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/subscribable-things/-/subscribable-things-2.1.2.tgz#28e15088369e2e84dfda2a9443bdd274fefdd719" + integrity sha512-HhPRj+XP+DLeb6iCgoIBCOUkq5sYdpcipzXAZl97B7PBkH5lrL8MhNjTVd5eVHzeTVh1yx5ZdAxYzvF3Lt4mfg== + dependencies: + "@babel/runtime" "^7.17.9" + rxjs-interop "^2.0.0" + tslib "^2.4.0" + +tslib@^2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" + integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== + +typescript@^4.4.3: + version "4.6.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.4.tgz#caa78bbc3a59e6a5c510d35703f6a09877ce45e9" + integrity sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg== + +worker-factory@^6.0.61: + version "6.0.61" + resolved "https://registry.yarnpkg.com/worker-factory/-/worker-factory-6.0.61.tgz#6b094d97651e4b5129252470170b137b9c282efa" + integrity sha512-KaIJitUDCFGIHSnSbEwMYlQGuD+qkI+H5e3LX1lZICmWJdoHovv112f40PgEcrSgROs14ry+3lFhEsU2rqj5iw== + dependencies: + "@babel/runtime" "^7.17.9" + compilerr "^9.0.15" + fast-unique-numbers "^6.0.15" + tslib "^2.4.0" From c072ee747c6e6e14145463b3bd7a489d2e055097 Mon Sep 17 00:00:00 2001 From: Khalid Al-Awady Date: Sun, 8 May 2022 21:38:05 -0700 Subject: [PATCH 2/3] linter issues --- src/index.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/index.ts b/src/index.ts index ccd51a4..8aeed95 100644 --- a/src/index.ts +++ b/src/index.ts @@ -122,7 +122,6 @@ export function useReactMediaRecorder({ } setStatus("idle"); } catch (error: any) { - console.log(error); setError(error.name); setStatus("idle"); } @@ -135,7 +134,7 @@ export function useReactMediaRecorder({ if (screen) { if (!window.navigator.mediaDevices.getDisplayMedia) { - throw new Error("This browser doesn\"t support screen capturing"); + throw new Error("This browser doesn\'t support screen capturing"); } } @@ -151,8 +150,7 @@ export function useReactMediaRecorder({ console.error( `The constraints ${unSupportedConstraints.join( ",", - // eslint-disable-next-line max-len - )} doesn"t support on this browser. Please check your ReactMediaRecorder component.`, + )} doesn't support on this browser. Please check your ReactMediaRecorder component.`, ); } }; @@ -167,7 +165,7 @@ export function useReactMediaRecorder({ if (mediaRecorderOptions && mediaRecorderOptions.mimeType) { if (!MediaRecorder.isTypeSupported(mediaRecorderOptions.mimeType)) { console.error( - `The specified MIME type you supplied for MediaRecorder doesn"t support this browser`, + `The specified MIME type you supplied for MediaRecorder doesn't support this browser`, ); } } From 7a4bdf897c8e5359be79aaf69ff4e99b9737a983 Mon Sep 17 00:00:00 2001 From: Khalid Al-Awady Date: Tue, 10 May 2022 12:15:28 -0700 Subject: [PATCH 3/3] removes yarn lock and updates version number --- package.json | 2 +- yarn.lock | 230 --------------------------------------------------- 2 files changed, 1 insertion(+), 231 deletions(-) delete mode 100644 yarn.lock diff --git a/package.json b/package.json index 90a86ca..73bdde3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-media-recorder", - "version": "1.6.5", + "version": "1.6.6", "description": "A React component based on MediaRecorder() API to record audio/video streams", "main": "index.js", "scripts": { diff --git a/yarn.lock b/yarn.lock deleted file mode 100644 index 7d862da..0000000 --- a/yarn.lock +++ /dev/null @@ -1,230 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@babel/runtime@^7.17.9": - version "7.17.9" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.17.9.tgz#d19fbf802d01a8cb6cf053a64e472d42c434ba72" - integrity sha512-lSiBBvodq29uShpWGNbgFdKYNiFDo5/HIYsaCEY9ff4sb10x9jizo2+pRrSyF4jKZCXqgzuqBOQKbUm90gQwJg== - dependencies: - regenerator-runtime "^0.13.4" - -"@types/prop-types@*": - version "15.7.3" - resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.3.tgz#2ab0d5da2e5815f94b0b9d4b95d1e5f243ab2ca7" - integrity sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw== - -"@types/react@^16.9.11": - version "16.9.49" - resolved "https://registry.yarnpkg.com/@types/react/-/react-16.9.49.tgz#09db021cf8089aba0cdb12a49f8021a69cce4872" - integrity sha512-DtLFjSj0OYAdVLBbyjhuV9CdGVHCkHn2R+xr3XkBvK2rS1Y1tkc14XSGjYgm5Fjjr90AxH9tiSzc1pCFMGO06g== - dependencies: - "@types/prop-types" "*" - csstype "^3.0.2" - -automation-events@^4.0.16: - version "4.0.16" - resolved "https://registry.yarnpkg.com/automation-events/-/automation-events-4.0.16.tgz#38b57ceebdb94e3b9ae7197fba39ec3a95e7d5eb" - integrity sha512-8mIkcXzjyisUaw2O9HC80wOHscEPPD/ROrh/rEKN2B3VJzt3YJH5w0LcpUHyzprqV24HR0eTCelSKoei1FGg1A== - dependencies: - "@babel/runtime" "^7.17.9" - tslib "^2.4.0" - -broker-factory@^3.0.61: - version "3.0.61" - resolved "https://registry.yarnpkg.com/broker-factory/-/broker-factory-3.0.61.tgz#f1dfc84f7e7e8f5e21d36b1652b66eb6d19be2a1" - integrity sha512-ns5dmQLu1f5dankjVH5HbrKcif7g0+RSm4na++gcMShn73KG5ZNq1gbZjrD1pJc8/et4cqu4ouf3FDrmKh0t6Q== - dependencies: - "@babel/runtime" "^7.17.9" - fast-unique-numbers "^6.0.15" - tslib "^2.4.0" - worker-factory "^6.0.61" - -compilerr@^9.0.15: - version "9.0.15" - resolved "https://registry.yarnpkg.com/compilerr/-/compilerr-9.0.15.tgz#8631c0f37d9527b5faecfd22b4f99615d0c2233f" - integrity sha512-x1Xpp4+g4LdvipYpiQD8qXPn4rRZ7C4halnvTTfc+8y1t3AIFRhHh4mDDX9ikQ3FImYDbZ7m6AjsFWGVhe1j5A== - dependencies: - "@babel/runtime" "^7.17.9" - dashify "^2.0.0" - indefinite-article "0.0.2" - tslib "^2.4.0" - -csstype@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.3.tgz#2b410bbeba38ba9633353aff34b05d9755d065f8" - integrity sha512-jPl+wbWPOWJ7SXsWyqGRk3lGecbar0Cb0OvZF/r/ZU011R4YqiRehgkQ9p4eQfo9DSDLqLL3wHwfxeJiuIsNag== - -dashify@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/dashify/-/dashify-2.0.0.tgz#fff270ca2868ca427fee571de35691d6e437a648" - integrity sha512-hpA5C/YrPjucXypHPPc0oJ1l9Hf6wWbiOL7Ik42cxnsUOhWiCB/fylKbKqqJalW9FgkNQCw16YO8uW9Hs0Iy1A== - -extendable-media-recorder-wav-encoder-broker@^7.0.62: - version "7.0.62" - resolved "https://registry.yarnpkg.com/extendable-media-recorder-wav-encoder-broker/-/extendable-media-recorder-wav-encoder-broker-7.0.62.tgz#afdf1b14b5085142672272e9b826cce446b66f64" - integrity sha512-OiwXwlOdUndvFP/paAwZ0Y+gVLSzUVX28ag5pFv4+S9Rg1Kum2CeeZGHVUoeaHQ8WMCeJevna1EzQ9oOtWwwlw== - dependencies: - "@babel/runtime" "^7.17.9" - broker-factory "^3.0.61" - extendable-media-recorder-wav-encoder-worker "^8.0.61" - tslib "^2.4.0" - -extendable-media-recorder-wav-encoder-worker@^8.0.61: - version "8.0.61" - resolved "https://registry.yarnpkg.com/extendable-media-recorder-wav-encoder-worker/-/extendable-media-recorder-wav-encoder-worker-8.0.61.tgz#a15f1cd73b5136f99dd057a0f885fcda942f845c" - integrity sha512-WQsdAMOldjJQJsJHW+/4gLtiNDn/XNmaBRpfnit2hR055VIym/3cwD4yosWz07KiKoxXU6eHycRB2fPNiL9PfQ== - dependencies: - "@babel/runtime" "^7.17.9" - tslib "^2.4.0" - worker-factory "^6.0.61" - -extendable-media-recorder-wav-encoder@^7.0.68: - version "7.0.68" - resolved "https://registry.yarnpkg.com/extendable-media-recorder-wav-encoder/-/extendable-media-recorder-wav-encoder-7.0.68.tgz#db46ffcb1ef71fb18c70f895509d64c02327a185" - integrity sha512-TAjqUzp9CCTe48asy6EDnCyHepAEKivpUdPlBYzLjuMwSaLtriASbhLX+e7u81E6WnjZAHxvu4CHCYTZ/IFoUg== - dependencies: - "@babel/runtime" "^7.17.9" - extendable-media-recorder-wav-encoder-broker "^7.0.62" - extendable-media-recorder-wav-encoder-worker "^8.0.61" - tslib "^2.4.0" - -extendable-media-recorder@^6.6.5: - version "6.6.5" - resolved "https://registry.yarnpkg.com/extendable-media-recorder/-/extendable-media-recorder-6.6.5.tgz#a33eb3ff97899a2f005193d995015892956f47bd" - integrity sha512-aK30tMW0Qe4YVwvOAoARM8XvHgV9b4WMnnN+jp28PrBt5gzaIyW2eniRCFgeqByVyR3PXrMH5HZoZHitWzc0Ng== - dependencies: - "@babel/runtime" "^7.17.9" - media-encoder-host "^8.0.70" - multi-buffer-data-view "^3.0.16" - recorder-audio-worklet "^5.1.22" - standardized-audio-context "^25.3.24" - subscribable-things "^2.1.2" - tslib "^2.4.0" - -fast-unique-numbers@^6.0.15: - version "6.0.15" - resolved "https://registry.yarnpkg.com/fast-unique-numbers/-/fast-unique-numbers-6.0.15.tgz#8c212e6c8d8a5aa28f7d5a1287e10af142f345a6" - integrity sha512-WcGw5cmMdBBx7v2RmEwSHjaVzHjpfkjZuAEE1H3eyZNeOyPeKOmgwDzKt1cUq9ckpz4ZpxozDDki77FOF51n7g== - dependencies: - "@babel/runtime" "^7.17.9" - tslib "^2.4.0" - -indefinite-article@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/indefinite-article/-/indefinite-article-0.0.2.tgz#4bc855257066cfab61ea68beba75d100d6e2506b" - integrity sha1-S8hVJXBmz6th6mi+unXRANbiUGs= - -jsmin@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/jsmin/-/jsmin-1.0.1.tgz#e7bd0dcd6496c3bf4863235bf461a3d98aa3b98c" - integrity sha1-570NzWSWw79IYyNb9GGj2YqjuYw= - -media-encoder-host-broker@^7.0.62: - version "7.0.62" - resolved "https://registry.yarnpkg.com/media-encoder-host-broker/-/media-encoder-host-broker-7.0.62.tgz#88a4f7d837802d24d43ad9e5f8896197285c3506" - integrity sha512-dfMYczE5ZQ2iTP4afN1fxxtRLGNVx2OPaMTJ+/+eBpe1rHQc4k4KC31y6bOovRvqX/Av1I21AlRGMEz1dpThZA== - dependencies: - "@babel/runtime" "^7.17.9" - broker-factory "^3.0.61" - fast-unique-numbers "^6.0.15" - media-encoder-host-worker "^9.0.62" - tslib "^2.4.0" - -media-encoder-host-worker@^9.0.62: - version "9.0.62" - resolved "https://registry.yarnpkg.com/media-encoder-host-worker/-/media-encoder-host-worker-9.0.62.tgz#6b2cbedb8cee8dc2198f000f9917a1f68ed9744e" - integrity sha512-4jNR8/MV48h2HwVjftcHEDwhmoZMDn9g8474YO3hQlL+hgousdmzUY9WJg1gnxZUGrOKO7vMwa68NXhkp2StJA== - dependencies: - "@babel/runtime" "^7.17.9" - extendable-media-recorder-wav-encoder-broker "^7.0.62" - tslib "^2.4.0" - worker-factory "^6.0.61" - -media-encoder-host@^8.0.70: - version "8.0.70" - resolved "https://registry.yarnpkg.com/media-encoder-host/-/media-encoder-host-8.0.70.tgz#c50ff3a2136bd2fefded47ac693007273ce28326" - integrity sha512-mNymonSFpzbU9lSGGjzy+iWuW5n6/VEDpA5o76uqPScO6iQdzZCtJyr0BgbmZr4GIKLzuXrvRREsx6g9V9utrg== - dependencies: - "@babel/runtime" "^7.17.9" - media-encoder-host-broker "^7.0.62" - media-encoder-host-worker "^9.0.62" - tslib "^2.4.0" - -multi-buffer-data-view@^3.0.16: - version "3.0.16" - resolved "https://registry.yarnpkg.com/multi-buffer-data-view/-/multi-buffer-data-view-3.0.16.tgz#693b3b5d0f63a9e65fd02dc95e0cb76a33faf2b6" - integrity sha512-qgoVuop4RGk75PN+E3XB1RCCLyaIZIFW4EmQ9Wy1knsc4gks2MsCh2wYNw2qiefJjq5cNhkBm7BBFKOjjEhciA== - dependencies: - "@babel/runtime" "^7.17.9" - tslib "^2.4.0" - -recorder-audio-worklet-processor@^4.2.10: - version "4.2.10" - resolved "https://registry.yarnpkg.com/recorder-audio-worklet-processor/-/recorder-audio-worklet-processor-4.2.10.tgz#0d2d07138beb8e9adf435cd78581d4cf1b5e92ea" - integrity sha512-2CwIl/7oE5Kna2kvLJnyHbnj0cdbEusVJcXFMzAMaz9ub+itXHfzTcQJEjE2FbM0iDSscp8LOzo+yiFHIzZ5oQ== - dependencies: - "@babel/runtime" "^7.17.9" - tslib "^2.4.0" - -recorder-audio-worklet@^5.1.22: - version "5.1.22" - resolved "https://registry.yarnpkg.com/recorder-audio-worklet/-/recorder-audio-worklet-5.1.22.tgz#ee99b998c3ce04edf2a7c3a576fef98ecabb897a" - integrity sha512-H9Poo3m7lT6ocgGpyUiHD6F4dDI+NQPBRyaHnOMJUwKVhSSs5jKvlrQE9ohhGXCyZS6+0Eu2miCbciXsYX4rMA== - dependencies: - "@babel/runtime" "^7.17.9" - broker-factory "^3.0.61" - fast-unique-numbers "^6.0.15" - recorder-audio-worklet-processor "^4.2.10" - standardized-audio-context "^25.3.24" - subscribable-things "^2.1.2" - tslib "^2.4.0" - worker-factory "^6.0.61" - -regenerator-runtime@^0.13.4: - version "0.13.9" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz#8925742a98ffd90814988d7566ad30ca3b263b52" - integrity sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA== - -rxjs-interop@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/rxjs-interop/-/rxjs-interop-2.0.0.tgz#dca61a93789a8304f653d2e159e377cefa348ec7" - integrity sha512-ASEq9atUw7lualXB+knvgtvwkCEvGWV2gDD/8qnASzBkzEARZck9JAyxmY8OS6Nc1pCPEgDTKNcx+YqqYfzArw== - -standardized-audio-context@^25.3.24: - version "25.3.24" - resolved "https://registry.yarnpkg.com/standardized-audio-context/-/standardized-audio-context-25.3.24.tgz#c23f0d50a3e9ff5104824c4473dab5b18502055f" - integrity sha512-7/NFOmgSXJojKZHhiMjosT1ajD+OW6i/q8Nej/4SC6mj3DQ70pVeSmWABi9+TckVi+yaHSGgb0EHNApDN7a/dA== - dependencies: - "@babel/runtime" "^7.17.9" - automation-events "^4.0.16" - tslib "^2.4.0" - -subscribable-things@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/subscribable-things/-/subscribable-things-2.1.2.tgz#28e15088369e2e84dfda2a9443bdd274fefdd719" - integrity sha512-HhPRj+XP+DLeb6iCgoIBCOUkq5sYdpcipzXAZl97B7PBkH5lrL8MhNjTVd5eVHzeTVh1yx5ZdAxYzvF3Lt4mfg== - dependencies: - "@babel/runtime" "^7.17.9" - rxjs-interop "^2.0.0" - tslib "^2.4.0" - -tslib@^2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" - integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== - -typescript@^4.4.3: - version "4.6.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.4.tgz#caa78bbc3a59e6a5c510d35703f6a09877ce45e9" - integrity sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg== - -worker-factory@^6.0.61: - version "6.0.61" - resolved "https://registry.yarnpkg.com/worker-factory/-/worker-factory-6.0.61.tgz#6b094d97651e4b5129252470170b137b9c282efa" - integrity sha512-KaIJitUDCFGIHSnSbEwMYlQGuD+qkI+H5e3LX1lZICmWJdoHovv112f40PgEcrSgROs14ry+3lFhEsU2rqj5iw== - dependencies: - "@babel/runtime" "^7.17.9" - compilerr "^9.0.15" - fast-unique-numbers "^6.0.15" - tslib "^2.4.0"