Skip to content

What is the feature detection story for MediaStreamTrack support? #126

@beaufortfrancois

Description

@beaufortfrancois

As a web developer, I wish there was a way to feature-detect before calling start(audioTrack) following #118 changes. This is not possible for now, even after calling it.

May I suggest some ideas?

1. Rename start(MediaStreamTrack audioTrack) - bikeshedding is welcome

     undefined start();
-    undefined start(MediaStreamTrack audioTrack);
+    undefined startWithMediaStreamTrack(MediaStreamTrack audioTrack);
if ('startWithMediaStreamTrack' in webkitSpeechRecognition.prototype) {
  // MediaStreamTrack is supported by the Web Speech API.
}

2. Tie MediaStreamTrack support to other properties

It may be appropriate to assume some of the changes to the Web Speech API will come with MediaStreamTrack support. I'm not sure though which ones yet. Maybe SpeechRecognitionMode mode from #122?

if ('mode' in webkitSpeechRecognition.prototype) {
  // MediaStreamTrack is supported by the Web Speech API.
}

FYI @evanbliu

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions