@theoplayer/web-ui 1.7.1 → 1.8.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/CHANGELOG.md +14 -0
- package/README.md +7 -5
- package/dist/THEOplayerUI.d.ts +241 -169
- package/dist/THEOplayerUI.es5.js +2 -2
- package/dist/THEOplayerUI.es5.mjs +2 -2
- package/dist/THEOplayerUI.js +26 -20
- package/dist/THEOplayerUI.js.map +1 -1
- package/dist/THEOplayerUI.mjs +26 -20
- package/dist/THEOplayerUI.mjs.map +1 -1
- package/dist/THEOplayerUI.node.mjs +18 -17
- package/dist/THEOplayerUI.node.mjs.map +1 -1
- package/package.json +3 -3
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.0 (2024-04-12)
|
|
19
|
+
|
|
20
|
+
- 💥 **Breaking Change**: This project now requires THEOplayer version 7.0.0 or higher. ([#60](https://github.com/THEOplayer/web-ui/pull/60))
|
|
21
|
+
- 🚀 Added `<theolive-default-ui>` that provides a default UI for THEOlive streams. ([#58](https://github.com/THEOplayer/web-ui/pull/58))
|
|
22
|
+
|
|
23
|
+
## v1.7.2 (2024-03-18)
|
|
24
|
+
|
|
25
|
+
- 🚀 Added `<theoplayer-slot-container>`. ([#55](https://github.com/THEOplayer/web-ui/pull/55))
|
|
26
|
+
|
|
13
27
|
## v1.7.1 (2024-02-15)
|
|
14
28
|
|
|
15
29
|
- 💅 Export `version` in public API. ([#53](https://github.com/THEOplayer/web-ui/pull/53))
|
package/README.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# THEOplayer Open Video UI for Web
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/@theoplayer/web-ui)
|
|
4
|
+
[](https://github.com/THEOplayer/web-ui/actions/workflows/ci.yml)
|
|
5
|
+
[](https://theoplayer.github.io/web-ui/api/)
|
|
6
|
+
[](https://github.com/THEOplayer/web-ui/issues)
|
|
7
|
+
|
|
3
8
|
A component library for building a world-class video player experience powered by
|
|
4
9
|
the [THEOplayer Web SDK](https://www.theoplayer.com/product/theoplayer).
|
|
5
10
|
|
|
@@ -7,16 +12,13 @@ the [THEOplayer Web SDK](https://www.theoplayer.com/product/theoplayer).
|
|
|
7
12
|
- Built using [Web Components](https://developer.mozilla.org/en-US/docs/Web/Web_Components), so works great with (or without) any app framework.
|
|
8
13
|
- Easy to customize: use HTML to lay out your controls, and CSS to style them.
|
|
9
14
|
|
|
10
|
-
> [!NOTE]
|
|
11
|
-
> This project is under active development. While we believe it's ready for use in production, not all features are available in this first release. If you find a problem or have an idea for a new feature, don't hesitate to [open an issue](https://github.com/THEOplayer/web-ui/issues)!
|
|
12
|
-
|
|
13
15
|
|  |  |
|
|
14
16
|
| :---------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------: |
|
|
15
17
|
| Desktop | Mobile |
|
|
16
18
|
|
|
17
19
|
## Motivation
|
|
18
20
|
|
|
19
|
-
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://
|
|
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:
|
|
20
22
|
|
|
21
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.
|
|
22
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.
|
|
@@ -125,7 +127,7 @@ If you want to fully customize your video player layout, you can use a `<theopla
|
|
|
125
127
|
|
|
126
128
|
See [docs/examples/custom-ui.html](https://github.com/THEOplayer/web-ui/blob/main/docs/examples/custom-ui.html) for a complete example.
|
|
127
129
|
|
|
128
|
-
|
|
130
|
+
### Legacy browser support
|
|
129
131
|
|
|
130
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.
|
|
131
133
|
|
package/dist/THEOplayerUI.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* THEOplayer Open Video UI for Web (v1.
|
|
2
|
+
* THEOplayer Open Video UI for Web (v1.8.0)
|
|
3
3
|
* License: MIT
|
|
4
4
|
*/
|
|
5
5
|
import { ChromelessPlayer, VideoQuality, THEOplayerError, MediaTrack, TextTrack, TextTracksList, EdgeStyle, VendorCast, CastState, PlayerConfiguration, SourceDescription } from 'theoplayer/chromeless';
|
|
@@ -1623,6 +1623,30 @@ declare global {
|
|
|
1623
1623
|
}
|
|
1624
1624
|
}
|
|
1625
1625
|
|
|
1626
|
+
/**
|
|
1627
|
+
* `<theoplayer-slot-container>` - A container that can be assigned to a slot,
|
|
1628
|
+
* and behaves as if all its children are directly assigned to that slot.
|
|
1629
|
+
*
|
|
1630
|
+
* This behaves approximately like a regular `<div>` with style `display: contents`,
|
|
1631
|
+
* but receives some special treatment from e.g. {@link MenuGroup | `<theoplayer-menu-group>`}
|
|
1632
|
+
* which normally expects its {@link Menu | menu}s to be slotted in as direct children.
|
|
1633
|
+
* Those menus can also be children of a `<theoplayer-slot-container>` instead.
|
|
1634
|
+
*
|
|
1635
|
+
* This is an internal component, used mainly by Open Video UI for React.
|
|
1636
|
+
* You shouldn't need this under normal circumstances.
|
|
1637
|
+
*
|
|
1638
|
+
* @group Components
|
|
1639
|
+
* @internal
|
|
1640
|
+
*/
|
|
1641
|
+
declare class SlotContainer extends HTMLElement {
|
|
1642
|
+
constructor();
|
|
1643
|
+
}
|
|
1644
|
+
declare global {
|
|
1645
|
+
interface HTMLElementTagNameMap {
|
|
1646
|
+
'theoplayer-slot-container': SlotContainer;
|
|
1647
|
+
}
|
|
1648
|
+
}
|
|
1649
|
+
|
|
1626
1650
|
declare const AdDisplay_base: {
|
|
1627
1651
|
new (): HTMLElement;
|
|
1628
1652
|
prototype: HTMLElement;
|
|
@@ -1735,173 +1759,6 @@ declare enum ExtensionSlot {
|
|
|
1735
1759
|
|
|
1736
1760
|
declare const READY_EVENT: "theoplayerready";
|
|
1737
1761
|
|
|
1738
|
-
/**
|
|
1739
|
-
* `<theoplayer-default-ui>` - A default UI for THEOplayer.
|
|
1740
|
-
*
|
|
1741
|
-
* This default UI provides a great player experience out-of-the-box, that works well on all types of devices
|
|
1742
|
-
* and for all types of streams. It provides all the common playback controls for playing, seeking,
|
|
1743
|
-
* changing languages and qualities. It also supports advertisements and casting.
|
|
1744
|
-
*
|
|
1745
|
-
* ## Usage
|
|
1746
|
-
*
|
|
1747
|
-
* 1. Create a `<theoplayer-default-ui>` element.
|
|
1748
|
-
* 2. Set its `configuration` attribute or property to a valid player configuration.
|
|
1749
|
-
* 3. Set its `source` attribute or property to a valid stream source.
|
|
1750
|
-
* 4. Optionally, customize the player using CSS custom properties and/or extra controls.
|
|
1751
|
-
*
|
|
1752
|
-
* ## Customization
|
|
1753
|
-
*
|
|
1754
|
-
* The styling can be controlled using CSS custom properties (see {@link UIContainer | `<theoplayer-ui>`}).
|
|
1755
|
-
* Additional controls can be added to the `top-control-bar` and `bottom-control-bar` slots.
|
|
1756
|
-
* For more extensive customizations, we recommend defining your own custom UI using
|
|
1757
|
-
* a {@link UIContainer | `<theoplayer-ui>`}.
|
|
1758
|
-
*
|
|
1759
|
-
* @attribute `configuration` - The THEOplayer {@link theoplayer!PlayerConfiguration | PlayerConfiguration}, as a JSON string.
|
|
1760
|
-
* @attribute `source` - The THEOplayer {@link theoplayer!SourceDescription | SourceDescription}, as a JSON string.
|
|
1761
|
-
* @attribute `fluid` - If set, the player automatically adjusts its height to fit the video's aspect ratio.
|
|
1762
|
-
* @attribute `muted` - If set, the player starts out as muted. Reflects `ui.player.muted`.
|
|
1763
|
-
* @attribute `autoplay` - If set, the player attempts to automatically start playing (if allowed).
|
|
1764
|
-
* @attribute `device-type` - The device type, either "desktop", "mobile" or "tv".
|
|
1765
|
-
* Can be used in CSS to show/hide certain device-specific UI controls.
|
|
1766
|
-
* @attribute `mobile` - Whether the user is on a mobile device. Equivalent to `device-type == "mobile"`.
|
|
1767
|
-
* @attribute `tv` - Whether the user is on a TV device. Equivalent to `device-type == "tv"`.
|
|
1768
|
-
* @attribute `stream-type` - The stream type, either "vod", "live" or "dvr".
|
|
1769
|
-
* Can be used to show/hide certain UI controls specific for livestreams, such as
|
|
1770
|
-
* a {@link LiveButton | `<theoplayer-live-button>`}.
|
|
1771
|
-
* If you know in advance that the source will be a livestream, you can set this attribute to avoid a screen flicker
|
|
1772
|
-
* when the player switches between its VOD-specific and live-only controls.
|
|
1773
|
-
* @attribute `user-idle-timeout` - The timeout (in seconds) between when the user stops interacting with the UI,
|
|
1774
|
-
* and when the user is considered to be "idle".
|
|
1775
|
-
* @attribute `dvr-threshold` - The minimum length (in seconds) of a livestream's sliding window for the stream to be DVR
|
|
1776
|
-
* and its stream type to be set to "dvr".
|
|
1777
|
-
*
|
|
1778
|
-
* @slot `title` - A slot for the stream's title in the top control bar.
|
|
1779
|
-
* @slot `top-control-bar` - A slot for extra UI controls in the top control bar.
|
|
1780
|
-
* @slot `bottom-control-bar` - A slot for extra UI controls in the bottom control bar.
|
|
1781
|
-
* @slot `menu` - A slot for extra menus (see {@link Menu | `<theoplayer-menu>`}).
|
|
1782
|
-
* @group Components
|
|
1783
|
-
*/
|
|
1784
|
-
declare class DefaultUI extends HTMLElement {
|
|
1785
|
-
/**
|
|
1786
|
-
* Fired when the backing player is created, and the {@link DefaultUI.player} property is set.
|
|
1787
|
-
*
|
|
1788
|
-
* @group Events
|
|
1789
|
-
*/
|
|
1790
|
-
static READY_EVENT: typeof READY_EVENT;
|
|
1791
|
-
static get observedAttributes(): Attribute[];
|
|
1792
|
-
private readonly _ui;
|
|
1793
|
-
private readonly _titleSlot;
|
|
1794
|
-
private readonly _timeRange;
|
|
1795
|
-
private _appliedExtensions;
|
|
1796
|
-
/**
|
|
1797
|
-
* Creates a new THEOplayer default UI.
|
|
1798
|
-
*
|
|
1799
|
-
* @param configuration - The player configuration.
|
|
1800
|
-
* Will be passed to the {@link theoplayer!ChromelessPlayer | ChromelessPlayer} constructor to create
|
|
1801
|
-
* the underlying THEOplayer instance.
|
|
1802
|
-
* Can also be set later on through the {@link configuration} property.
|
|
1803
|
-
*/
|
|
1804
|
-
constructor(configuration?: PlayerConfiguration);
|
|
1805
|
-
private _upgradeProperty;
|
|
1806
|
-
/**
|
|
1807
|
-
* The underlying THEOplayer player instance.
|
|
1808
|
-
*
|
|
1809
|
-
* This is constructed automatically as soon as a valid {@link configuration} is set.
|
|
1810
|
-
*/
|
|
1811
|
-
get player(): ChromelessPlayer | undefined;
|
|
1812
|
-
/**
|
|
1813
|
-
* The player configuration.
|
|
1814
|
-
*
|
|
1815
|
-
* Used to create the underlying THEOplayer instance.
|
|
1816
|
-
*/
|
|
1817
|
-
get configuration(): PlayerConfiguration;
|
|
1818
|
-
set configuration(configuration: PlayerConfiguration);
|
|
1819
|
-
private setConfiguration_;
|
|
1820
|
-
/**
|
|
1821
|
-
* The player's current source.
|
|
1822
|
-
*/
|
|
1823
|
-
get source(): SourceDescription | undefined;
|
|
1824
|
-
set source(value: SourceDescription | undefined);
|
|
1825
|
-
/**
|
|
1826
|
-
* Whether to automatically adjusts the player's height to fit the video's aspect ratio.
|
|
1827
|
-
*/
|
|
1828
|
-
get fluid(): boolean;
|
|
1829
|
-
set fluid(value: boolean);
|
|
1830
|
-
/**
|
|
1831
|
-
* Whether the player's audio is muted.
|
|
1832
|
-
*/
|
|
1833
|
-
get muted(): boolean;
|
|
1834
|
-
set muted(value: boolean);
|
|
1835
|
-
/**
|
|
1836
|
-
* Whether the player should attempt to automatically start playback.
|
|
1837
|
-
*/
|
|
1838
|
-
get autoplay(): boolean;
|
|
1839
|
-
set autoplay(value: boolean);
|
|
1840
|
-
/**
|
|
1841
|
-
* The stream type, either "vod", "live" or "dvr".
|
|
1842
|
-
*
|
|
1843
|
-
* If you know in advance that the source will be a livestream, you can set this property to avoid a screen flicker
|
|
1844
|
-
* when the player switches between its VOD-specific and live-only controls.
|
|
1845
|
-
*/
|
|
1846
|
-
get streamType(): StreamType;
|
|
1847
|
-
set streamType(value: StreamType);
|
|
1848
|
-
/**
|
|
1849
|
-
* The timeout (in seconds) between when the user stops interacting with the UI,
|
|
1850
|
-
* and when the user is considered to be "idle".
|
|
1851
|
-
*/
|
|
1852
|
-
get userIdleTimeout(): number;
|
|
1853
|
-
set userIdleTimeout(value: number);
|
|
1854
|
-
/**
|
|
1855
|
-
* The minimum length (in seconds) of a livestream's sliding window for the stream to be DVR
|
|
1856
|
-
* and its stream type to be set to "dvr".
|
|
1857
|
-
*/
|
|
1858
|
-
get dvrThreshold(): number;
|
|
1859
|
-
set dvrThreshold(value: number);
|
|
1860
|
-
connectedCallback(): void;
|
|
1861
|
-
disconnectedCallback(): void;
|
|
1862
|
-
attributeChangedCallback(attrName: string, oldValue: any, newValue: any): void;
|
|
1863
|
-
private readonly _updateStreamType;
|
|
1864
|
-
private readonly _dispatchReadyEvent;
|
|
1865
|
-
private readonly _onTitleSlotChange;
|
|
1866
|
-
}
|
|
1867
|
-
declare global {
|
|
1868
|
-
interface HTMLElementTagNameMap {
|
|
1869
|
-
'theoplayer-default-ui': DefaultUI;
|
|
1870
|
-
}
|
|
1871
|
-
}
|
|
1872
|
-
|
|
1873
|
-
/**
|
|
1874
|
-
* An extension for the default UI.
|
|
1875
|
-
*
|
|
1876
|
-
* This is called whenever a `<theoplayer-default-ui>` element is created.
|
|
1877
|
-
* The extension can then choose to modify this element, for example by appending extra elements
|
|
1878
|
-
* or attaching extra event listeners.
|
|
1879
|
-
*
|
|
1880
|
-
* @example
|
|
1881
|
-
* The following extension adds an extra button to the bottom control bar of every default UI:
|
|
1882
|
-
* ```javascript
|
|
1883
|
-
* THEOplayerUI.registerExtension((ui) => {
|
|
1884
|
-
* // Create a new button
|
|
1885
|
-
* const button = new THEOplayerUI.Button();
|
|
1886
|
-
* button.innerHTML = "Click me!";
|
|
1887
|
-
* button.addEventListener("click", () => alert("I was clicked!"));
|
|
1888
|
-
* // Place it in the bottom control bar
|
|
1889
|
-
* button.slot = "bottom-control-bar";
|
|
1890
|
-
* ui.appendChild(button);
|
|
1891
|
-
* });
|
|
1892
|
-
* ```
|
|
1893
|
-
* See the documentation of `<theoplayer-default-ui>` for more information about the available slots
|
|
1894
|
-
* in which you can add extra elements.
|
|
1895
|
-
*/
|
|
1896
|
-
type Extension = (ui: DefaultUI) => void;
|
|
1897
|
-
/**
|
|
1898
|
-
* Registers an extension for the default UI.
|
|
1899
|
-
*
|
|
1900
|
-
* @param extension The extension.
|
|
1901
|
-
* @see {@link Extension}
|
|
1902
|
-
*/
|
|
1903
|
-
declare function registerExtension(extension: Extension): void;
|
|
1904
|
-
|
|
1905
1762
|
/**
|
|
1906
1763
|
* `<theoplayer-ui>` - The container element for a THEOplayer UI.
|
|
1907
1764
|
*
|
|
@@ -2135,10 +1992,225 @@ declare global {
|
|
|
2135
1992
|
}
|
|
2136
1993
|
}
|
|
2137
1994
|
|
|
1995
|
+
/**
|
|
1996
|
+
* `<theoplayer-default-ui>` - A default UI for THEOplayer.
|
|
1997
|
+
*
|
|
1998
|
+
* This default UI provides a great player experience out-of-the-box, that works well on all types of devices
|
|
1999
|
+
* and for all types of streams. It provides all the common playback controls for playing, seeking,
|
|
2000
|
+
* changing languages and qualities. It also supports advertisements and casting.
|
|
2001
|
+
*
|
|
2002
|
+
* ## Usage
|
|
2003
|
+
*
|
|
2004
|
+
* 1. Create a `<theoplayer-default-ui>` element.
|
|
2005
|
+
* 2. Set its `configuration` attribute or property to a valid player configuration.
|
|
2006
|
+
* 3. Set its `source` attribute or property to a valid stream source.
|
|
2007
|
+
* 4. Optionally, customize the player using CSS custom properties and/or extra controls.
|
|
2008
|
+
*
|
|
2009
|
+
* ## Customization
|
|
2010
|
+
*
|
|
2011
|
+
* The styling can be controlled using CSS custom properties (see {@link UIContainer | `<theoplayer-ui>`}).
|
|
2012
|
+
* Additional controls can be added to the `top-control-bar` and `bottom-control-bar` slots.
|
|
2013
|
+
* For more extensive customizations, we recommend defining your own custom UI using
|
|
2014
|
+
* a {@link UIContainer | `<theoplayer-ui>`}.
|
|
2015
|
+
*
|
|
2016
|
+
* @attribute `configuration` - The THEOplayer {@link theoplayer!PlayerConfiguration | PlayerConfiguration}, as a JSON string.
|
|
2017
|
+
* @attribute `source` - The THEOplayer {@link theoplayer!SourceDescription | SourceDescription}, as a JSON string.
|
|
2018
|
+
* @attribute `fluid` - If set, the player automatically adjusts its height to fit the video's aspect ratio.
|
|
2019
|
+
* @attribute `muted` - If set, the player starts out as muted. Reflects `ui.player.muted`.
|
|
2020
|
+
* @attribute `autoplay` - If set, the player attempts to automatically start playing (if allowed).
|
|
2021
|
+
* @attribute `device-type` - The device type, either "desktop", "mobile" or "tv".
|
|
2022
|
+
* Can be used in CSS to show/hide certain device-specific UI controls.
|
|
2023
|
+
* @attribute `mobile` - Whether the user is on a mobile device. Equivalent to `device-type == "mobile"`.
|
|
2024
|
+
* @attribute `tv` - Whether the user is on a TV device. Equivalent to `device-type == "tv"`.
|
|
2025
|
+
* @attribute `stream-type` - The stream type, either "vod", "live" or "dvr".
|
|
2026
|
+
* Can be used to show/hide certain UI controls specific for livestreams, such as
|
|
2027
|
+
* a {@link LiveButton | `<theoplayer-live-button>`}.
|
|
2028
|
+
* If you know in advance that the source will be a livestream, you can set this attribute to avoid a screen flicker
|
|
2029
|
+
* when the player switches between its VOD-specific and live-only controls.
|
|
2030
|
+
* @attribute `user-idle-timeout` - The timeout (in seconds) between when the user stops interacting with the UI,
|
|
2031
|
+
* and when the user is considered to be "idle".
|
|
2032
|
+
* @attribute `dvr-threshold` - The minimum length (in seconds) of a livestream's sliding window for the stream to be DVR
|
|
2033
|
+
* and its stream type to be set to "dvr".
|
|
2034
|
+
*
|
|
2035
|
+
* @slot `title` - A slot for the stream's title in the top control bar.
|
|
2036
|
+
* @slot `top-control-bar` - A slot for extra UI controls in the top control bar.
|
|
2037
|
+
* @slot `bottom-control-bar` - A slot for extra UI controls in the bottom control bar.
|
|
2038
|
+
* @slot `menu` - A slot for extra menus (see {@link Menu | `<theoplayer-menu>`}).
|
|
2039
|
+
* @group Components
|
|
2040
|
+
*/
|
|
2041
|
+
declare class DefaultUI extends HTMLElement {
|
|
2042
|
+
/**
|
|
2043
|
+
* Fired when the backing player is created, and the {@link DefaultUI.player} property is set.
|
|
2044
|
+
*
|
|
2045
|
+
* @group Events
|
|
2046
|
+
*/
|
|
2047
|
+
static READY_EVENT: typeof READY_EVENT;
|
|
2048
|
+
static get observedAttributes(): Attribute[];
|
|
2049
|
+
protected readonly _shadowRoot: ShadowRoot;
|
|
2050
|
+
protected readonly _ui: UIContainer;
|
|
2051
|
+
private readonly _titleSlot;
|
|
2052
|
+
private readonly _timeRange;
|
|
2053
|
+
private _appliedExtensions;
|
|
2054
|
+
/**
|
|
2055
|
+
* Creates a new THEOplayer default UI.
|
|
2056
|
+
*
|
|
2057
|
+
* @param configuration - The player configuration.
|
|
2058
|
+
* Will be passed to the {@link theoplayer!ChromelessPlayer | ChromelessPlayer} constructor to create
|
|
2059
|
+
* the underlying THEOplayer instance.
|
|
2060
|
+
* Can also be set later on through the {@link configuration} property.
|
|
2061
|
+
*/
|
|
2062
|
+
constructor(configuration?: PlayerConfiguration);
|
|
2063
|
+
protected initShadowRoot(): ShadowRoot;
|
|
2064
|
+
private _upgradeProperty;
|
|
2065
|
+
/**
|
|
2066
|
+
* The underlying THEOplayer player instance.
|
|
2067
|
+
*
|
|
2068
|
+
* This is constructed automatically as soon as a valid {@link configuration} is set.
|
|
2069
|
+
*/
|
|
2070
|
+
get player(): ChromelessPlayer | undefined;
|
|
2071
|
+
/**
|
|
2072
|
+
* The player configuration.
|
|
2073
|
+
*
|
|
2074
|
+
* Used to create the underlying THEOplayer instance.
|
|
2075
|
+
*/
|
|
2076
|
+
get configuration(): PlayerConfiguration;
|
|
2077
|
+
set configuration(configuration: PlayerConfiguration);
|
|
2078
|
+
private setConfiguration_;
|
|
2079
|
+
/**
|
|
2080
|
+
* The player's current source.
|
|
2081
|
+
*/
|
|
2082
|
+
get source(): SourceDescription | undefined;
|
|
2083
|
+
set source(value: SourceDescription | undefined);
|
|
2084
|
+
/**
|
|
2085
|
+
* Whether to automatically adjusts the player's height to fit the video's aspect ratio.
|
|
2086
|
+
*/
|
|
2087
|
+
get fluid(): boolean;
|
|
2088
|
+
set fluid(value: boolean);
|
|
2089
|
+
/**
|
|
2090
|
+
* Whether the player's audio is muted.
|
|
2091
|
+
*/
|
|
2092
|
+
get muted(): boolean;
|
|
2093
|
+
set muted(value: boolean);
|
|
2094
|
+
/**
|
|
2095
|
+
* Whether the player should attempt to automatically start playback.
|
|
2096
|
+
*/
|
|
2097
|
+
get autoplay(): boolean;
|
|
2098
|
+
set autoplay(value: boolean);
|
|
2099
|
+
/**
|
|
2100
|
+
* The stream type, either "vod", "live" or "dvr".
|
|
2101
|
+
*
|
|
2102
|
+
* If you know in advance that the source will be a livestream, you can set this property to avoid a screen flicker
|
|
2103
|
+
* when the player switches between its VOD-specific and live-only controls.
|
|
2104
|
+
*/
|
|
2105
|
+
get streamType(): StreamType;
|
|
2106
|
+
set streamType(value: StreamType);
|
|
2107
|
+
/**
|
|
2108
|
+
* The timeout (in seconds) between when the user stops interacting with the UI,
|
|
2109
|
+
* and when the user is considered to be "idle".
|
|
2110
|
+
*/
|
|
2111
|
+
get userIdleTimeout(): number;
|
|
2112
|
+
set userIdleTimeout(value: number);
|
|
2113
|
+
/**
|
|
2114
|
+
* The minimum length (in seconds) of a livestream's sliding window for the stream to be DVR
|
|
2115
|
+
* and its stream type to be set to "dvr".
|
|
2116
|
+
*/
|
|
2117
|
+
get dvrThreshold(): number;
|
|
2118
|
+
set dvrThreshold(value: number);
|
|
2119
|
+
connectedCallback(): void;
|
|
2120
|
+
disconnectedCallback(): void;
|
|
2121
|
+
attributeChangedCallback(attrName: string, oldValue: any, newValue: any): void;
|
|
2122
|
+
private readonly _updateStreamType;
|
|
2123
|
+
private readonly _dispatchReadyEvent;
|
|
2124
|
+
private readonly _onTitleSlotChange;
|
|
2125
|
+
}
|
|
2126
|
+
declare global {
|
|
2127
|
+
interface HTMLElementTagNameMap {
|
|
2128
|
+
'theoplayer-default-ui': DefaultUI;
|
|
2129
|
+
}
|
|
2130
|
+
}
|
|
2131
|
+
|
|
2132
|
+
/**
|
|
2133
|
+
* An extension for the default UI.
|
|
2134
|
+
*
|
|
2135
|
+
* This is called whenever a `<theoplayer-default-ui>` element is created.
|
|
2136
|
+
* The extension can then choose to modify this element, for example by appending extra elements
|
|
2137
|
+
* or attaching extra event listeners.
|
|
2138
|
+
*
|
|
2139
|
+
* @example
|
|
2140
|
+
* The following extension adds an extra button to the bottom control bar of every default UI:
|
|
2141
|
+
* ```javascript
|
|
2142
|
+
* THEOplayerUI.registerExtension((ui) => {
|
|
2143
|
+
* // Create a new button
|
|
2144
|
+
* const button = new THEOplayerUI.Button();
|
|
2145
|
+
* button.innerHTML = "Click me!";
|
|
2146
|
+
* button.addEventListener("click", () => alert("I was clicked!"));
|
|
2147
|
+
* // Place it in the bottom control bar
|
|
2148
|
+
* button.slot = "bottom-control-bar";
|
|
2149
|
+
* ui.appendChild(button);
|
|
2150
|
+
* });
|
|
2151
|
+
* ```
|
|
2152
|
+
* See the documentation of `<theoplayer-default-ui>` for more information about the available slots
|
|
2153
|
+
* in which you can add extra elements.
|
|
2154
|
+
*/
|
|
2155
|
+
type Extension = (ui: DefaultUI) => void;
|
|
2156
|
+
/**
|
|
2157
|
+
* Registers an extension for the default UI.
|
|
2158
|
+
*
|
|
2159
|
+
* @param extension The extension.
|
|
2160
|
+
* @see {@link Extension}
|
|
2161
|
+
*/
|
|
2162
|
+
declare function registerExtension(extension: Extension): void;
|
|
2163
|
+
|
|
2164
|
+
declare class BadNetworkModeMenu extends HTMLElement {
|
|
2165
|
+
private readonly _radioGroup;
|
|
2166
|
+
constructor();
|
|
2167
|
+
protected _upgradeProperty(prop: keyof this): void;
|
|
2168
|
+
connectedCallback(): void;
|
|
2169
|
+
disconnectedCallback(): void;
|
|
2170
|
+
private readonly _onChange;
|
|
2171
|
+
}
|
|
2172
|
+
declare global {
|
|
2173
|
+
interface HTMLElementTagNameMap {
|
|
2174
|
+
'theolive-bad-network-menu': BadNetworkModeMenu;
|
|
2175
|
+
}
|
|
2176
|
+
}
|
|
2177
|
+
|
|
2178
|
+
/**
|
|
2179
|
+
* `<theolive-default-ui>` - A default UI for THEOlive.
|
|
2180
|
+
*
|
|
2181
|
+
* @group Components
|
|
2182
|
+
*/
|
|
2183
|
+
declare class THEOliveDefaultUI extends DefaultUI {
|
|
2184
|
+
private readonly _loading;
|
|
2185
|
+
private readonly _offline;
|
|
2186
|
+
private readonly _announcement;
|
|
2187
|
+
private readonly _errorDisplay;
|
|
2188
|
+
private readonly _playButton;
|
|
2189
|
+
private readonly _root;
|
|
2190
|
+
constructor(configuration?: PlayerConfiguration);
|
|
2191
|
+
protected initShadowRoot(): ShadowRoot;
|
|
2192
|
+
private readonly onReady;
|
|
2193
|
+
private onLoadChannelStart;
|
|
2194
|
+
private onChannelOffline;
|
|
2195
|
+
private onChannelLoaded;
|
|
2196
|
+
private onError;
|
|
2197
|
+
private hidePlayerError;
|
|
2198
|
+
private stopHidingPlayerError;
|
|
2199
|
+
private hidePlayerPlayButton_;
|
|
2200
|
+
private stopHidingPlayerPlayButton;
|
|
2201
|
+
private showMessage_;
|
|
2202
|
+
private hideMessage_;
|
|
2203
|
+
}
|
|
2204
|
+
declare global {
|
|
2205
|
+
interface HTMLElementTagNameMap {
|
|
2206
|
+
'theolive-default-ui': THEOliveDefaultUI;
|
|
2207
|
+
}
|
|
2208
|
+
}
|
|
2209
|
+
|
|
2138
2210
|
/**
|
|
2139
2211
|
* The version of Open Video UI for Web.
|
|
2140
2212
|
*/
|
|
2141
2213
|
declare const version: string;
|
|
2142
2214
|
|
|
2143
|
-
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, 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 };
|
|
2215
|
+
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 };
|
|
2144
2216
|
export as namespace THEOplayerUI;
|