Open
Description
This proposal seeks to add a seek bar widget for controlling media playback.
A seek bar is very similar to a slider, but with a few key differences:
- A seek bar works with
duration
and notfloat
values. - A seek bar's minimum value is always zero.
- A seek bar's orientation is always horizontal.
- A seek bar optionally has a separate track region for displaying the buffer health.
Here is the proposed interface for a SeekBar
:
- Properties
enabled
: (in bool) Seek bar is enabled. Default:true
.has-focus
: (out bool) Seek bar has focus.value
: (in-out duration) Current seek position. Default:0s
.buffer-duration
(in duration) Current buffer duration. Default:0s
.total-duration
: (in duration) Total content duration, analogous toSlider.maximum
. Default:0s
.
- Callbacks
scrubbed(duration)
: User is scrubbing content, analogous toSlider::changed(float)
.released(duration)
: User released seek bar after scrubbing.
The SeekBar
implementations can likely wrap SliderBase
since the two share so much functionality.