Skip to content

Commit a4658e2

Browse files
committed
document new media element bindings
1 parent a8ff02a commit a4658e2

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

site/content/docs/02-template-syntax.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,12 +563,14 @@ Elements with the `contenteditable` attribute support `innerHTML` and `textConte
563563

564564
---
565565

566-
Media elements (`<audio>` and `<video>`) have their own set of bindings — four *readonly* ones...
566+
Media elements (`<audio>` and `<video>`) have their own set of bindings — six *readonly* ones...
567567

568568
* `duration` (readonly) — the total duration of the video, in seconds
569569
* `buffered` (readonly) — an array of `{start, end}` objects
570570
* `seekable` (readonly) — ditto
571571
* `played` (readonly) — ditto
572+
* `seeking` (readonly) — boolean
573+
* `ended` (readonly) — boolean
572574

573575
...and four *two-way* bindings:
574576

@@ -577,16 +579,22 @@ Media elements (`<audio>` and `<video>`) have their own set of bindings — four
577579
* `paused` — this one should be self-explanatory
578580
* `volume` — a value between 0 and 1
579581

582+
Videos additionally have readonly `videoWidth` and `videoHeight` bindings
583+
580584
```html
581585
<video
582586
src={clip}
583587
bind:duration
584588
bind:buffered
585589
bind:seekable
590+
bind:seeking
586591
bind:played
592+
bind:ended
587593
bind:currentTime
588594
bind:paused
589595
bind:volume
596+
bind:videoWidth
597+
bind:videoHeight
590598
></video>
591599
```
592600

site/content/tutorial/06-bindings/10-media-elements/text.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,20 @@ Now, when you click on the video, it will update `time`, `duration` and `paused`
2424

2525
> Ordinarily on the web, you would track `currentTime` by listening for `timeupdate` events. But these events fire too infrequently, resulting in choppy UI. Svelte does better — it checks `currentTime` using `requestAnimationFrame`.
2626
27-
The complete set of bindings for `<audio>` and `<video>` is as follows — four *readonly* bindings...
27+
The complete set of bindings for `<audio>` and `<video>` is as follows — six *readonly* bindings...
2828

2929
* `duration` (readonly) — the total duration of the video, in seconds
3030
* `buffered` (readonly) — an array of `{start, end}` objects
3131
* `seekable` (readonly) — ditto
3232
* `played` (readonly) — ditto
33+
* `seeking` (readonly) — boolean
34+
* `ended` (readonly) — boolean
3335

3436
...and four *two-way* bindings:
3537

3638
* `currentTime` — the current point in the video, in seconds
3739
* `playbackRate` — how fast to play the video, where `1` is 'normal'
3840
* `paused` — this one should be self-explanatory
3941
* `volume` — a value between 0 and 1
42+
43+
Videos additionally have readonly `videoWidth` and `videoHeight` bindings.

0 commit comments

Comments
 (0)