Modernizr: MediaStream Recording API

Created on 23 Jun 2020  ยท  13Comments  ยท  Source: Modernizr/Modernizr

Hello,

It is possible to detect the MediaStream Recording API yet? I cannot see this on the feature list.

Thanks,

good first issue

Most helpful comment

go for it!

On Fri, Oct 2, 2020 at 2:41 PM Jaikishan Brijwani notifications@github.com
wrote:

@patrickkettner https://github.com/patrickkettner is the issue still up
for grabs? or you planning to not add this functionality to it?

โ€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Modernizr/Modernizr/issues/2577#issuecomment-702896110,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AADRUBSN6XUXUUP2QVVU4WTSIYNE3ANCNFSM4OFNHOBQ
.

--
patrick

All 13 comments

Hi ๐Ÿ‘‹, as far as I know we don't have a feature detection yet. Maybe we could detect it with mediaRecorder object?

Hi,

This is what I am using which seems to work fine:

function testMediaRecorder () {

       var isMediaRecorderSupported = false;

        try {
            MediaRecorder;
            isMediaRecorderSupported = true;
        } catch (err) {
            console.log("no MediaRecorder");
        }
        console.log(isMediaRecorderSupported);
        return(isMediaRecorderSupported);
    }

testMediaRecorder();

Yeah this test should be pretty straight forward.

Anyway if you want to do it yourself you would only need to change the log messages to var result = true and instead of a return change it to a addTest passing on the variable. You may even be able to use something like

if (MediaRecorder) {
 var true
}
else {
 var false
}

as the object will probably be undefined if it is not supported. Just throwing ideas :)

If you decide it to do it yourself feel free to request any assistance ๐Ÿ’ช

Maybe a good-first-issue tag on this issue would be nice! ๐Ÿค”

Hi @Markel ,I want to contribute to this issue. I am new to the codebase, can someone help me here a bit, where the changes are to be made and just some guidance :)

Modernizr.addTest('mediarecorder', typeof MediaRecorder)

would be the modernizr-y way of checking

Modernizr usually doesn't add detects for things that are this straightforward to detect, as it is just adding bloat to the web

Hi @ricknjacky :)
Absolutely, okay, the browsers tests are contained inside the feature-detects folder, so the first thing it would be creating a file called mediastream.js file there.

Now we have to create the test (that's the complicated part), the feature detects are divided in two parts: the metadata part and the detect. For the metadata I recommend you checking the metadata documentation (don't worry if you are not able to include everything, just fill as many gaps as you can). For the detect part I recommend checking the webauthn detect which is very similar to this one + the comment I left above too helps :)

Once you finished the file you would need to add a test to it, we have this steps documented so it should be straight-forward, but if you have any problem write a comment without hesitation.

Good luck ๐Ÿ’ช

Oh, @patrickkettner beat me! ๐Ÿ˜… His solution works too!

About adding "bloat" to the web, you're the maintainer, so your call ๐Ÿ˜Š!

@patrickkettner is the issue still up for grabs? or you planning to not add this functionality to it?

go for it!

On Fri, Oct 2, 2020 at 2:41 PM Jaikishan Brijwani notifications@github.com
wrote:

@patrickkettner https://github.com/patrickkettner is the issue still up
for grabs? or you planning to not add this functionality to it?

โ€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Modernizr/Modernizr/issues/2577#issuecomment-702896110,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AADRUBSN6XUXUUP2QVVU4WTSIYNE3ANCNFSM4OFNHOBQ
.

--
patrick

May i work on this issue?

If @ricknjacky doesnt show up in the next 24 hours go for it :-)

As a note, even if #2606 has been closed (not merged), the issue stills needs to be worked on :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BenRichter picture BenRichter  ยท  9Comments

BasJan81 picture BasJan81  ยท  9Comments

lovetrivedi picture lovetrivedi  ยท  4Comments

acschwartz picture acschwartz  ยท  6Comments

RehanSaeed picture RehanSaeed  ยท  6Comments