@theoplayer/web-ui 1.8.1 → 1.8.2

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
@@ -15,6 +15,15 @@ sidebar_custom_props: { 'icon': '📰' }
15
15
  > - 🏠 Internal
16
16
  > - 💅 Polish
17
17
 
18
+ ## v1.8.2 (2024-08-29)
19
+
20
+ - 🐛 Fixed blank space below UI when using `<theoplayer-default-ui>`.
21
+ - 💅 Optimized performance of `<theoplayer-time-range>`. ([#70](https://github.com/THEOplayer/web-ui/issues/70))
22
+ - Optimized the `requestAnimationFrame` callback used to update the seekbar's progress
23
+ to avoid synchronous re-layouts as much as possible.
24
+ - When playing a long video, the seek bar no longer uses `requestAnimationFrame` at all to update its progress.
25
+ Instead, it updates using only less frequent `timeupdate` events.
26
+
18
27
  ## v1.8.1 (2024-04-18)
19
28
 
20
29
  - 🐛 Fixed `ui.player.destroy()` not working. ([#59](https://github.com/THEOplayer/web-ui/issues/59), [#62](https://github.com/THEOplayer/web-ui/pull/62))
package/README.md CHANGED
@@ -131,7 +131,7 @@ See [custom-ui/demo.html](https://github.com/THEOplayer/web-ui/blob/main/docs/st
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
 
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 [Polyfill.io](https://polyfill.io/) and [Web Components Polyfills](https://github.com/webcomponents/polyfills) for these.
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.
135
135
 
136
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`).
137
137
 
@@ -148,7 +148,7 @@ On older browsers (such as Internet Explorer 11 and older smart TVs), you need t
148
148
  <script async src="https://ga.jspm.io/npm:es-module-shims@1.8.0/dist/es-module-shims.js" crossorigin="anonymous"></script>
149
149
  <script type="module" src="/path/to/node_modules/@theoplayer/web-ui/dist/THEOplayerUI.mjs"></script>
150
150
  <!-- Legacy browsers -->
151
- <script nomodule src="https://polyfill.io/v3/polyfill.min.js?features=es2015"></script>
151
+ <script nomodule src="https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?features=es2015"></script>
152
152
  <script nomodule src="https://unpkg.com/@webcomponents/webcomponentsjs@2.8.0/custom-elements-es5-adapter.js"></script>
153
153
  <script nomodule src="https://unpkg.com/@webcomponents/webcomponentsjs@2.8.0/webcomponents-bundle.js"></script>
154
154
  <script nomodule src="/path/to/node_modules/theoplayer/THEOplayer.chromeless.js"></script>
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * THEOplayer Open Video UI for Web (v1.8.1)
2
+ * THEOplayer Open Video UI for Web (v1.8.2)
3
3
  * License: MIT
4
4
  */
5
5
  import { ChromelessPlayer, VideoQuality, THEOplayerError, MediaTrack, TextTrack, TextTracksList, EdgeStyle, VendorCast, CastState, PlayerConfiguration, SourceDescription } from 'theoplayer/chromeless';
@@ -1197,7 +1197,8 @@ declare abstract class Range extends Range_base {
1197
1197
  static get observedAttributes(): Attribute[];
1198
1198
  protected readonly _rangeEl: HTMLInputElement;
1199
1199
  protected readonly _pointerEl: HTMLElement;
1200
- private _lastRangeWidth;
1200
+ private _rangeWidth;
1201
+ private _thumbWidth;
1201
1202
  constructor(options: RangeOptions);
1202
1203
  protected _upgradeProperty(prop: keyof this): void;
1203
1204
  connectedCallback(): void;
@@ -1236,7 +1237,7 @@ declare abstract class Range extends Range_base {
1236
1237
  attributeChangedCallback(attrName: string, oldValue: any, newValue: any): void;
1237
1238
  private readonly _onInput;
1238
1239
  protected handleInput(): void;
1239
- protected update(): void;
1240
+ protected update(useCachedWidth?: boolean): void;
1240
1241
  /**
1241
1242
  * The value for the `aria-label` attribute of the `<input type="range">` element.
1242
1243
  */
@@ -1257,6 +1258,8 @@ declare abstract class Range extends Range_base {
1257
1258
  * Creating an array so progress-bar can insert the buffered bar.
1258
1259
  */
1259
1260
  protected getBarColors(): ColorStops;
1261
+ private updateCachedWidths_;
1262
+ protected getMinimumStepForVisibleChange_(): number;
1260
1263
  private readonly _updatePointerBar;
1261
1264
  protected updatePointer_(mousePercent: number, rangeRect: DOMRectReadOnly): void;
1262
1265
  private readonly _onKeyDown;
@@ -1371,7 +1374,7 @@ declare class TimeRange extends TimeRange_base {
1371
1374
  get streamType(): StreamType;
1372
1375
  set streamType(streamType: StreamType);
1373
1376
  private readonly _updateFromPlayer;
1374
- private readonly _updateDisabled;
1377
+ private updateDisabled_;
1375
1378
  protected getAriaLabel(): string;
1376
1379
  protected getAriaValueText(): string;
1377
1380
  attributeChangedCallback(attrName: string, oldValue: any, newValue: any): void;
@@ -1379,6 +1382,7 @@ declare class TimeRange extends TimeRange_base {
1379
1382
  private readonly _pauseOnScrubStart;
1380
1383
  private readonly _playOnScrubEnd;
1381
1384
  private shouldAutoAdvance_;
1385
+ private needToUpdateEveryFrame_;
1382
1386
  private readonly _toggleAutoAdvance;
1383
1387
  private readonly _autoAdvanceWhilePlaying;
1384
1388
  protected updatePointer_(mousePercent: number, rangeRect: DOMRectReadOnly): void;