@theoplayer/web-ui 1.16.3 → 2.0.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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @theoplayer/web-ui
2
2
 
3
+ ## 2.0.0
4
+
5
+ ### 💥 Breaking Changes
6
+
7
+ - Open Video UI for Web is now built using [Lit](https://lit.dev/).
8
+ - All components now extend [`LitElement`](https://lit.dev/docs/api/LitElement/) and use [reactive rendering](https://lit.dev/docs/components/rendering/), making it much easier to build custom UI components. While existing custom UI components should mostly continue to work, we highly recommend updating them to use a `render()` method instead.
9
+ - For older browsers that don't support Custom Elements, we recommend loading our new polyfills library from `@theoplayer/web-ui/polyfills`.
10
+
11
+ ### ✨ Features
12
+
13
+ - Added settings menu to default UI.
14
+
3
15
  ## 1.16.3
4
16
 
5
17
  ### 🐛 Issues
package/README.md CHANGED
@@ -51,19 +51,22 @@ The current THEOplayer Web SDK comes with a built-in UI based on [video.js](http
51
51
  ```js
52
52
  import { DefaultUI } from '@theoplayer/web-ui';
53
53
  ```
54
- Open Video UI will import THEOplayer from `theoplayer/chromeless`.
55
- If you're using a bundler such as Webpack or Rollup, this dependency should automatically get bundled with your web app.
54
+ Open Video UI will import THEOplayer from `theoplayer/chromeless` and [Lit](https://lit.dev/) from `lit`.
55
+ If you're using a bundler such as Webpack or Rollup, these dependencies should automatically get bundled with your web app.
56
56
  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:
57
57
  ```html
58
58
  <script type="importmap">
59
59
  {
60
60
  "imports": {
61
- "theoplayer/chromeless": "/path/to/node_modules/theoplayer/THEOplayer.chromeless.esm.js"
61
+ "theoplayer/chromeless": "/path/to/node_modules/theoplayer/THEOplayer.chromeless.esm.js",
62
+ "lit": "/path/to/node_modules/lit/index.js",
63
+ "lit/decorators.js": "/path/to/node_modules/lit/decorators.js",
64
+ "lit/directives/": "/path/to/node_modules/lit/directives/"
62
65
  }
63
66
  }
64
67
  </script>
65
68
  <!-- Import maps polyfill for browsers without import maps support (e.g. Safari 16.3) -->
66
- <script async src="https://ga.jspm.io/npm:es-module-shims@1.8.0/dist/es-module-shims.js" crossorigin="anonymous"></script>
69
+ <script async src="https://ga.jspm.io/npm:es-module-shims@2.6.2/dist/es-module-shims.js" crossorigin="anonymous"></script>
67
70
  <script type="module" src="/path/to/my_app.js"></script>
68
71
  ```
69
72
 
@@ -131,34 +134,38 @@ See [custom-ui/demo.html](https://github.com/THEOplayer/web-ui/blob/main/docs/st
131
134
 
132
135
  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
136
 
134
- 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 [the Cloudflare mirror of Polyfill.io](https://cdnjs.cloudflare.com/polyfill/) and [Web Components Polyfills](https://github.com/webcomponents/polyfills) for these.
137
+ 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 `Promise`, `Symbol.iterator` or Custom Elements:
135
138
 
136
- - 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`).
139
+ - For ES2015 features like `Promise` and `Symbol.iterator`, we recommend [the Cloudflare mirror of Polyfill.io](https://cdnjs.cloudflare.com/polyfill/).
140
+ - For Custom Elements, we recommend loading our polyfill bundle from `@theoplayer/web-ui/polyfills`. Alternatively, you can load the [Web Components Polyfills](https://github.com/webcomponents/polyfills) along with [Lit's `polyfill-support` module](https://lit.dev/docs/v2/tools/requirements/#polyfills).
141
+
142
+ * 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`).
137
143
 
138
144
  ```html
139
145
  <!-- Modern browsers -->
140
146
  <script type="importmap">
141
147
  {
142
148
  "imports": {
143
- "theoplayer/chromeless": "/path/to/node_modules/theoplayer/THEOplayer.chromeless.esm.js"
149
+ "theoplayer/chromeless": "/path/to/node_modules/theoplayer/THEOplayer.chromeless.esm.js",
150
+ "lit": "/path/to/node_modules/lit/index.js",
151
+ "lit/decorators.js": "/path/to/node_modules/lit/decorators.js",
152
+ "lit/directives/": "/path/to/node_modules/lit/directives/"
144
153
  }
145
154
  }
146
155
  </script>
147
156
  <!-- Import maps polyfill for browsers without import maps support (e.g. Safari 16.3) -->
148
- <script async src="https://ga.jspm.io/npm:es-module-shims@1.8.0/dist/es-module-shims.js" crossorigin="anonymous"></script>
157
+ <script async src="https://ga.jspm.io/npm:es-module-shims@2.6.2/dist/es-module-shims.js" crossorigin="anonymous"></script>
149
158
  <script type="module" src="/path/to/node_modules/@theoplayer/web-ui/dist/THEOplayerUI.mjs"></script>
150
159
  <!-- Legacy browsers -->
151
- <script nomodule src="https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?features=es2015"></script>
152
- <script nomodule src="https://unpkg.com/@webcomponents/webcomponentsjs@2.8.0/custom-elements-es5-adapter.js"></script>
153
- <script nomodule src="https://unpkg.com/@webcomponents/webcomponentsjs@2.8.0/webcomponents-bundle.js"></script>
160
+ <script nomodule src="https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?features=es2015%2CglobalThis%2CReflect"></script>
154
161
  <script nomodule src="/path/to/node_modules/theoplayer/THEOplayer.chromeless.js"></script>
162
+ <script nomodule src="/path/to/node_modules/@theoplayer/web-ui/dist/THEOplayerUI.polyfills.js"></script>
155
163
  <script nomodule src="/path/to/node_modules/@theoplayer/web-ui/dist/THEOplayerUI.es5.js"></script>
156
164
  ```
157
165
 
158
- - 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.
166
+ * 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.
159
167
 
160
168
  ```js
161
- import '@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js';
162
- import '@webcomponents/webcomponentsjs/webcomponents-bundle.js';
169
+ import '@theoplayer/web-ui/polyfills';
163
170
  import { DefaultUI } from '@theoplayer/web-ui/es5'; // note the "/es5" suffix
164
171
  ```