Media.El
The HTML media element interface.
Warning. This binding is incomplete, the modules El.Audio_track
, El.Video_track
, El.Text_track
are mostly empty.
module Error : sig ... end
Media errors
module Can_play : sig ... end
Can play enum.
module Have : sig ... end
Ready state codes.
module Network : sig ... end
Network state codes.
module Cors : sig ... end
CORS settings
module Provider : sig ... end
Media providers.
module Audio_track : sig ... end
Audio tracks (incomplete).
module Video_track : sig ... end
Video tracks (incomplete).
module Text_track : sig ... end
Text tracks (incomplete).
module Time_ranges : sig ... end
Time ranges.
The type for elements satifying the HTMLMediaElement
interface.
of_el e
is the media interface of e
. This throws a JavaScript error if e
is not a Brr.El.audio
or Brr.El.video
element.
src m
is the URI source of the played media.
val src_object : t -> Provider.t option
src_object m s
is the source object of m
.
val set_src_object : t -> Provider.t option -> unit
set_src_object m o
sets the src_object
of m
to o
.
current_src m
is the current source of m
.
cross_origin m
is the CORS setting of m
.
set_cross_origin m c
sets the cross_origin
of m
to c
.
network_state m
is the network state of m
.
val buffered : t -> Time_ranges.t
buffered m
are the ranges of media that are buffered:
val can_play_type : t -> Jstr.t -> Can_play.t
can_play_type m t
indicates if m
can play t
.
val seeking : t -> bool
seeking m
indicates m
is seeking a new position.
val current_time_s : t -> float
current_time m
is the current time of m
.
val set_current_time_s : t -> float -> unit
set_current_time_s m t
sets the current_time_s
of m
to t
.
val default_playback_rate : t -> float
default_playback_rate m
is the default playback rate of m
.
val set_default_playback_rate : t -> float -> unit
set_default_playback_rate m
sets the default_playback_rate
of m
.
val playback_rate : t -> float
playback_rate m
is the playback rate of m
.
val set_playback_rate : t -> float -> unit
set_playback_rate m
sets the playback_rate
of m
.
val played : t -> Time_ranges.t
played m
are the ranges that have been played.
val seekable : t -> Time_ranges.t
seekable m
indicates the time ranges that are seekable.
val play : t -> unit Fut.or_error
play m
plays m
.
val default_muted : t -> bool
default_muted m
is the default muted state.
val set_default_muted : t -> bool -> unit
set_default_muted m b
sets the default_muted
of m
to b
.
val audio_track_list : t -> Audio_track.List.t
audio_track_list m
are the audio tracks of m
.
val video_track_list : t -> Video_track.List.t
video_track_list m
are the video tracks of m
.
val text_track_list : t -> Text_track.List.t
text_trac_list m
are the text tracks of m
.
capture_tream m
is a media stream for m
.