@theoplayer/web-ui 1.7.2 → 1.8.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ---
2
+ description: Find out what's new in Open Video UI for Web.
3
+ sidebar_custom_props: { 'icon': '📰' }
4
+ ---
5
+
1
6
  # Changelog
2
7
 
3
8
  > **Tags:**
@@ -10,6 +15,15 @@
10
15
  > - 🏠 Internal
11
16
  > - 💅 Polish
12
17
 
18
+ ## v1.8.1 (2024-04-18)
19
+
20
+ - 🐛 Fixed `ui.player.destroy()` not working. ([#59](https://github.com/THEOplayer/web-ui/issues/59), [#62](https://github.com/THEOplayer/web-ui/pull/62))
21
+
22
+ ## v1.8.0 (2024-04-12)
23
+
24
+ - 💥 **Breaking Change**: This project now requires THEOplayer version 7.0.0 or higher. ([#60](https://github.com/THEOplayer/web-ui/pull/60))
25
+ - 🚀 Added `<theolive-default-ui>` that provides a default UI for THEOlive streams. ([#58](https://github.com/THEOplayer/web-ui/pull/58))
26
+
13
27
  ## v1.7.2 (2024-03-18)
14
28
 
15
29
  - 🚀 Added `<theoplayer-slot-container>`. ([#55](https://github.com/THEOplayer/web-ui/pull/55))
package/README.md CHANGED
@@ -18,7 +18,7 @@ the [THEOplayer Web SDK](https://www.theoplayer.com/product/theoplayer).
18
18
 
19
19
  ## Motivation
20
20
 
21
- The current THEOplayer Web SDK comes with a built-in UI based on [video.js](https://github.com/videojs/video.js) through [the `Player` constructor](https://docs.theoplayer.com/api-reference/web/theoplayer.player.md). This new UI aims to solve some limitations from the old approach:
21
+ The current THEOplayer Web SDK comes with a built-in UI based on [video.js](https://github.com/videojs/video.js) through [the `Player` constructor](https://www.theoplayer.com/docs/theoplayer/v6/api-reference/web/classes/Player.html). This new UI aims to solve some limitations from the old approach:
22
22
 
23
23
  - Designed with customization in mind. With the old UI, customizing anything beyond changing some text and icon colors was difficult, and could break in unpredictable ways when updating to a new THEOplayer version. With the new UI, all components can be customized in a variety of ways with well-documented attributes and CSS custom properties.
24
24
  - Built for the modern web. The old UI was built at a time when Internet Explorer was still a major browser, so it couldn't use newer web technologies. The new UI breaks with the past and takes full advantage of Web Components, so it works well in modern web apps.
@@ -102,7 +102,7 @@ The current THEOplayer Web SDK comes with a built-in UI based on [video.js](http
102
102
  ui.player.addEventListener('playing', () => console.log('THEOplayer is now playing'));
103
103
  ```
104
104
 
105
- See [docs/examples/default-ui.html](https://github.com/THEOplayer/web-ui/blob/main/docs/examples/default-ui.html) for a complete example.
105
+ See [default-ui/demo.html](https://github.com/THEOplayer/web-ui/blob/main/docs/static/open-video-ui/v1/examples/web/default-ui/demo.html) for a complete example.
106
106
 
107
107
  ### Custom UI
108
108
 
@@ -125,9 +125,9 @@ If you want to fully customize your video player layout, you can use a `<theopla
125
125
  </theoplayer-ui>
126
126
  ```
127
127
 
128
- See [docs/examples/custom-ui.html](https://github.com/THEOplayer/web-ui/blob/main/docs/examples/custom-ui.html) for a complete example.
128
+ See [custom-ui/demo.html](https://github.com/THEOplayer/web-ui/blob/main/docs/static/open-video-ui/v1/examples/web/custom-ui/demo.html) for a complete example.
129
129
 
130
- # Legacy browser support
130
+ ### Legacy browser support
131
131
 
132
132
  By default, Open Video UI for Web targets modern browsers that support modern JavaScript syntax (such as [async/await](https://caniuse.com/async-functions)) and native [Custom Elements](https://caniuse.com/custom-elementsv1). This keeps the download size small, so your viewers can spend less time waiting for your page to load and start watching their video faster.
133
133
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * THEOplayer Open Video UI for Web (v1.7.2)
2
+ * THEOplayer Open Video UI for Web (v1.8.1)
3
3
  * License: MIT
4
4
  */
5
5
  import { ChromelessPlayer, VideoQuality, THEOplayerError, MediaTrack, TextTrack, TextTracksList, EdgeStyle, VendorCast, CastState, PlayerConfiguration, SourceDescription } from 'theoplayer/chromeless';
@@ -777,6 +777,7 @@ declare class TextTrackStyleRadioGroup extends TextTrackStyleRadioGroup_base {
777
777
  private readonly _radioGroup;
778
778
  private readonly _optionsSlot;
779
779
  private _player;
780
+ private _textTrackStyle;
780
781
  private _value;
781
782
  constructor();
782
783
  connectedCallback(): void;
@@ -821,6 +822,7 @@ declare class TextTrackStyleDisplay extends TextTrackStyleDisplay_base {
821
822
  static get observedAttributes(): Attribute[];
822
823
  private readonly _spanEl;
823
824
  private _player;
825
+ private _textTrackStyle;
824
826
  constructor();
825
827
  connectedCallback(): void;
826
828
  protected _upgradeProperty(prop: keyof this): void;
@@ -866,6 +868,8 @@ declare const LanguageMenu_base: typeof MenuGroup & Constructor<StateReceiverEle
866
868
  */
867
869
  declare class LanguageMenu extends LanguageMenu_base {
868
870
  private _player;
871
+ private _audioTrackList;
872
+ private _textTrackList;
869
873
  static get observedAttributes(): Attribute[];
870
874
  constructor();
871
875
  get player(): ChromelessPlayer | undefined;
@@ -891,6 +895,8 @@ declare const LanguageMenuButton_base: typeof MenuButton & Constructor<StateRece
891
895
  */
892
896
  declare class LanguageMenuButton extends LanguageMenuButton_base {
893
897
  private _player;
898
+ private _audioTrackList;
899
+ private _textTrackList;
894
900
  constructor();
895
901
  connectedCallback(): void;
896
902
  get player(): ChromelessPlayer | undefined;
@@ -1071,6 +1077,7 @@ declare const QualityRadioGroup_base: {
1071
1077
  declare class QualityRadioGroup extends QualityRadioGroup_base {
1072
1078
  private readonly _radioGroup;
1073
1079
  private _player;
1080
+ private _videoTracks;
1074
1081
  private _track;
1075
1082
  constructor();
1076
1083
  protected _upgradeProperty(prop: keyof this): void;
@@ -1277,6 +1284,7 @@ declare class PreviewThumbnail extends PreviewThumbnail_base {
1277
1284
  private readonly _canvasContext;
1278
1285
  private readonly _thumbnailImageSource;
1279
1286
  private _player;
1287
+ private _textTrackList;
1280
1288
  private _previewTime;
1281
1289
  private _thumbnailTextTrack;
1282
1290
  private _lastLoadedThumbnailUrl;
@@ -1349,6 +1357,7 @@ declare class TimeRange extends TimeRange_base {
1349
1357
  private readonly _previewRailEl;
1350
1358
  private readonly _previewBoxEl;
1351
1359
  private _player;
1360
+ private _ads;
1352
1361
  private _pausedWhileScrubbing;
1353
1362
  private _autoAdvanceId;
1354
1363
  private _lastUpdateTime;
@@ -1495,6 +1504,7 @@ declare const ChromecastDisplay_base: {
1495
1504
  declare class ChromecastDisplay extends ChromecastDisplay_base {
1496
1505
  private readonly _receiverNameEl;
1497
1506
  private _player;
1507
+ private _castApi;
1498
1508
  constructor();
1499
1509
  protected _upgradeProperty(prop: keyof this): void;
1500
1510
  connectedCallback(): void;
@@ -1570,6 +1580,7 @@ declare const GestureReceiver_base: {
1570
1580
  */
1571
1581
  declare class GestureReceiver extends GestureReceiver_base {
1572
1582
  private _player;
1583
+ private _playerElement;
1573
1584
  private _pointerType;
1574
1585
  constructor();
1575
1586
  protected _upgradeProperty(prop: keyof this): void;
@@ -1660,6 +1671,7 @@ declare const AdDisplay_base: {
1660
1671
  declare class AdDisplay extends AdDisplay_base {
1661
1672
  private readonly _spanEl;
1662
1673
  private _player;
1674
+ private _ads;
1663
1675
  constructor();
1664
1676
  protected _upgradeProperty(prop: keyof this): void;
1665
1677
  connectedCallback(): void;
@@ -1685,6 +1697,7 @@ declare const AdCountdown_base: {
1685
1697
  declare class AdCountdown extends AdCountdown_base {
1686
1698
  private readonly _spanEl;
1687
1699
  private _player;
1700
+ private _ads;
1688
1701
  constructor();
1689
1702
  protected _upgradeProperty(prop: keyof this): void;
1690
1703
  connectedCallback(): void;
@@ -1707,6 +1720,7 @@ declare const AdClickThroughButton_base: typeof LinkButton & Constructor<StateRe
1707
1720
  */
1708
1721
  declare class AdClickThroughButton extends AdClickThroughButton_base {
1709
1722
  private _player;
1723
+ private _ads;
1710
1724
  static get observedAttributes(): Attribute[];
1711
1725
  constructor();
1712
1726
  connectedCallback(): void;
@@ -1735,6 +1749,7 @@ declare class AdSkipButton extends AdSkipButton_base {
1735
1749
  private readonly _countdownEl;
1736
1750
  private readonly _skipEl;
1737
1751
  private _player;
1752
+ private _ads;
1738
1753
  static get observedAttributes(): Attribute[];
1739
1754
  constructor();
1740
1755
  connectedCallback(): void;
@@ -1759,173 +1774,6 @@ declare enum ExtensionSlot {
1759
1774
 
1760
1775
  declare const READY_EVENT: "theoplayerready";
1761
1776
 
1762
- /**
1763
- * `<theoplayer-default-ui>` - A default UI for THEOplayer.
1764
- *
1765
- * This default UI provides a great player experience out-of-the-box, that works well on all types of devices
1766
- * and for all types of streams. It provides all the common playback controls for playing, seeking,
1767
- * changing languages and qualities. It also supports advertisements and casting.
1768
- *
1769
- * ## Usage
1770
- *
1771
- * 1. Create a `<theoplayer-default-ui>` element.
1772
- * 2. Set its `configuration` attribute or property to a valid player configuration.
1773
- * 3. Set its `source` attribute or property to a valid stream source.
1774
- * 4. Optionally, customize the player using CSS custom properties and/or extra controls.
1775
- *
1776
- * ## Customization
1777
- *
1778
- * The styling can be controlled using CSS custom properties (see {@link UIContainer | `<theoplayer-ui>`}).
1779
- * Additional controls can be added to the `top-control-bar` and `bottom-control-bar` slots.
1780
- * For more extensive customizations, we recommend defining your own custom UI using
1781
- * a {@link UIContainer | `<theoplayer-ui>`}.
1782
- *
1783
- * @attribute `configuration` - The THEOplayer {@link theoplayer!PlayerConfiguration | PlayerConfiguration}, as a JSON string.
1784
- * @attribute `source` - The THEOplayer {@link theoplayer!SourceDescription | SourceDescription}, as a JSON string.
1785
- * @attribute `fluid` - If set, the player automatically adjusts its height to fit the video's aspect ratio.
1786
- * @attribute `muted` - If set, the player starts out as muted. Reflects `ui.player.muted`.
1787
- * @attribute `autoplay` - If set, the player attempts to automatically start playing (if allowed).
1788
- * @attribute `device-type` - The device type, either "desktop", "mobile" or "tv".
1789
- * Can be used in CSS to show/hide certain device-specific UI controls.
1790
- * @attribute `mobile` - Whether the user is on a mobile device. Equivalent to `device-type == "mobile"`.
1791
- * @attribute `tv` - Whether the user is on a TV device. Equivalent to `device-type == "tv"`.
1792
- * @attribute `stream-type` - The stream type, either "vod", "live" or "dvr".
1793
- * Can be used to show/hide certain UI controls specific for livestreams, such as
1794
- * a {@link LiveButton | `<theoplayer-live-button>`}.
1795
- * If you know in advance that the source will be a livestream, you can set this attribute to avoid a screen flicker
1796
- * when the player switches between its VOD-specific and live-only controls.
1797
- * @attribute `user-idle-timeout` - The timeout (in seconds) between when the user stops interacting with the UI,
1798
- * and when the user is considered to be "idle".
1799
- * @attribute `dvr-threshold` - The minimum length (in seconds) of a livestream's sliding window for the stream to be DVR
1800
- * and its stream type to be set to "dvr".
1801
- *
1802
- * @slot `title` - A slot for the stream's title in the top control bar.
1803
- * @slot `top-control-bar` - A slot for extra UI controls in the top control bar.
1804
- * @slot `bottom-control-bar` - A slot for extra UI controls in the bottom control bar.
1805
- * @slot `menu` - A slot for extra menus (see {@link Menu | `<theoplayer-menu>`}).
1806
- * @group Components
1807
- */
1808
- declare class DefaultUI extends HTMLElement {
1809
- /**
1810
- * Fired when the backing player is created, and the {@link DefaultUI.player} property is set.
1811
- *
1812
- * @group Events
1813
- */
1814
- static READY_EVENT: typeof READY_EVENT;
1815
- static get observedAttributes(): Attribute[];
1816
- private readonly _ui;
1817
- private readonly _titleSlot;
1818
- private readonly _timeRange;
1819
- private _appliedExtensions;
1820
- /**
1821
- * Creates a new THEOplayer default UI.
1822
- *
1823
- * @param configuration - The player configuration.
1824
- * Will be passed to the {@link theoplayer!ChromelessPlayer | ChromelessPlayer} constructor to create
1825
- * the underlying THEOplayer instance.
1826
- * Can also be set later on through the {@link configuration} property.
1827
- */
1828
- constructor(configuration?: PlayerConfiguration);
1829
- private _upgradeProperty;
1830
- /**
1831
- * The underlying THEOplayer player instance.
1832
- *
1833
- * This is constructed automatically as soon as a valid {@link configuration} is set.
1834
- */
1835
- get player(): ChromelessPlayer | undefined;
1836
- /**
1837
- * The player configuration.
1838
- *
1839
- * Used to create the underlying THEOplayer instance.
1840
- */
1841
- get configuration(): PlayerConfiguration;
1842
- set configuration(configuration: PlayerConfiguration);
1843
- private setConfiguration_;
1844
- /**
1845
- * The player's current source.
1846
- */
1847
- get source(): SourceDescription | undefined;
1848
- set source(value: SourceDescription | undefined);
1849
- /**
1850
- * Whether to automatically adjusts the player's height to fit the video's aspect ratio.
1851
- */
1852
- get fluid(): boolean;
1853
- set fluid(value: boolean);
1854
- /**
1855
- * Whether the player's audio is muted.
1856
- */
1857
- get muted(): boolean;
1858
- set muted(value: boolean);
1859
- /**
1860
- * Whether the player should attempt to automatically start playback.
1861
- */
1862
- get autoplay(): boolean;
1863
- set autoplay(value: boolean);
1864
- /**
1865
- * The stream type, either "vod", "live" or "dvr".
1866
- *
1867
- * If you know in advance that the source will be a livestream, you can set this property to avoid a screen flicker
1868
- * when the player switches between its VOD-specific and live-only controls.
1869
- */
1870
- get streamType(): StreamType;
1871
- set streamType(value: StreamType);
1872
- /**
1873
- * The timeout (in seconds) between when the user stops interacting with the UI,
1874
- * and when the user is considered to be "idle".
1875
- */
1876
- get userIdleTimeout(): number;
1877
- set userIdleTimeout(value: number);
1878
- /**
1879
- * The minimum length (in seconds) of a livestream's sliding window for the stream to be DVR
1880
- * and its stream type to be set to "dvr".
1881
- */
1882
- get dvrThreshold(): number;
1883
- set dvrThreshold(value: number);
1884
- connectedCallback(): void;
1885
- disconnectedCallback(): void;
1886
- attributeChangedCallback(attrName: string, oldValue: any, newValue: any): void;
1887
- private readonly _updateStreamType;
1888
- private readonly _dispatchReadyEvent;
1889
- private readonly _onTitleSlotChange;
1890
- }
1891
- declare global {
1892
- interface HTMLElementTagNameMap {
1893
- 'theoplayer-default-ui': DefaultUI;
1894
- }
1895
- }
1896
-
1897
- /**
1898
- * An extension for the default UI.
1899
- *
1900
- * This is called whenever a `<theoplayer-default-ui>` element is created.
1901
- * The extension can then choose to modify this element, for example by appending extra elements
1902
- * or attaching extra event listeners.
1903
- *
1904
- * @example
1905
- * The following extension adds an extra button to the bottom control bar of every default UI:
1906
- * ```javascript
1907
- * THEOplayerUI.registerExtension((ui) => {
1908
- * // Create a new button
1909
- * const button = new THEOplayerUI.Button();
1910
- * button.innerHTML = "Click me!";
1911
- * button.addEventListener("click", () => alert("I was clicked!"));
1912
- * // Place it in the bottom control bar
1913
- * button.slot = "bottom-control-bar";
1914
- * ui.appendChild(button);
1915
- * });
1916
- * ```
1917
- * See the documentation of `<theoplayer-default-ui>` for more information about the available slots
1918
- * in which you can add extra elements.
1919
- */
1920
- type Extension = (ui: DefaultUI) => void;
1921
- /**
1922
- * Registers an extension for the default UI.
1923
- *
1924
- * @param extension The extension.
1925
- * @see {@link Extension}
1926
- */
1927
- declare function registerExtension(extension: Extension): void;
1928
-
1929
1777
  /**
1930
1778
  * `<theoplayer-ui>` - The container element for a THEOplayer UI.
1931
1779
  *
@@ -2112,6 +1960,7 @@ declare class UIContainer extends HTMLElement {
2112
1960
  private readonly registerStateReceiver_;
2113
1961
  private readonly unregisterStateReceiver_;
2114
1962
  private propagateStateToReceiver_;
1963
+ private propagatePlayerToAllReceivers_;
2115
1964
  private removeStateFromReceiver_;
2116
1965
  private openMenu_;
2117
1966
  private closeMenu_;
@@ -2152,6 +2001,9 @@ declare class UIContainer extends HTMLElement {
2152
2001
  private readonly _onChromeSlotTransition;
2153
2002
  private readonly _updateTextTrackMargins;
2154
2003
  private readonly _onPreviewTimeChange;
2004
+ private addPlayerListeners_;
2005
+ private removePlayerListeners_;
2006
+ private readonly _onDestroy;
2155
2007
  }
2156
2008
  declare global {
2157
2009
  interface HTMLElementTagNameMap {
@@ -2159,10 +2011,225 @@ declare global {
2159
2011
  }
2160
2012
  }
2161
2013
 
2014
+ /**
2015
+ * `<theoplayer-default-ui>` - A default UI for THEOplayer.
2016
+ *
2017
+ * This default UI provides a great player experience out-of-the-box, that works well on all types of devices
2018
+ * and for all types of streams. It provides all the common playback controls for playing, seeking,
2019
+ * changing languages and qualities. It also supports advertisements and casting.
2020
+ *
2021
+ * ## Usage
2022
+ *
2023
+ * 1. Create a `<theoplayer-default-ui>` element.
2024
+ * 2. Set its `configuration` attribute or property to a valid player configuration.
2025
+ * 3. Set its `source` attribute or property to a valid stream source.
2026
+ * 4. Optionally, customize the player using CSS custom properties and/or extra controls.
2027
+ *
2028
+ * ## Customization
2029
+ *
2030
+ * The styling can be controlled using CSS custom properties (see {@link UIContainer | `<theoplayer-ui>`}).
2031
+ * Additional controls can be added to the `top-control-bar` and `bottom-control-bar` slots.
2032
+ * For more extensive customizations, we recommend defining your own custom UI using
2033
+ * a {@link UIContainer | `<theoplayer-ui>`}.
2034
+ *
2035
+ * @attribute `configuration` - The THEOplayer {@link theoplayer!PlayerConfiguration | PlayerConfiguration}, as a JSON string.
2036
+ * @attribute `source` - The THEOplayer {@link theoplayer!SourceDescription | SourceDescription}, as a JSON string.
2037
+ * @attribute `fluid` - If set, the player automatically adjusts its height to fit the video's aspect ratio.
2038
+ * @attribute `muted` - If set, the player starts out as muted. Reflects `ui.player.muted`.
2039
+ * @attribute `autoplay` - If set, the player attempts to automatically start playing (if allowed).
2040
+ * @attribute `device-type` - The device type, either "desktop", "mobile" or "tv".
2041
+ * Can be used in CSS to show/hide certain device-specific UI controls.
2042
+ * @attribute `mobile` - Whether the user is on a mobile device. Equivalent to `device-type == "mobile"`.
2043
+ * @attribute `tv` - Whether the user is on a TV device. Equivalent to `device-type == "tv"`.
2044
+ * @attribute `stream-type` - The stream type, either "vod", "live" or "dvr".
2045
+ * Can be used to show/hide certain UI controls specific for livestreams, such as
2046
+ * a {@link LiveButton | `<theoplayer-live-button>`}.
2047
+ * If you know in advance that the source will be a livestream, you can set this attribute to avoid a screen flicker
2048
+ * when the player switches between its VOD-specific and live-only controls.
2049
+ * @attribute `user-idle-timeout` - The timeout (in seconds) between when the user stops interacting with the UI,
2050
+ * and when the user is considered to be "idle".
2051
+ * @attribute `dvr-threshold` - The minimum length (in seconds) of a livestream's sliding window for the stream to be DVR
2052
+ * and its stream type to be set to "dvr".
2053
+ *
2054
+ * @slot `title` - A slot for the stream's title in the top control bar.
2055
+ * @slot `top-control-bar` - A slot for extra UI controls in the top control bar.
2056
+ * @slot `bottom-control-bar` - A slot for extra UI controls in the bottom control bar.
2057
+ * @slot `menu` - A slot for extra menus (see {@link Menu | `<theoplayer-menu>`}).
2058
+ * @group Components
2059
+ */
2060
+ declare class DefaultUI extends HTMLElement {
2061
+ /**
2062
+ * Fired when the backing player is created, and the {@link DefaultUI.player} property is set.
2063
+ *
2064
+ * @group Events
2065
+ */
2066
+ static READY_EVENT: typeof READY_EVENT;
2067
+ static get observedAttributes(): Attribute[];
2068
+ protected readonly _shadowRoot: ShadowRoot;
2069
+ protected readonly _ui: UIContainer;
2070
+ private readonly _titleSlot;
2071
+ private readonly _timeRange;
2072
+ private _appliedExtensions;
2073
+ /**
2074
+ * Creates a new THEOplayer default UI.
2075
+ *
2076
+ * @param configuration - The player configuration.
2077
+ * Will be passed to the {@link theoplayer!ChromelessPlayer | ChromelessPlayer} constructor to create
2078
+ * the underlying THEOplayer instance.
2079
+ * Can also be set later on through the {@link configuration} property.
2080
+ */
2081
+ constructor(configuration?: PlayerConfiguration);
2082
+ protected initShadowRoot(): ShadowRoot;
2083
+ private _upgradeProperty;
2084
+ /**
2085
+ * The underlying THEOplayer player instance.
2086
+ *
2087
+ * This is constructed automatically as soon as a valid {@link configuration} is set.
2088
+ */
2089
+ get player(): ChromelessPlayer | undefined;
2090
+ /**
2091
+ * The player configuration.
2092
+ *
2093
+ * Used to create the underlying THEOplayer instance.
2094
+ */
2095
+ get configuration(): PlayerConfiguration;
2096
+ set configuration(configuration: PlayerConfiguration);
2097
+ private setConfiguration_;
2098
+ /**
2099
+ * The player's current source.
2100
+ */
2101
+ get source(): SourceDescription | undefined;
2102
+ set source(value: SourceDescription | undefined);
2103
+ /**
2104
+ * Whether to automatically adjusts the player's height to fit the video's aspect ratio.
2105
+ */
2106
+ get fluid(): boolean;
2107
+ set fluid(value: boolean);
2108
+ /**
2109
+ * Whether the player's audio is muted.
2110
+ */
2111
+ get muted(): boolean;
2112
+ set muted(value: boolean);
2113
+ /**
2114
+ * Whether the player should attempt to automatically start playback.
2115
+ */
2116
+ get autoplay(): boolean;
2117
+ set autoplay(value: boolean);
2118
+ /**
2119
+ * The stream type, either "vod", "live" or "dvr".
2120
+ *
2121
+ * If you know in advance that the source will be a livestream, you can set this property to avoid a screen flicker
2122
+ * when the player switches between its VOD-specific and live-only controls.
2123
+ */
2124
+ get streamType(): StreamType;
2125
+ set streamType(value: StreamType);
2126
+ /**
2127
+ * The timeout (in seconds) between when the user stops interacting with the UI,
2128
+ * and when the user is considered to be "idle".
2129
+ */
2130
+ get userIdleTimeout(): number;
2131
+ set userIdleTimeout(value: number);
2132
+ /**
2133
+ * The minimum length (in seconds) of a livestream's sliding window for the stream to be DVR
2134
+ * and its stream type to be set to "dvr".
2135
+ */
2136
+ get dvrThreshold(): number;
2137
+ set dvrThreshold(value: number);
2138
+ connectedCallback(): void;
2139
+ disconnectedCallback(): void;
2140
+ attributeChangedCallback(attrName: string, oldValue: any, newValue: any): void;
2141
+ private readonly _updateStreamType;
2142
+ private readonly _dispatchReadyEvent;
2143
+ private readonly _onTitleSlotChange;
2144
+ }
2145
+ declare global {
2146
+ interface HTMLElementTagNameMap {
2147
+ 'theoplayer-default-ui': DefaultUI;
2148
+ }
2149
+ }
2150
+
2151
+ /**
2152
+ * An extension for the default UI.
2153
+ *
2154
+ * This is called whenever a `<theoplayer-default-ui>` element is created.
2155
+ * The extension can then choose to modify this element, for example by appending extra elements
2156
+ * or attaching extra event listeners.
2157
+ *
2158
+ * @example
2159
+ * The following extension adds an extra button to the bottom control bar of every default UI:
2160
+ * ```javascript
2161
+ * THEOplayerUI.registerExtension((ui) => {
2162
+ * // Create a new button
2163
+ * const button = new THEOplayerUI.Button();
2164
+ * button.innerHTML = "Click me!";
2165
+ * button.addEventListener("click", () => alert("I was clicked!"));
2166
+ * // Place it in the bottom control bar
2167
+ * button.slot = "bottom-control-bar";
2168
+ * ui.appendChild(button);
2169
+ * });
2170
+ * ```
2171
+ * See the documentation of `<theoplayer-default-ui>` for more information about the available slots
2172
+ * in which you can add extra elements.
2173
+ */
2174
+ type Extension = (ui: DefaultUI) => void;
2175
+ /**
2176
+ * Registers an extension for the default UI.
2177
+ *
2178
+ * @param extension The extension.
2179
+ * @see {@link Extension}
2180
+ */
2181
+ declare function registerExtension(extension: Extension): void;
2182
+
2183
+ declare class BadNetworkModeMenu extends HTMLElement {
2184
+ private readonly _radioGroup;
2185
+ constructor();
2186
+ protected _upgradeProperty(prop: keyof this): void;
2187
+ connectedCallback(): void;
2188
+ disconnectedCallback(): void;
2189
+ private readonly _onChange;
2190
+ }
2191
+ declare global {
2192
+ interface HTMLElementTagNameMap {
2193
+ 'theolive-bad-network-menu': BadNetworkModeMenu;
2194
+ }
2195
+ }
2196
+
2197
+ /**
2198
+ * `<theolive-default-ui>` - A default UI for THEOlive.
2199
+ *
2200
+ * @group Components
2201
+ */
2202
+ declare class THEOliveDefaultUI extends DefaultUI {
2203
+ private readonly _loading;
2204
+ private readonly _offline;
2205
+ private readonly _announcement;
2206
+ private readonly _errorDisplay;
2207
+ private readonly _playButton;
2208
+ private readonly _root;
2209
+ constructor(configuration?: PlayerConfiguration);
2210
+ protected initShadowRoot(): ShadowRoot;
2211
+ private readonly onReady;
2212
+ private onLoadChannelStart;
2213
+ private onChannelOffline;
2214
+ private onChannelLoaded;
2215
+ private onError;
2216
+ private hidePlayerError;
2217
+ private stopHidingPlayerError;
2218
+ private hidePlayerPlayButton_;
2219
+ private stopHidingPlayerPlayButton;
2220
+ private showMessage_;
2221
+ private hideMessage_;
2222
+ }
2223
+ declare global {
2224
+ interface HTMLElementTagNameMap {
2225
+ 'theolive-default-ui': THEOliveDefaultUI;
2226
+ }
2227
+ }
2228
+
2162
2229
  /**
2163
2230
  * The version of Open Video UI for Web.
2164
2231
  */
2165
2232
  declare const version: string;
2166
2233
 
2167
- export { ActiveQualityDisplay, AdClickThroughButton, AdCountdown, AdDisplay, AdSkipButton, AirPlayButton, Attribute, Button, ButtonOptions, CastButton, ChromecastButton, ChromecastDisplay, CloseMenuButton, ColorStops, Constructor, ControlBar, DefaultUI, DeviceType, DurationDisplay, ErrorDisplay, Extension, ExtensionSlot, FullscreenButton, GestureReceiver, LanguageMenu, LanguageMenuButton, LinkButton, LiveButton, LoadingIndicator, MediaTrackRadioButton, Menu, MenuButton, MenuGroup, MenuGroupOptions, MenuOptions, MuteButton, PlayButton, PlaybackRateDisplay, PlaybackRateMenu, PlaybackRateMenuButton, PlaybackRateRadioGroup, PreviewThumbnail, PreviewTimeDisplay, QualityRadioButton, QualityRadioGroup, RadioButton, RadioGroup, Range, RangeOptions, SeekButton, SettingsMenu, SettingsMenuButton, SlotContainer, StateReceiverElement, StateReceiverMixin, StateReceiverPropertyMap, StreamType, TextTrackOffRadioButton, TextTrackRadioButton, TextTrackStyleDisplay, TextTrackStyleMap, TextTrackStyleMenu, TextTrackStyleOption, TextTrackStyleRadioGroup, TextTrackStyleResetButton, TimeDisplay, TimeRange, TrackRadioGroup, TrackType, UIContainer, VolumeLevel, VolumeRange, buttonTemplate, linkButtonTemplate, menuGroupTemplate, menuTemplate, rangeTemplate, registerExtension, version };
2234
+ export { ActiveQualityDisplay, AdClickThroughButton, AdCountdown, AdDisplay, AdSkipButton, AirPlayButton, Attribute, Button, ButtonOptions, CastButton, ChromecastButton, ChromecastDisplay, CloseMenuButton, ColorStops, Constructor, ControlBar, DefaultUI, DeviceType, DurationDisplay, ErrorDisplay, Extension, ExtensionSlot, FullscreenButton, GestureReceiver, LanguageMenu, LanguageMenuButton, LinkButton, LiveButton, LoadingIndicator, MediaTrackRadioButton, Menu, MenuButton, MenuGroup, MenuGroupOptions, MenuOptions, MuteButton, PlayButton, PlaybackRateDisplay, PlaybackRateMenu, PlaybackRateMenuButton, PlaybackRateRadioGroup, PreviewThumbnail, PreviewTimeDisplay, QualityRadioButton, QualityRadioGroup, RadioButton, RadioGroup, Range, RangeOptions, SeekButton, SettingsMenu, SettingsMenuButton, SlotContainer, StateReceiverElement, StateReceiverMixin, StateReceiverPropertyMap, StreamType, THEOliveDefaultUI, TextTrackOffRadioButton, TextTrackRadioButton, TextTrackStyleDisplay, TextTrackStyleMap, TextTrackStyleMenu, TextTrackStyleOption, TextTrackStyleRadioGroup, TextTrackStyleResetButton, TimeDisplay, TimeRange, TrackRadioGroup, TrackType, UIContainer, VolumeLevel, VolumeRange, buttonTemplate, linkButtonTemplate, menuGroupTemplate, menuTemplate, rangeTemplate, registerExtension, version };
2168
2235
  export as namespace THEOplayerUI;