@theoplayer/web-ui 1.3.0 → 1.5.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 +37 -14
- package/dist/THEOplayerUI.d.ts +106 -57
- package/dist/THEOplayerUI.es5.js +2 -2
- package/dist/THEOplayerUI.es5.mjs +1 -1
- package/dist/THEOplayerUI.js +21 -21
- package/dist/THEOplayerUI.js.map +1 -1
- package/dist/THEOplayerUI.mjs +25 -8
- package/dist/THEOplayerUI.mjs.map +1 -1
- package/package.json +21 -19
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# THEOplayer
|
|
1
|
+
# THEOplayer Open Video UI for Web
|
|
2
2
|
|
|
3
3
|
A component library for building a world-class video player experience powered by
|
|
4
4
|
the [THEOplayer Web SDK](https://www.theoplayer.com/product/theoplayer).
|
|
@@ -20,10 +20,10 @@ The current THEOplayer Web SDK comes with a built-in UI based on [video.js](http
|
|
|
20
20
|
|
|
21
21
|
- 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
22
|
- 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.
|
|
23
|
-
- Developed in the open. Although the old UI is based on the open-source video.js library, any custom components bundled with THEOplayer remained closed-source. With the new UI, the source code of all components is publicly available. Advanced users can learn about the inner workings of each component, modify them, and even contribute their changes back to
|
|
23
|
+
- Developed in the open. Although the old UI is based on the open-source video.js library, any custom components bundled with THEOplayer remained closed-source. With the new UI, the source code of all components is publicly available. Advanced users can learn about the inner workings of each component, modify them, and even contribute their changes back to Open Video UI.
|
|
24
24
|
|
|
25
25
|
> **Note**
|
|
26
|
-
> THEOplayer
|
|
26
|
+
> THEOplayer Open Video UI for Web currently exists separately from the old THEOplayer UI. In the future, we hope to deprecate and remove the old UI, and ship this new UI as default UI for the THEOplayer Web SDK.
|
|
27
27
|
|
|
28
28
|
## Installation
|
|
29
29
|
|
|
@@ -35,22 +35,35 @@ The current THEOplayer Web SDK comes with a built-in UI based on [video.js](http
|
|
|
35
35
|
```sh
|
|
36
36
|
npm install theoplayer@npm:@theoplayer/basic-hls
|
|
37
37
|
```
|
|
38
|
-
2. Install the
|
|
38
|
+
2. Install the Open Video UI for Web.
|
|
39
39
|
```sh
|
|
40
40
|
npm install @theoplayer/web-ui
|
|
41
41
|
```
|
|
42
42
|
3. Add `@theoplayer/web-ui` to your app:
|
|
43
43
|
- Option 1: in your HTML.
|
|
44
44
|
```html
|
|
45
|
+
<script src="/path/to/node_modules/theoplayer/THEOplayer.chromeless.js"></script>
|
|
45
46
|
<script src="/path/to/node_modules/@theoplayer/web-ui/dist/THEOplayerUI.js"></script>
|
|
46
47
|
```
|
|
47
48
|
- Option 2: in your JavaScript.
|
|
48
49
|
```js
|
|
49
50
|
import { DefaultUI } from '@theoplayer/web-ui';
|
|
50
51
|
```
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
Open Video UI will import THEOplayer from `theoplayer/chromeless`.
|
|
53
|
+
If you're using a bundler such as Webpack or Rollup, this dependency should automatically get bundled with your web app.
|
|
54
|
+
Alternatively, you can use an [import map](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script/type/importmap) to let the browser resolve it:
|
|
55
|
+
```html
|
|
56
|
+
<script type="importmap">
|
|
57
|
+
{
|
|
58
|
+
"imports": {
|
|
59
|
+
"theoplayer/chromeless": "/path/to/node_modules/theoplayer/THEOplayer.chromeless.esm.js"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
</script>
|
|
63
|
+
<!-- Import maps polyfill for browsers without import maps support (e.g. Safari 16.3) -->
|
|
64
|
+
<script async src="https://ga.jspm.io/npm:es-module-shims@1.8.0/dist/es-module-shims.js" crossorigin="anonymous"></script>
|
|
65
|
+
<script type="module" src="/path/to/my_app.js"></script>
|
|
66
|
+
```
|
|
54
67
|
|
|
55
68
|
## Usage
|
|
56
69
|
|
|
@@ -114,23 +127,33 @@ See [docs/examples/custom-ui.html](https://github.com/THEOplayer/web-ui/blob/mai
|
|
|
114
127
|
|
|
115
128
|
# Legacy browser support
|
|
116
129
|
|
|
117
|
-
By default,
|
|
130
|
+
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.
|
|
118
131
|
|
|
119
|
-
On older browsers (such as Internet Explorer 11 and older smart TVs), you need to load a different version of the
|
|
132
|
+
On older browsers (such as Internet Explorer 11 and older smart TVs), you need to load a different version of the Open Video UI that uses older JavaScript syntax. You also need to load additional polyfills for missing features such as Promises or Custom Elements. We recommend [Polyfill.io](https://polyfill.io/) and [Web Components Polyfills](https://github.com/webcomponents/polyfills) for these.
|
|
120
133
|
|
|
121
|
-
- Option 1: in your HTML. This uses [differential serving](https://css-tricks.com/differential-serving/) so modern browsers will load the modern build (with `type="module"
|
|
134
|
+
- Option 1: in your HTML. This uses [differential serving](https://css-tricks.com/differential-serving/) so modern browsers will load the modern build (with `type="module"`), while legacy browsers will load the legacy build (with `nomodule`).
|
|
122
135
|
|
|
123
136
|
```html
|
|
124
|
-
<!--
|
|
137
|
+
<!-- Modern browsers -->
|
|
138
|
+
<script type="importmap">
|
|
139
|
+
{
|
|
140
|
+
"imports": {
|
|
141
|
+
"theoplayer/chromeless": "/path/to/node_modules/theoplayer/THEOplayer.chromeless.esm.js"
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
</script>
|
|
145
|
+
<!-- Import maps polyfill for browsers without import maps support (e.g. Safari 16.3) -->
|
|
146
|
+
<script async src="https://ga.jspm.io/npm:es-module-shims@1.8.0/dist/es-module-shims.js" crossorigin="anonymous"></script>
|
|
147
|
+
<script type="module" src="/path/to/node_modules/@theoplayer/web-ui/dist/THEOplayerUI.mjs"></script>
|
|
148
|
+
<!-- Legacy browsers -->
|
|
125
149
|
<script nomodule src="https://polyfill.io/v3/polyfill.min.js?features=es2015"></script>
|
|
126
150
|
<script nomodule src="https://unpkg.com/@webcomponents/webcomponentsjs@2.8.0/custom-elements-es5-adapter.js"></script>
|
|
127
151
|
<script nomodule src="https://unpkg.com/@webcomponents/webcomponentsjs@2.8.0/webcomponents-bundle.js"></script>
|
|
128
|
-
|
|
129
|
-
<script type="module" src="/path/to/node_modules/@theoplayer/web-ui/dist/THEOplayerUI.js"></script>
|
|
152
|
+
<script nomodule src="/path/to/node_modules/theoplayer/THEOplayer.chromeless.js"></script>
|
|
130
153
|
<script nomodule src="/path/to/node_modules/@theoplayer/web-ui/dist/THEOplayerUI.es5.js"></script>
|
|
131
154
|
```
|
|
132
155
|
|
|
133
|
-
- Option 2: in your JavaScript. This will load the legacy build on both modern and legacy browsers, which is suboptimal. Instead, we recommend configuring your bundler to produce a modern and legacy build of your entire web app, and to import the appropriate version of
|
|
156
|
+
- Option 2: in your JavaScript. This will load the legacy build on both modern and legacy browsers, which is suboptimal. Instead, we recommend configuring your bundler to produce a modern and legacy build of your entire web app, and to import the appropriate version of Open Video UI for each build flavor.
|
|
134
157
|
|
|
135
158
|
```js
|
|
136
159
|
import '@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js';
|