@mattebox/player 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -3
- package/dist/cdn/mattebox-player.min.js +222 -198
- package/dist/compose.d.ts +5 -0
- package/dist/compose.d.ts.map +1 -0
- package/dist/compose.js +31 -0
- package/dist/compose.js.map +1 -0
- package/dist/controls/chapters.d.ts +29 -0
- package/dist/controls/chapters.d.ts.map +1 -0
- package/dist/controls/chapters.js +81 -0
- package/dist/controls/chapters.js.map +1 -0
- package/dist/controls/cues.d.ts +8 -3
- package/dist/controls/cues.d.ts.map +1 -1
- package/dist/controls/cues.js +44 -10
- package/dist/controls/cues.js.map +1 -1
- package/dist/controls/fullscreen.d.ts +9 -9
- package/dist/controls/fullscreen.d.ts.map +1 -1
- package/dist/controls/fullscreen.js +17 -21
- package/dist/controls/fullscreen.js.map +1 -1
- package/dist/controls/icons.d.ts +1 -3
- package/dist/controls/icons.d.ts.map +1 -1
- package/dist/controls/icons.js +3 -6
- package/dist/controls/icons.js.map +1 -1
- package/dist/controls/menu.d.ts +14 -11
- package/dist/controls/menu.d.ts.map +1 -1
- package/dist/controls/menu.js +39 -34
- package/dist/controls/menu.js.map +1 -1
- package/dist/controls/session.d.ts +27 -0
- package/dist/controls/session.d.ts.map +1 -0
- package/dist/controls/session.js +36 -0
- package/dist/controls/session.js.map +1 -0
- package/dist/controls/slider.d.ts +6 -6
- package/dist/controls/slider.d.ts.map +1 -1
- package/dist/controls/slider.js +18 -13
- package/dist/controls/slider.js.map +1 -1
- package/dist/dom.d.ts +4 -10
- package/dist/dom.d.ts.map +1 -1
- package/dist/dom.js +4 -24
- package/dist/dom.js.map +1 -1
- package/dist/element-entry.d.ts +4 -0
- package/dist/element-entry.d.ts.map +1 -0
- package/dist/element-entry.js +9 -0
- package/dist/element-entry.js.map +1 -0
- package/dist/element.d.ts +54 -14
- package/dist/element.d.ts.map +1 -1
- package/dist/element.js +154 -73
- package/dist/element.js.map +1 -1
- package/dist/elements/audio-menu.d.ts +24 -0
- package/dist/elements/audio-menu.d.ts.map +1 -0
- package/dist/elements/audio-menu.js +70 -0
- package/dist/elements/audio-menu.js.map +1 -0
- package/dist/elements/chapters-menu.d.ts +12 -0
- package/dist/elements/chapters-menu.d.ts.map +1 -0
- package/dist/elements/chapters-menu.js +67 -0
- package/dist/elements/chapters-menu.js.map +1 -0
- package/dist/elements/component.d.ts +45 -0
- package/dist/elements/component.d.ts.map +1 -0
- package/dist/elements/component.js +90 -0
- package/dist/elements/component.js.map +1 -0
- package/dist/elements/control-bar.d.ts +75 -0
- package/dist/elements/control-bar.d.ts.map +1 -0
- package/dist/elements/control-bar.js +339 -0
- package/dist/elements/control-bar.js.map +1 -0
- package/dist/elements/current-time.d.ts +5 -0
- package/dist/elements/current-time.d.ts.map +1 -0
- package/dist/elements/current-time.js +27 -0
- package/dist/elements/current-time.js.map +1 -0
- package/dist/elements/drm-badge.d.ts +29 -0
- package/dist/elements/drm-badge.d.ts.map +1 -0
- package/dist/elements/drm-badge.js +145 -0
- package/dist/elements/drm-badge.js.map +1 -0
- package/dist/elements/duration.d.ts +6 -0
- package/dist/elements/duration.d.ts.map +1 -0
- package/dist/elements/duration.js +23 -0
- package/dist/elements/duration.js.map +1 -0
- package/dist/elements/error-screen.d.ts +17 -0
- package/dist/elements/error-screen.d.ts.map +1 -0
- package/dist/elements/error-screen.js +103 -0
- package/dist/elements/error-screen.js.map +1 -0
- package/dist/elements/fullscreen-button.d.ts +19 -0
- package/dist/elements/fullscreen-button.d.ts.map +1 -0
- package/dist/elements/fullscreen-button.js +55 -0
- package/dist/elements/fullscreen-button.js.map +1 -0
- package/dist/elements/live-button.d.ts +12 -0
- package/dist/elements/live-button.d.ts.map +1 -0
- package/dist/elements/live-button.js +96 -0
- package/dist/elements/live-button.js.map +1 -0
- package/dist/elements/menu-element.d.ts +22 -0
- package/dist/elements/menu-element.d.ts.map +1 -0
- package/dist/elements/menu-element.js +31 -0
- package/dist/elements/menu-element.js.map +1 -0
- package/dist/elements/mute-button.d.ts +12 -0
- package/dist/elements/mute-button.d.ts.map +1 -0
- package/dist/elements/mute-button.js +61 -0
- package/dist/elements/mute-button.js.map +1 -0
- package/dist/elements/panels.d.ts +15 -0
- package/dist/elements/panels.d.ts.map +1 -0
- package/dist/elements/panels.js +55 -0
- package/dist/elements/panels.js.map +1 -0
- package/dist/elements/pip-button.d.ts +13 -0
- package/dist/elements/pip-button.d.ts.map +1 -0
- package/dist/elements/pip-button.js +56 -0
- package/dist/elements/pip-button.js.map +1 -0
- package/dist/elements/play-button.d.ts +12 -0
- package/dist/elements/play-button.d.ts.map +1 -0
- package/dist/elements/play-button.js +60 -0
- package/dist/elements/play-button.js.map +1 -0
- package/dist/elements/quality-menu.d.ts +11 -0
- package/dist/elements/quality-menu.d.ts.map +1 -0
- package/dist/elements/quality-menu.js +72 -0
- package/dist/elements/quality-menu.js.map +1 -0
- package/dist/elements/remaining-time.d.ts +6 -0
- package/dist/elements/remaining-time.d.ts.map +1 -0
- package/dist/elements/remaining-time.js +26 -0
- package/dist/elements/remaining-time.js.map +1 -0
- package/dist/elements/seek-bar.d.ts +83 -0
- package/dist/elements/seek-bar.d.ts.map +1 -0
- package/dist/elements/seek-bar.js +352 -0
- package/dist/elements/seek-bar.js.map +1 -0
- package/dist/elements/shared.d.ts +27 -0
- package/dist/elements/shared.d.ts.map +1 -0
- package/dist/elements/shared.js +155 -0
- package/dist/elements/shared.js.map +1 -0
- package/dist/elements/skip-button.d.ts +14 -0
- package/dist/elements/skip-button.d.ts.map +1 -0
- package/dist/elements/skip-button.js +60 -0
- package/dist/elements/skip-button.js.map +1 -0
- package/dist/elements/spacer.d.ts +4 -0
- package/dist/elements/spacer.d.ts.map +1 -0
- package/dist/elements/spacer.js +9 -0
- package/dist/elements/spacer.js.map +1 -0
- package/dist/elements/speed-menu.d.ts +18 -0
- package/dist/elements/speed-menu.d.ts.map +1 -0
- package/dist/elements/speed-menu.js +56 -0
- package/dist/elements/speed-menu.js.map +1 -0
- package/dist/elements/start-button.d.ts +23 -0
- package/dist/elements/start-button.d.ts.map +1 -0
- package/dist/elements/start-button.js +120 -0
- package/dist/elements/start-button.js.map +1 -0
- package/dist/elements/subtitles-menu.d.ts +17 -0
- package/dist/elements/subtitles-menu.d.ts.map +1 -0
- package/dist/elements/subtitles-menu.js +108 -0
- package/dist/elements/subtitles-menu.js.map +1 -0
- package/dist/elements/time-element.d.ts +14 -0
- package/dist/elements/time-element.d.ts.map +1 -0
- package/dist/elements/time-element.js +29 -0
- package/dist/elements/time-element.js.map +1 -0
- package/dist/elements/volume-slider.d.ts +10 -0
- package/dist/elements/volume-slider.d.ts.map +1 -0
- package/dist/elements/volume-slider.js +46 -0
- package/dist/elements/volume-slider.js.map +1 -0
- package/dist/elements/volume.d.ts +9 -0
- package/dist/elements/volume.d.ts.map +1 -0
- package/dist/elements/volume.js +52 -0
- package/dist/elements/volume.js.map +1 -0
- package/dist/entries/audio-menu.d.ts +5 -0
- package/dist/entries/audio-menu.d.ts.map +1 -0
- package/dist/entries/audio-menu.js +8 -0
- package/dist/entries/audio-menu.js.map +1 -0
- package/dist/entries/chapters-menu.d.ts +5 -0
- package/dist/entries/chapters-menu.d.ts.map +1 -0
- package/dist/entries/chapters-menu.js +9 -0
- package/dist/entries/chapters-menu.js.map +1 -0
- package/dist/entries/control-bar.d.ts +5 -0
- package/dist/entries/control-bar.d.ts.map +1 -0
- package/dist/entries/control-bar.js +8 -0
- package/dist/entries/control-bar.js.map +1 -0
- package/dist/entries/current-time.d.ts +5 -0
- package/dist/entries/current-time.d.ts.map +1 -0
- package/dist/entries/current-time.js +8 -0
- package/dist/entries/current-time.js.map +1 -0
- package/dist/entries/drm-badge.d.ts +5 -0
- package/dist/entries/drm-badge.d.ts.map +1 -0
- package/dist/entries/drm-badge.js +8 -0
- package/dist/entries/drm-badge.js.map +1 -0
- package/dist/entries/duration.d.ts +5 -0
- package/dist/entries/duration.d.ts.map +1 -0
- package/dist/entries/duration.js +8 -0
- package/dist/entries/duration.js.map +1 -0
- package/dist/entries/error-screen.d.ts +5 -0
- package/dist/entries/error-screen.d.ts.map +1 -0
- package/dist/entries/error-screen.js +8 -0
- package/dist/entries/error-screen.js.map +1 -0
- package/dist/entries/fullscreen-button.d.ts +5 -0
- package/dist/entries/fullscreen-button.d.ts.map +1 -0
- package/dist/entries/fullscreen-button.js +8 -0
- package/dist/entries/fullscreen-button.js.map +1 -0
- package/dist/entries/live-button.d.ts +5 -0
- package/dist/entries/live-button.d.ts.map +1 -0
- package/dist/entries/live-button.js +8 -0
- package/dist/entries/live-button.js.map +1 -0
- package/dist/entries/mute-button.d.ts +5 -0
- package/dist/entries/mute-button.d.ts.map +1 -0
- package/dist/entries/mute-button.js +8 -0
- package/dist/entries/mute-button.js.map +1 -0
- package/dist/entries/panels.d.ts +5 -0
- package/dist/entries/panels.d.ts.map +1 -0
- package/dist/entries/panels.js +8 -0
- package/dist/entries/panels.js.map +1 -0
- package/dist/entries/pip-button.d.ts +5 -0
- package/dist/entries/pip-button.d.ts.map +1 -0
- package/dist/entries/pip-button.js +8 -0
- package/dist/entries/pip-button.js.map +1 -0
- package/dist/entries/play-button.d.ts +5 -0
- package/dist/entries/play-button.d.ts.map +1 -0
- package/dist/entries/play-button.js +8 -0
- package/dist/entries/play-button.js.map +1 -0
- package/dist/entries/quality-menu.d.ts +5 -0
- package/dist/entries/quality-menu.d.ts.map +1 -0
- package/dist/entries/quality-menu.js +8 -0
- package/dist/entries/quality-menu.js.map +1 -0
- package/dist/entries/remaining-time.d.ts +5 -0
- package/dist/entries/remaining-time.d.ts.map +1 -0
- package/dist/entries/remaining-time.js +9 -0
- package/dist/entries/remaining-time.js.map +1 -0
- package/dist/entries/seek-bar.d.ts +5 -0
- package/dist/entries/seek-bar.d.ts.map +1 -0
- package/dist/entries/seek-bar.js +8 -0
- package/dist/entries/seek-bar.js.map +1 -0
- package/dist/entries/skip-button.d.ts +5 -0
- package/dist/entries/skip-button.d.ts.map +1 -0
- package/dist/entries/skip-button.js +8 -0
- package/dist/entries/skip-button.js.map +1 -0
- package/dist/entries/spacer.d.ts +5 -0
- package/dist/entries/spacer.d.ts.map +1 -0
- package/dist/entries/spacer.js +8 -0
- package/dist/entries/spacer.js.map +1 -0
- package/dist/entries/speed-menu.d.ts +5 -0
- package/dist/entries/speed-menu.d.ts.map +1 -0
- package/dist/entries/speed-menu.js +8 -0
- package/dist/entries/speed-menu.js.map +1 -0
- package/dist/entries/start-button.d.ts +5 -0
- package/dist/entries/start-button.d.ts.map +1 -0
- package/dist/entries/start-button.js +8 -0
- package/dist/entries/start-button.js.map +1 -0
- package/dist/entries/subtitles-menu.d.ts +5 -0
- package/dist/entries/subtitles-menu.d.ts.map +1 -0
- package/dist/entries/subtitles-menu.js +8 -0
- package/dist/entries/subtitles-menu.js.map +1 -0
- package/dist/entries/volume-slider.d.ts +5 -0
- package/dist/entries/volume-slider.d.ts.map +1 -0
- package/dist/entries/volume-slider.js +8 -0
- package/dist/entries/volume-slider.js.map +1 -0
- package/dist/entries/volume.d.ts +7 -0
- package/dist/entries/volume.d.ts.map +1 -0
- package/dist/entries/volume.js +10 -0
- package/dist/entries/volume.js.map +1 -0
- package/dist/es2015/compose.js +33 -0
- package/dist/es2015/controls/chapters.js +61 -0
- package/dist/es2015/controls/cues.js +39 -11
- package/dist/es2015/controls/fullscreen.js +25 -23
- package/dist/es2015/controls/icons.js +5 -9
- package/dist/es2015/controls/menu.js +39 -35
- package/dist/es2015/controls/session.js +40 -0
- package/dist/es2015/controls/slider.js +18 -13
- package/dist/es2015/controls/time.js +1 -5
- package/dist/es2015/dom.js +5 -25
- package/dist/es2015/element-entry.js +10 -0
- package/dist/es2015/element.js +118 -65
- package/dist/es2015/elements/audio-menu.js +68 -0
- package/dist/es2015/elements/chapters-menu.js +68 -0
- package/dist/es2015/elements/component.js +85 -0
- package/dist/es2015/elements/control-bar.js +299 -0
- package/dist/es2015/elements/current-time.js +27 -0
- package/dist/es2015/elements/drm-badge.js +138 -0
- package/dist/es2015/elements/duration.js +23 -0
- package/dist/es2015/elements/error-screen.js +97 -0
- package/dist/es2015/elements/fullscreen-button.js +49 -0
- package/dist/es2015/elements/live-button.js +97 -0
- package/dist/es2015/elements/menu-element.js +39 -0
- package/dist/es2015/elements/mute-button.js +60 -0
- package/dist/es2015/elements/panels.js +52 -0
- package/dist/es2015/elements/pip-button.js +56 -0
- package/dist/es2015/elements/play-button.js +68 -0
- package/dist/es2015/elements/quality-menu.js +68 -0
- package/dist/es2015/elements/remaining-time.js +26 -0
- package/dist/es2015/elements/seek-bar.js +314 -0
- package/dist/es2015/elements/shared.js +155 -0
- package/dist/es2015/elements/skip-button.js +59 -0
- package/dist/es2015/elements/spacer.js +11 -0
- package/dist/es2015/elements/speed-menu.js +60 -0
- package/dist/es2015/elements/start-button.js +124 -0
- package/dist/es2015/elements/subtitles-menu.js +103 -0
- package/dist/es2015/elements/time-element.js +38 -0
- package/dist/es2015/elements/volume-slider.js +47 -0
- package/dist/es2015/elements/volume.js +52 -0
- package/dist/es2015/entries/audio-menu.js +7 -0
- package/dist/es2015/entries/chapters-menu.js +7 -0
- package/dist/es2015/entries/control-bar.js +7 -0
- package/dist/es2015/entries/current-time.js +7 -0
- package/dist/es2015/entries/drm-badge.js +7 -0
- package/dist/es2015/entries/duration.js +7 -0
- package/dist/es2015/entries/error-screen.js +7 -0
- package/dist/es2015/entries/fullscreen-button.js +7 -0
- package/dist/es2015/entries/live-button.js +7 -0
- package/dist/es2015/entries/mute-button.js +7 -0
- package/dist/es2015/entries/panels.js +7 -0
- package/dist/es2015/entries/pip-button.js +7 -0
- package/dist/es2015/entries/play-button.js +7 -0
- package/dist/es2015/entries/quality-menu.js +7 -0
- package/dist/es2015/entries/remaining-time.js +7 -0
- package/dist/es2015/entries/seek-bar.js +7 -0
- package/dist/es2015/entries/skip-button.js +7 -0
- package/dist/es2015/entries/spacer.js +7 -0
- package/dist/es2015/entries/speed-menu.js +7 -0
- package/dist/es2015/entries/start-button.js +7 -0
- package/dist/es2015/entries/subtitles-menu.js +7 -0
- package/dist/es2015/entries/volume-slider.js +7 -0
- package/dist/es2015/entries/volume.js +9 -0
- package/dist/es2015/host.js +23 -0
- package/dist/es2015/index.js +48 -9
- package/dist/es2015/labels.js +14 -0
- package/dist/es2015/style.js +40 -292
- package/dist/es2015/{panels/error.js → surface.js} +3 -3
- package/dist/es2015/tags.js +28 -0
- package/dist/host.d.ts +26 -0
- package/dist/host.d.ts.map +1 -0
- package/dist/host.js +23 -0
- package/dist/host.js.map +1 -0
- package/dist/index.d.ts +84 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +24 -8
- package/dist/index.js.map +1 -1
- package/dist/labels.d.ts +7 -0
- package/dist/labels.d.ts.map +1 -0
- package/dist/labels.js +12 -0
- package/dist/labels.js.map +1 -0
- package/dist/style.d.ts +10 -2
- package/dist/style.d.ts.map +1 -1
- package/dist/style.js +40 -292
- package/dist/style.js.map +1 -1
- package/dist/surface.d.ts +15 -0
- package/dist/surface.d.ts.map +1 -0
- package/dist/{panels/error.js → surface.js} +3 -3
- package/dist/surface.js.map +1 -0
- package/dist/tags.d.ts +26 -0
- package/dist/tags.d.ts.map +1 -0
- package/dist/tags.js +26 -0
- package/dist/tags.js.map +1 -0
- package/package.json +22 -2
- package/dist/controls/bar.d.ts +0 -56
- package/dist/controls/bar.d.ts.map +0 -1
- package/dist/controls/bar.js +0 -245
- package/dist/controls/bar.js.map +0 -1
- package/dist/controls/buttons.d.ts +0 -13
- package/dist/controls/buttons.d.ts.map +0 -1
- package/dist/controls/buttons.js +0 -157
- package/dist/controls/buttons.js.map +0 -1
- package/dist/controls/control.d.ts +0 -12
- package/dist/controls/control.d.ts.map +0 -1
- package/dist/controls/control.js +0 -2
- package/dist/controls/control.js.map +0 -1
- package/dist/controls/keys.d.ts +0 -26
- package/dist/controls/keys.d.ts.map +0 -1
- package/dist/controls/keys.js +0 -66
- package/dist/controls/keys.js.map +0 -1
- package/dist/controls/live.d.ts +0 -10
- package/dist/controls/live.d.ts.map +0 -1
- package/dist/controls/live.js +0 -59
- package/dist/controls/live.js.map +0 -1
- package/dist/controls/menus.d.ts +0 -43
- package/dist/controls/menus.d.ts.map +0 -1
- package/dist/controls/menus.js +0 -262
- package/dist/controls/menus.js.map +0 -1
- package/dist/controls/options.d.ts +0 -44
- package/dist/controls/options.d.ts.map +0 -1
- package/dist/controls/options.js +0 -54
- package/dist/controls/options.js.map +0 -1
- package/dist/controls/screens.d.ts +0 -22
- package/dist/controls/screens.d.ts.map +0 -1
- package/dist/controls/screens.js +0 -69
- package/dist/controls/screens.js.map +0 -1
- package/dist/controls/seek.d.ts +0 -52
- package/dist/controls/seek.d.ts.map +0 -1
- package/dist/controls/seek.js +0 -215
- package/dist/controls/seek.js.map +0 -1
- package/dist/controls/speed.d.ts +0 -8
- package/dist/controls/speed.d.ts.map +0 -1
- package/dist/controls/speed.js +0 -34
- package/dist/controls/speed.js.map +0 -1
- package/dist/controls/volume.d.ts +0 -8
- package/dist/controls/volume.d.ts.map +0 -1
- package/dist/controls/volume.js +0 -29
- package/dist/controls/volume.js.map +0 -1
- package/dist/es2015/controls/bar.js +0 -227
- package/dist/es2015/controls/buttons.js +0 -146
- package/dist/es2015/controls/keys.js +0 -60
- package/dist/es2015/controls/live.js +0 -60
- package/dist/es2015/controls/menus.js +0 -258
- package/dist/es2015/controls/options.js +0 -46
- package/dist/es2015/controls/screens.js +0 -74
- package/dist/es2015/controls/seek.js +0 -203
- package/dist/es2015/controls/speed.js +0 -41
- package/dist/es2015/controls/volume.js +0 -30
- package/dist/es2015/panels/drm.js +0 -29
- package/dist/es2015/panels/live.js +0 -48
- package/dist/es2015/panels/quality.js +0 -52
- package/dist/es2015/panels/tracks.js +0 -47
- package/dist/panels/drm.d.ts +0 -8
- package/dist/panels/drm.d.ts.map +0 -1
- package/dist/panels/drm.js +0 -36
- package/dist/panels/drm.js.map +0 -1
- package/dist/panels/error.d.ts +0 -13
- package/dist/panels/error.d.ts.map +0 -1
- package/dist/panels/error.js.map +0 -1
- package/dist/panels/live.d.ts +0 -3
- package/dist/panels/live.d.ts.map +0 -1
- package/dist/panels/live.js +0 -56
- package/dist/panels/live.js.map +0 -1
- package/dist/panels/panel.d.ts +0 -13
- package/dist/panels/panel.d.ts.map +0 -1
- package/dist/panels/panel.js +0 -2
- package/dist/panels/panel.js.map +0 -1
- package/dist/panels/quality.d.ts +0 -3
- package/dist/panels/quality.d.ts.map +0 -1
- package/dist/panels/quality.js +0 -59
- package/dist/panels/quality.js.map +0 -1
- package/dist/panels/tracks.d.ts +0 -3
- package/dist/panels/tracks.d.ts.map +0 -1
- package/dist/panels/tracks.js +0 -49
- package/dist/panels/tracks.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"play-button.d.ts","sourceRoot":"","sources":["../../src/elements/play-button.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAO3C,qBAAa,aAAc,SAAQ,SAAS;IAC1C,MAAM,KAAK,kBAAkB,IAAI,SAAS,MAAM,EAAE,CAEjD;IAED,iBAAyB,MAAM,CAAoB;IACnD,iBAAyB,KAAK,CAAiC;;IAgB/D,OAAO,CAAC,MAAM;cAYK,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;cAOhC,MAAM,IAAI,IAAI;CAOlC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* <mbx-play-button>: play, pause, or replay once the media has ended. It
|
|
3
|
+
* reads the video on the events the video already fires and writes one
|
|
4
|
+
* thing back on click. The glyph is a slot per state, so a page drops its
|
|
5
|
+
* own SVG into `icon-play`, `icon-pause` or `icon-replay`; the name is on
|
|
6
|
+
* the button, from `label-play`, `label-pause` and `label-replay`, where a
|
|
7
|
+
* screen reader reads it.
|
|
8
|
+
*/
|
|
9
|
+
import { icon } from '../controls/icons.js';
|
|
10
|
+
import { Component } from './component.js';
|
|
11
|
+
import { BUTTON_STYLE, iconSlots, show, style } from './shared.js';
|
|
12
|
+
const STATES = ['play', 'pause', 'replay'];
|
|
13
|
+
const LABELS = { play: 'Play', pause: 'Pause', replay: 'Replay' };
|
|
14
|
+
export class MbxPlayButton extends Component {
|
|
15
|
+
static get observedAttributes() {
|
|
16
|
+
return STATES.map((state) => `label-${state}`);
|
|
17
|
+
}
|
|
18
|
+
constructor() {
|
|
19
|
+
super();
|
|
20
|
+
const root = this.attachShadow({ mode: 'open' });
|
|
21
|
+
this.button = document.createElement('button');
|
|
22
|
+
this.button.type = 'button';
|
|
23
|
+
this.button.setAttribute('part', 'button');
|
|
24
|
+
this.slots = iconSlots(STATES, icon);
|
|
25
|
+
for (const state of STATES)
|
|
26
|
+
this.button.append(this.slots[state]);
|
|
27
|
+
this.button.addEventListener('click', () => {
|
|
28
|
+
this.toggle();
|
|
29
|
+
});
|
|
30
|
+
root.append(style(BUTTON_STYLE), this.button);
|
|
31
|
+
}
|
|
32
|
+
toggle() {
|
|
33
|
+
const video = this.player?.video;
|
|
34
|
+
if (video === undefined)
|
|
35
|
+
return;
|
|
36
|
+
if (video.paused) {
|
|
37
|
+
// Rejected outside a user gesture on an unmuted video, which the
|
|
38
|
+
// browser reports on the video's own error path; nothing to add.
|
|
39
|
+
video.play().catch(() => undefined);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
video.pause();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
attach(player) {
|
|
46
|
+
this.listen(player.video, ['play', 'pause', 'ended', 'emptied'], () => {
|
|
47
|
+
this.render();
|
|
48
|
+
});
|
|
49
|
+
this.render();
|
|
50
|
+
}
|
|
51
|
+
render() {
|
|
52
|
+
const video = this.player?.video;
|
|
53
|
+
if (video === undefined)
|
|
54
|
+
return;
|
|
55
|
+
const state = video.ended ? 'replay' : video.paused ? 'play' : 'pause';
|
|
56
|
+
show(this.slots, state);
|
|
57
|
+
this.button.setAttribute('aria-label', this.getAttribute(`label-${state}`) ?? LABELS[state]);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=play-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"play-button.js","sourceRoot":"","sources":["../../src/elements/play-button.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { PlayerHost } from '../host.js';
|
|
2
|
+
import { MenuElement } from './menu-element.js';
|
|
3
|
+
export declare class MbxQualityMenu extends MenuElement {
|
|
4
|
+
static get observedAttributes(): readonly string[];
|
|
5
|
+
private engine;
|
|
6
|
+
constructor();
|
|
7
|
+
protected name(): string;
|
|
8
|
+
protected attach(player: PlayerHost): void;
|
|
9
|
+
protected render(): void;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=quality-menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quality-menu.d.ts","sourceRoot":"","sources":["../../src/elements/quality-menu.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAU,MAAM,mBAAmB,CAAC;AAUxD,qBAAa,cAAe,SAAQ,WAAW;IAC7C,MAAM,KAAK,kBAAkB,IAAI,SAAS,MAAM,EAAE,CAEjD;IAED,QAAgB,MAAM,CAAkB;;cAQrB,IAAI,IAAI,MAAM;cAId,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;cAmBhC,MAAM,IAAI,IAAI;CA4BlC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { MenuElement, single } from './menu-element.js';
|
|
2
|
+
import { show } from './shared.js';
|
|
3
|
+
const AUTO = 'auto';
|
|
4
|
+
function renditionLabel(rendition) {
|
|
5
|
+
if (rendition.height !== undefined)
|
|
6
|
+
return `${rendition.height}p`;
|
|
7
|
+
return `${Math.round(rendition.bitrate / 1000)} kbps`;
|
|
8
|
+
}
|
|
9
|
+
export class MbxQualityMenu extends MenuElement {
|
|
10
|
+
static get observedAttributes() {
|
|
11
|
+
return ['label', 'label-auto', 'label-back'];
|
|
12
|
+
}
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...single('settings'));
|
|
15
|
+
this.engine = null;
|
|
16
|
+
show(this.slots, 'default');
|
|
17
|
+
}
|
|
18
|
+
name() {
|
|
19
|
+
return 'Quality';
|
|
20
|
+
}
|
|
21
|
+
attach(player) {
|
|
22
|
+
this.follow(player, (engine) => {
|
|
23
|
+
this.engine = engine;
|
|
24
|
+
this.render();
|
|
25
|
+
if (engine === null)
|
|
26
|
+
return undefined;
|
|
27
|
+
const tick = () => {
|
|
28
|
+
this.render();
|
|
29
|
+
};
|
|
30
|
+
const offs = [
|
|
31
|
+
engine.on('tracks:changed', tick),
|
|
32
|
+
engine.on('quality:constraints-unsatisfiable', tick),
|
|
33
|
+
engine.on('quality:pin-unsatisfiable', tick),
|
|
34
|
+
];
|
|
35
|
+
return () => {
|
|
36
|
+
for (const off of offs)
|
|
37
|
+
off();
|
|
38
|
+
};
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
render() {
|
|
42
|
+
super.render();
|
|
43
|
+
const engine = this.engine;
|
|
44
|
+
if (engine === null) {
|
|
45
|
+
this.hidden = true;
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const quality = engine.quality;
|
|
49
|
+
const items = [
|
|
50
|
+
[AUTO, this.getAttribute('label-auto') ?? 'Auto'],
|
|
51
|
+
];
|
|
52
|
+
for (const rendition of quality.renditions) {
|
|
53
|
+
items.push([rendition.id, renditionLabel(rendition)]);
|
|
54
|
+
}
|
|
55
|
+
this.menu.fill([
|
|
56
|
+
{
|
|
57
|
+
name: 'rendition',
|
|
58
|
+
items,
|
|
59
|
+
value: quality.pinned ?? AUTO,
|
|
60
|
+
onSelect: (value) => {
|
|
61
|
+
if (value === AUTO)
|
|
62
|
+
quality.auto();
|
|
63
|
+
else
|
|
64
|
+
quality.pin(value);
|
|
65
|
+
this.render();
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
]);
|
|
69
|
+
this.hidden = quality.renditions.length === 0;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=quality-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quality-menu.js","sourceRoot":"","sources":["../../src/elements/quality-menu.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remaining-time.d.ts","sourceRoot":"","sources":["../../src/elements/remaining-time.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,qBAAa,gBAAiB,SAAQ,WAAW;;cAK5B,MAAM,IAAI,IAAI;CAUlC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* <mbx-remaining-time>: what is left, "-4:53", once the metadata is in. A
|
|
3
|
+
* bar that shows one number shows this one: a viewer asks how much is
|
|
4
|
+
* left more often than where they are. A live stream has no end, so the
|
|
5
|
+
* element hides while the stream is live, as the duration does.
|
|
6
|
+
*/
|
|
7
|
+
import { live, span } from '../controls/session.js';
|
|
8
|
+
import { format } from '../controls/time.js';
|
|
9
|
+
import { TimeElement } from './time-element.js';
|
|
10
|
+
export class MbxRemainingTime extends TimeElement {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(':host { text-align: right; }');
|
|
13
|
+
}
|
|
14
|
+
render() {
|
|
15
|
+
const player = this.player;
|
|
16
|
+
if (player === null)
|
|
17
|
+
return;
|
|
18
|
+
const video = player.video;
|
|
19
|
+
const engine = player.engine;
|
|
20
|
+
const on = live(engine) !== undefined;
|
|
21
|
+
this.hidden = on;
|
|
22
|
+
if (!on)
|
|
23
|
+
this.text.data = `-${format(Math.max(0, span(video, engine).end - video.currentTime))}`;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=remaining-time.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remaining-time.js","sourceRoot":"","sources":["../../src/elements/remaining-time.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,OAAO,gBAAiB,SAAQ,WAAW;IAC/C;QACE,KAAK,CAAC,8BAA8B,CAAC,CAAC;IACxC,CAAC;IAEkB,MAAM;QACvB,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,IAAI,MAAM,KAAK,IAAI;YAAE,OAAO;QAC5B,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAC3B,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC7B,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,SAAS,CAAC;QACtC,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,EAAE;YACL,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,GAAG,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC;IAC5F,CAAC;CACF"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* <mbx-seek-bar>: the bar over the slider primitive, with four layers on
|
|
3
|
+
* its track, every one a part: the buffered ranges from `video.buffered`,
|
|
4
|
+
* the played span, the hover position, and for live the edge from
|
|
5
|
+
* `engine.live`. The span it maps is the availability window for live and
|
|
6
|
+
* the duration for VOD; `controls/session.ts` says which.
|
|
7
|
+
*
|
|
8
|
+
* A live stream is seekable only when the window is worth it: at least
|
|
9
|
+
* `live-window` forward buffer goals long, the goal read from the engine.
|
|
10
|
+
* Below that the bar hides. VOD is always seekable. The element sets
|
|
11
|
+
* `live` and `seekable` on the player, which the time and the live button
|
|
12
|
+
* read.
|
|
13
|
+
*
|
|
14
|
+
* Reads happen on the events the video already fires; the live window has
|
|
15
|
+
* no event of its own and moves with the clock, so `timeupdate` covers it.
|
|
16
|
+
* While a pointer holds the thumb, the played layer follows the pointer and
|
|
17
|
+
* `currentTime` is written at most once per frame, so the bar never fights
|
|
18
|
+
* a slow seek. The element carries `dragging` meanwhile.
|
|
19
|
+
*
|
|
20
|
+
* The preview above the pointer carries the time and, when the session's
|
|
21
|
+
* `engine.thumbnails` answers for that time, the tile: a rectangle of a
|
|
22
|
+
* sprite, drawn by background position at the sprite's own size and scaled
|
|
23
|
+
* down to `--mbx-preview-width`, so a page sets the size with one token.
|
|
24
|
+
*
|
|
25
|
+
* Chapters divide the track: one gap per chapter boundary, cut through
|
|
26
|
+
* every layer with a mask, so the played and the buffered spans read per
|
|
27
|
+
* chapter, and the preview names the chapter under the pointer. They are
|
|
28
|
+
* the video's own chapters track, see `controls/chapters.ts`.
|
|
29
|
+
* `chapters="none"` leaves the track whole and the preview without a name.
|
|
30
|
+
*
|
|
31
|
+
* `step` is what an arrow key moves the playhead by and `page` what Page
|
|
32
|
+
* Up and Page Down do, in seconds. The name comes from `label`; what a
|
|
33
|
+
* screen reader hears at a position from `label-of`, "{current} of
|
|
34
|
+
* {duration}", and on live from `label-behind`, "{time} behind live". It
|
|
35
|
+
* sits in the bar's seek row unless the page says otherwise.
|
|
36
|
+
*/
|
|
37
|
+
import type { PlayerHost } from '../host.js';
|
|
38
|
+
import { Component } from './component.js';
|
|
39
|
+
export declare class MbxSeekBar extends Component {
|
|
40
|
+
static get observedAttributes(): readonly string[];
|
|
41
|
+
private readonly bar;
|
|
42
|
+
private readonly buffered;
|
|
43
|
+
private readonly hover;
|
|
44
|
+
private readonly edge;
|
|
45
|
+
private readonly preview;
|
|
46
|
+
private readonly image;
|
|
47
|
+
private readonly tile;
|
|
48
|
+
private readonly time;
|
|
49
|
+
private readonly caption;
|
|
50
|
+
private range;
|
|
51
|
+
/** The chapters as last drawn, so the mask is written only when they change. */
|
|
52
|
+
private divided;
|
|
53
|
+
private list;
|
|
54
|
+
private pending;
|
|
55
|
+
private frame;
|
|
56
|
+
constructor();
|
|
57
|
+
connectedCallback(): void;
|
|
58
|
+
private isLive;
|
|
59
|
+
/** Whether the chapters divide the track and name the preview. */
|
|
60
|
+
private chaptered;
|
|
61
|
+
/** The gaps at the chapter boundaries, on every layer of the track at once. */
|
|
62
|
+
private paintChapters;
|
|
63
|
+
/** What a screen reader hears at a time. */
|
|
64
|
+
private say;
|
|
65
|
+
/** What the preview shows at a time. */
|
|
66
|
+
private label;
|
|
67
|
+
private input;
|
|
68
|
+
private flush;
|
|
69
|
+
/** The width the page asked for through the token, or the default. */
|
|
70
|
+
private previewWidth;
|
|
71
|
+
/** The tile for a time, if the track has one, drawn at its size and scaled to fit. */
|
|
72
|
+
private paintTile;
|
|
73
|
+
private paintBuffered;
|
|
74
|
+
/** Whether a live window is wide enough to be worth a bar. */
|
|
75
|
+
private worthSeeking;
|
|
76
|
+
/** The hover marker and the preview follow the pointer, clamped to the bar. */
|
|
77
|
+
private point;
|
|
78
|
+
private leave;
|
|
79
|
+
protected attach(player: PlayerHost): void;
|
|
80
|
+
protected detach(player: PlayerHost): void;
|
|
81
|
+
protected render(): void;
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=seek-bar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seek-bar.d.ts","sourceRoot":"","sources":["../../src/elements/seek-bar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAWH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AA8E3C,qBAAa,UAAW,SAAQ,SAAS;IACvC,MAAM,KAAK,kBAAkB,IAAI,SAAS,MAAM,EAAE,CAEjD;IAED,iBAAyB,GAAG,CAAS;IACrC,iBAAyB,QAAQ,CAAc;IAC/C,iBAAyB,KAAK,CAAc;IAC5C,iBAAyB,IAAI,CAAc;IAC3C,iBAAyB,OAAO,CAAc;IAC9C,iBAAyB,KAAK,CAAc;IAC5C,iBAAyB,IAAI,CAAc;IAC3C,iBAAyB,IAAI,CAAc;IAC3C,iBAAyB,OAAO,CAAc;IAC9C,QAAgB,KAAK,CAAO;IAC5B,gFAAgF;IAChF,QAAgB,OAAO,CAAS;IAChC,QAAgB,IAAI,CAAY;IAChC,QAAgB,OAAO,CAAgB;IACvC,QAAgB,KAAK,CAAS;;IAgDrB,iBAAiB,IAAI,IAAI;IAKlC,OAAO,CAAC,MAAM;IAId,kEAAkE;IAClE,OAAO,CAAC,SAAS;IAIjB,+EAA+E;IAC/E,OAAO,CAAC,aAAa;IAWrB,4CAA4C;IAC5C,OAAO,CAAC,GAAG;IAeX,wCAAwC;IACxC,OAAO,CAAC,KAAK;IAKb,OAAO,CAAC,KAAK;IAmBb,OAAO,CAAC,KAAK;IAQb,sEAAsE;IACtE,OAAO,CAAC,YAAY;IAOpB,sFAAsF;IACtF,OAAO,CAAC,SAAS;IAcjB,OAAO,CAAC,aAAa;IAsBrB,8DAA8D;IAC9D,OAAO,CAAC,YAAY;IAOpB,+EAA+E;IAC/E,OAAO,CAAC,KAAK;IAmBb,OAAO,CAAC,KAAK;cAKM,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;cAahC,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;cAShC,MAAM,IAAI,IAAI;CAuBlC"}
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* <mbx-seek-bar>: the bar over the slider primitive, with four layers on
|
|
3
|
+
* its track, every one a part: the buffered ranges from `video.buffered`,
|
|
4
|
+
* the played span, the hover position, and for live the edge from
|
|
5
|
+
* `engine.live`. The span it maps is the availability window for live and
|
|
6
|
+
* the duration for VOD; `controls/session.ts` says which.
|
|
7
|
+
*
|
|
8
|
+
* A live stream is seekable only when the window is worth it: at least
|
|
9
|
+
* `live-window` forward buffer goals long, the goal read from the engine.
|
|
10
|
+
* Below that the bar hides. VOD is always seekable. The element sets
|
|
11
|
+
* `live` and `seekable` on the player, which the time and the live button
|
|
12
|
+
* read.
|
|
13
|
+
*
|
|
14
|
+
* Reads happen on the events the video already fires; the live window has
|
|
15
|
+
* no event of its own and moves with the clock, so `timeupdate` covers it.
|
|
16
|
+
* While a pointer holds the thumb, the played layer follows the pointer and
|
|
17
|
+
* `currentTime` is written at most once per frame, so the bar never fights
|
|
18
|
+
* a slow seek. The element carries `dragging` meanwhile.
|
|
19
|
+
*
|
|
20
|
+
* The preview above the pointer carries the time and, when the session's
|
|
21
|
+
* `engine.thumbnails` answers for that time, the tile: a rectangle of a
|
|
22
|
+
* sprite, drawn by background position at the sprite's own size and scaled
|
|
23
|
+
* down to `--mbx-preview-width`, so a page sets the size with one token.
|
|
24
|
+
*
|
|
25
|
+
* Chapters divide the track: one gap per chapter boundary, cut through
|
|
26
|
+
* every layer with a mask, so the played and the buffered spans read per
|
|
27
|
+
* chapter, and the preview names the chapter under the pointer. They are
|
|
28
|
+
* the video's own chapters track, see `controls/chapters.ts`.
|
|
29
|
+
* `chapters="none"` leaves the track whole and the preview without a name.
|
|
30
|
+
*
|
|
31
|
+
* `step` is what an arrow key moves the playhead by and `page` what Page
|
|
32
|
+
* Up and Page Down do, in seconds. The name comes from `label`; what a
|
|
33
|
+
* screen reader hears at a position from `label-of`, "{current} of
|
|
34
|
+
* {duration}", and on live from `label-behind`, "{time} behind live". It
|
|
35
|
+
* sits in the bar's seek row unless the page says otherwise.
|
|
36
|
+
*/
|
|
37
|
+
import { chapterAt, chapters, followChapters } from '../controls/chapters.js';
|
|
38
|
+
import { at, clip, EMPTY, fraction } from '../controls/ranges.js';
|
|
39
|
+
import { bufferGoal, live, optional, span, wall } from '../controls/session.js';
|
|
40
|
+
import { slider } from '../controls/slider.js';
|
|
41
|
+
import { format } from '../controls/time.js';
|
|
42
|
+
import { el } from '../dom.js';
|
|
43
|
+
import { fill } from '../labels.js';
|
|
44
|
+
import { Component } from './component.js';
|
|
45
|
+
import { number, SLIDER_STYLE, seekRow, style } from './shared.js';
|
|
46
|
+
const STEP = 5;
|
|
47
|
+
const PAGE = 30;
|
|
48
|
+
const LIVE_WINDOW = 3;
|
|
49
|
+
/** What the tile scales down to when the page sets no `--mbx-preview-width`. */
|
|
50
|
+
const PREVIEW_WIDTH = 160;
|
|
51
|
+
/** The buffer goal assumed for a session that reports none. */
|
|
52
|
+
const BUFFER_GOAL = 30;
|
|
53
|
+
/** The gap cut at a chapter boundary, in pixels. */
|
|
54
|
+
const GAP = 2;
|
|
55
|
+
const EVENTS = [
|
|
56
|
+
'timeupdate',
|
|
57
|
+
'progress',
|
|
58
|
+
'durationchange',
|
|
59
|
+
'loadedmetadata',
|
|
60
|
+
'seeking',
|
|
61
|
+
'seeked',
|
|
62
|
+
'emptied',
|
|
63
|
+
];
|
|
64
|
+
const STYLE = `${SLIDER_STYLE}
|
|
65
|
+
:host { flex: 1; }
|
|
66
|
+
[part~="slider"] { flex: 1; }
|
|
67
|
+
[part~="thumb"] { width: 16px; height: 16px; margin: -8px 0 0 -8px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }
|
|
68
|
+
[part~="buffered"] { position: absolute; top: 0; right: 0; bottom: 0; left: 0; }
|
|
69
|
+
[part~="buffered-range"] { position: absolute; top: 0; bottom: 0; background: rgba(255, 255, 255, 0.3); }
|
|
70
|
+
[part~="hover"] { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--mbx-text); }
|
|
71
|
+
[part~="edge"] { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--mbx-live); }
|
|
72
|
+
[part~="preview"] {
|
|
73
|
+
position: absolute;
|
|
74
|
+
bottom: 100%;
|
|
75
|
+
margin-bottom: 4px;
|
|
76
|
+
transform: translateX(-50%);
|
|
77
|
+
display: flex;
|
|
78
|
+
flex-direction: column;
|
|
79
|
+
align-items: center;
|
|
80
|
+
gap: 2px;
|
|
81
|
+
padding: 2px;
|
|
82
|
+
background: var(--mbx-surface);
|
|
83
|
+
border-radius: var(--mbx-radius);
|
|
84
|
+
font-size: 13px;
|
|
85
|
+
font-variant-numeric: tabular-nums;
|
|
86
|
+
white-space: nowrap;
|
|
87
|
+
pointer-events: none;
|
|
88
|
+
}
|
|
89
|
+
[part~="preview-image"] { position: relative; overflow: hidden; border-radius: 2px; }
|
|
90
|
+
[part~="preview-tile"] { position: absolute; top: 0; left: 0; transform-origin: top left; background-repeat: no-repeat; }
|
|
91
|
+
[part~="preview-time"] { padding: 0 4px; }
|
|
92
|
+
[part~="preview-title"] { max-width: 240px; padding: 0 4px; overflow: hidden; text-overflow: ellipsis; }
|
|
93
|
+
[hidden] { display: none; }
|
|
94
|
+
`;
|
|
95
|
+
function percent(part) {
|
|
96
|
+
return `${part * 100}%`;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* A mask that cuts a gap at each boundary between chapters, as stops along
|
|
100
|
+
* the track: opaque up to a boundary, clear for the gap, opaque after.
|
|
101
|
+
*/
|
|
102
|
+
function gaps(list, span) {
|
|
103
|
+
const stops = ['#000 0'];
|
|
104
|
+
for (const chapter of list.slice(1)) {
|
|
105
|
+
const at = percent(fraction(chapter.start, span));
|
|
106
|
+
const before = `calc(${at} - ${GAP / 2}px)`;
|
|
107
|
+
const after = `calc(${at} + ${GAP / 2}px)`;
|
|
108
|
+
stops.push(`#000 ${before}`, `transparent ${before}`, `transparent ${after}`, `#000 ${after}`);
|
|
109
|
+
}
|
|
110
|
+
stops.push('#000 100%');
|
|
111
|
+
return `linear-gradient(to right, ${stops.join(', ')})`;
|
|
112
|
+
}
|
|
113
|
+
export class MbxSeekBar extends Component {
|
|
114
|
+
static get observedAttributes() {
|
|
115
|
+
return ['label', 'label-of', 'label-behind', 'live-window', 'chapters'];
|
|
116
|
+
}
|
|
117
|
+
constructor() {
|
|
118
|
+
super();
|
|
119
|
+
this.range = EMPTY;
|
|
120
|
+
this.pending = null;
|
|
121
|
+
this.frame = 0;
|
|
122
|
+
this.divided = '';
|
|
123
|
+
this.list = [];
|
|
124
|
+
const root = this.attachShadow({ mode: 'open' });
|
|
125
|
+
this.bar = slider({
|
|
126
|
+
step: () => number(this, 'step', STEP),
|
|
127
|
+
page: () => number(this, 'page', PAGE),
|
|
128
|
+
onInput: (value) => {
|
|
129
|
+
this.input(value);
|
|
130
|
+
},
|
|
131
|
+
onDrag: (on) => {
|
|
132
|
+
this.toggleAttribute('dragging', on);
|
|
133
|
+
},
|
|
134
|
+
});
|
|
135
|
+
this.buffered = el('div', 'buffered');
|
|
136
|
+
this.hover = el('div', 'hover');
|
|
137
|
+
this.edge = el('div', 'edge');
|
|
138
|
+
this.hover.hidden = true;
|
|
139
|
+
this.edge.hidden = true;
|
|
140
|
+
// Under the fill, so what is played reads over what is buffered.
|
|
141
|
+
this.bar.track.prepend(this.buffered);
|
|
142
|
+
this.bar.track.append(this.hover, this.edge);
|
|
143
|
+
this.preview = el('div', 'preview');
|
|
144
|
+
this.image = el('div', 'preview-image');
|
|
145
|
+
this.tile = el('div', 'preview-tile');
|
|
146
|
+
this.time = el('span', 'preview-time');
|
|
147
|
+
this.caption = el('span', 'preview-title');
|
|
148
|
+
this.caption.hidden = true;
|
|
149
|
+
this.image.append(this.tile);
|
|
150
|
+
this.image.hidden = true;
|
|
151
|
+
this.preview.append(this.image, this.caption, this.time);
|
|
152
|
+
this.preview.hidden = true;
|
|
153
|
+
this.bar.root.append(this.preview);
|
|
154
|
+
this.bar.root.addEventListener('pointermove', (event) => {
|
|
155
|
+
this.point(event);
|
|
156
|
+
});
|
|
157
|
+
this.bar.root.addEventListener('pointerleave', () => {
|
|
158
|
+
this.leave();
|
|
159
|
+
});
|
|
160
|
+
root.append(style(STYLE), this.bar.root);
|
|
161
|
+
}
|
|
162
|
+
connectedCallback() {
|
|
163
|
+
seekRow(this);
|
|
164
|
+
super.connectedCallback();
|
|
165
|
+
}
|
|
166
|
+
isLive() {
|
|
167
|
+
return live(this.player?.engine ?? null) !== undefined;
|
|
168
|
+
}
|
|
169
|
+
/** Whether the chapters divide the track and name the preview. */
|
|
170
|
+
chaptered() {
|
|
171
|
+
return this.getAttribute('chapters') !== 'none' && this.list.length > 0;
|
|
172
|
+
}
|
|
173
|
+
/** The gaps at the chapter boundaries, on every layer of the track at once. */
|
|
174
|
+
paintChapters() {
|
|
175
|
+
const mask = this.chaptered() && this.list.length > 1 ? gaps(this.list, this.range) : '';
|
|
176
|
+
const key = `${mask}|${this.range.start}|${this.range.end}`;
|
|
177
|
+
if (key === this.divided)
|
|
178
|
+
return;
|
|
179
|
+
this.divided = key;
|
|
180
|
+
const track = this.bar.track.style;
|
|
181
|
+
// Both spellings: WebKit before 15.4 knows only the prefixed one.
|
|
182
|
+
track.setProperty('mask-image', mask === '' ? '' : mask);
|
|
183
|
+
track.setProperty('-webkit-mask-image', mask === '' ? '' : mask);
|
|
184
|
+
}
|
|
185
|
+
/** What a screen reader hears at a time. */
|
|
186
|
+
say(time) {
|
|
187
|
+
const engine = this.player?.engine ?? null;
|
|
188
|
+
if (!this.isLive()) {
|
|
189
|
+
const template = this.getAttribute('label-of') ?? '{current} of {duration}';
|
|
190
|
+
return Number.isFinite(this.range.end) && this.range.end > 0
|
|
191
|
+
? fill(template, { current: format(time), duration: format(this.range.end) })
|
|
192
|
+
: format(time);
|
|
193
|
+
}
|
|
194
|
+
const behind = fill(this.getAttribute('label-behind') ?? '{time} behind live', {
|
|
195
|
+
time: format(this.range.end - time),
|
|
196
|
+
});
|
|
197
|
+
const clock = wall(engine, time);
|
|
198
|
+
return clock === null ? behind : `${clock}, ${behind}`;
|
|
199
|
+
}
|
|
200
|
+
/** What the preview shows at a time. */
|
|
201
|
+
label(time) {
|
|
202
|
+
if (!this.isLive())
|
|
203
|
+
return format(time);
|
|
204
|
+
return wall(this.player?.engine ?? null, time) ?? `-${format(this.range.end - time)}`;
|
|
205
|
+
}
|
|
206
|
+
input(value) {
|
|
207
|
+
const video = this.player?.video;
|
|
208
|
+
if (video === undefined)
|
|
209
|
+
return;
|
|
210
|
+
this.bar.set(value, this.say(value));
|
|
211
|
+
if (!this.bar.dragging()) {
|
|
212
|
+
// The release, or a key: written now, and it supersedes whatever a
|
|
213
|
+
// frame queued during the drag was about to write.
|
|
214
|
+
this.pending = null;
|
|
215
|
+
video.currentTime = value;
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
this.pending = value;
|
|
219
|
+
if (this.frame === 0) {
|
|
220
|
+
this.frame = requestAnimationFrame(() => {
|
|
221
|
+
this.flush();
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
flush() {
|
|
226
|
+
this.frame = 0;
|
|
227
|
+
const video = this.player?.video;
|
|
228
|
+
if (this.pending === null || video === undefined)
|
|
229
|
+
return;
|
|
230
|
+
video.currentTime = this.pending;
|
|
231
|
+
this.pending = null;
|
|
232
|
+
}
|
|
233
|
+
/** The width the page asked for through the token, or the default. */
|
|
234
|
+
previewWidth() {
|
|
235
|
+
const set = Number.parseFloat(getComputedStyle(this.preview).getPropertyValue('--mbx-preview-width'));
|
|
236
|
+
return Number.isFinite(set) && set > 0 ? set : PREVIEW_WIDTH;
|
|
237
|
+
}
|
|
238
|
+
/** The tile for a time, if the track has one, drawn at its size and scaled to fit. */
|
|
239
|
+
paintTile(when) {
|
|
240
|
+
const found = optional(this.player?.engine ?? null).thumbnails?.at(when) ?? null;
|
|
241
|
+
this.image.hidden = found === null;
|
|
242
|
+
if (found === null)
|
|
243
|
+
return;
|
|
244
|
+
const scale = this.previewWidth() / found.width;
|
|
245
|
+
this.image.style.width = `${found.width * scale}px`;
|
|
246
|
+
this.image.style.height = `${found.height * scale}px`;
|
|
247
|
+
this.tile.style.width = `${found.width}px`;
|
|
248
|
+
this.tile.style.height = `${found.height}px`;
|
|
249
|
+
this.tile.style.backgroundImage = `url("${found.url}")`;
|
|
250
|
+
this.tile.style.backgroundPosition = `-${found.x}px -${found.y}px`;
|
|
251
|
+
this.tile.style.transform = `scale(${scale})`;
|
|
252
|
+
}
|
|
253
|
+
paintBuffered(video) {
|
|
254
|
+
const parts = clip(Array.from({ length: video.buffered.length }, (_, i) => ({
|
|
255
|
+
start: video.buffered.start(i),
|
|
256
|
+
end: video.buffered.end(i),
|
|
257
|
+
})), this.range);
|
|
258
|
+
const buffered = this.buffered;
|
|
259
|
+
while (buffered.childElementCount > parts.length)
|
|
260
|
+
buffered.lastElementChild?.remove();
|
|
261
|
+
while (buffered.childElementCount < parts.length)
|
|
262
|
+
buffered.append(el('div', 'buffered-range'));
|
|
263
|
+
let i = 0;
|
|
264
|
+
for (const child of buffered.children) {
|
|
265
|
+
const part = parts[i];
|
|
266
|
+
i += 1;
|
|
267
|
+
if (part === undefined)
|
|
268
|
+
break;
|
|
269
|
+
const node = child;
|
|
270
|
+
node.style.left = percent(part[0]);
|
|
271
|
+
node.style.width = percent(part[1] - part[0]);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
/** Whether a live window is wide enough to be worth a bar. */
|
|
275
|
+
worthSeeking() {
|
|
276
|
+
const goals = number(this, 'live-window', LIVE_WINDOW);
|
|
277
|
+
if (goals === 0)
|
|
278
|
+
return true;
|
|
279
|
+
const goal = bufferGoal(this.player?.engine ?? null) ?? BUFFER_GOAL;
|
|
280
|
+
return this.range.end - this.range.start >= goals * goal;
|
|
281
|
+
}
|
|
282
|
+
/** The hover marker and the preview follow the pointer, clamped to the bar. */
|
|
283
|
+
point(event) {
|
|
284
|
+
const rect = this.bar.rail.getBoundingClientRect();
|
|
285
|
+
if (rect.width === 0 || this.range.end <= this.range.start)
|
|
286
|
+
return;
|
|
287
|
+
const part = Math.min(1, Math.max(0, (event.clientX - rect.left) / rect.width));
|
|
288
|
+
this.hover.hidden = false;
|
|
289
|
+
this.hover.style.left = percent(part);
|
|
290
|
+
this.preview.hidden = false;
|
|
291
|
+
const when = at(part, this.range);
|
|
292
|
+
this.time.textContent = this.label(when);
|
|
293
|
+
const chapter = this.chaptered() ? this.list[chapterAt(this.list, when)] : undefined;
|
|
294
|
+
this.caption.hidden = chapter === undefined || chapter.title === '';
|
|
295
|
+
this.caption.textContent = chapter?.title ?? '';
|
|
296
|
+
this.paintTile(when);
|
|
297
|
+
const whole = this.bar.root.getBoundingClientRect();
|
|
298
|
+
const half = this.preview.offsetWidth / 2;
|
|
299
|
+
const x = rect.left - whole.left + part * rect.width;
|
|
300
|
+
this.preview.style.left = `${Math.min(whole.width - half, Math.max(half, x))}px`;
|
|
301
|
+
}
|
|
302
|
+
leave() {
|
|
303
|
+
this.hover.hidden = true;
|
|
304
|
+
this.preview.hidden = true;
|
|
305
|
+
}
|
|
306
|
+
attach(player) {
|
|
307
|
+
const tick = () => {
|
|
308
|
+
this.render();
|
|
309
|
+
};
|
|
310
|
+
this.listen(player.video, EVENTS, tick);
|
|
311
|
+
this.keep(followChapters(player.video, tick));
|
|
312
|
+
this.listen(player, ['sourcechange'], () => {
|
|
313
|
+
this.leave();
|
|
314
|
+
this.render();
|
|
315
|
+
});
|
|
316
|
+
this.render();
|
|
317
|
+
}
|
|
318
|
+
detach(player) {
|
|
319
|
+
cancelAnimationFrame(this.frame);
|
|
320
|
+
this.frame = 0;
|
|
321
|
+
this.pending = null;
|
|
322
|
+
this.leave();
|
|
323
|
+
player.removeAttribute('live');
|
|
324
|
+
player.removeAttribute('seekable');
|
|
325
|
+
}
|
|
326
|
+
render() {
|
|
327
|
+
const player = this.player;
|
|
328
|
+
if (player === null)
|
|
329
|
+
return;
|
|
330
|
+
const video = player.video;
|
|
331
|
+
const engine = player.engine;
|
|
332
|
+
const api = live(engine);
|
|
333
|
+
const on = api !== undefined;
|
|
334
|
+
this.range = span(video, engine);
|
|
335
|
+
this.list = chapters(video);
|
|
336
|
+
this.bar.label(this.getAttribute('label') ?? 'Seek');
|
|
337
|
+
this.bar.range(this.range.start, this.range.end);
|
|
338
|
+
this.paintBuffered(video);
|
|
339
|
+
this.paintChapters();
|
|
340
|
+
this.edge.hidden = !on;
|
|
341
|
+
if (api !== undefined && api.edge !== null) {
|
|
342
|
+
this.edge.style.left = percent(fraction(api.edge, this.range));
|
|
343
|
+
}
|
|
344
|
+
const seekable = !on || this.worthSeeking();
|
|
345
|
+
this.hidden = !seekable;
|
|
346
|
+
player.toggleAttribute('live', on);
|
|
347
|
+
player.toggleAttribute('seekable', seekable);
|
|
348
|
+
if (!this.bar.dragging())
|
|
349
|
+
this.bar.set(video.currentTime, this.say(video.currentTime));
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
//# sourceMappingURL=seek-bar.js.map
|