Module Media.Devices

Media device enumeration.

val enumerate : Brr_io.Media.Devices.t -> Brr_io.Media.Device.Info.t list

enumerate m determines a list of connected media devices. Monitor changes by listening Brr_io.Media.Devices.Ev.devicechange on m.

val get_user_media : Brr_io.Media.Devices.t -> Brr_io.Media.Stream.Constraints.t -> Brr_io.Media.Stream.t

get_user_media m c prompts the user to use a media input which can produce a media stream constrained by c. These errors can occur. In particular Jv.Error.Not_allowed and Jv.Error.Not_found should be reported to the user in a friendly way. In some browsers this call has to done in a user interface event handler.

val get_display_media : Brr_io.Media.Devices.t -> Brr_io.Media.Stream.Constraints.t -> Brr_io.Media.Stream.t

get_display_media m c prompts the user to select and grant permission to capture the contents of a display as a media stream. A video track is unconditionally returned even if c says otherwise. In some browsers this call has to done in a user interface event handler.

See this MDN article for more details.