Skip to content

Media Device API #24

@saghul

Description

@saghul

Ahoi!

(Somewhat related to #10)

I've been trying to do something which sounds simple like selecting the audio / video device I want to use before calling getUserMedia. I didn't know I was in for that much nonsense.

AFAIS there are at least a couple of ways browsers do it, navigator.mediaDevices.enumerateDevices being the new and shinny preferred way.

rtcninja provides getMediaDevices, which is a wrapper around, MediaStreamTrack.getSources, alas this doesn't work on Firefox nor on Chrome >= 47 (current Canary).

The problem is that depending on how the devices are enumerated the constraints need to be specified differently, so rtcninja would also need to accommodate for that.

This is something I can probably work on and provide a patch, but there are a couple of things that need clarifying first:

  • do we want to shim navigator.mediaDevices, or just provide a custom getMediaDevices API function?
  • since we are here, should it return a Promise? (I see promises are supported after FF 38 (latest ESR release) and Chrome 32, so we're fine)

Maybe this is a good start to implement the promise based API?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions