@theoplayer/web-ui 1.8.0 → 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,19 @@ 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
+
27
+ ## v1.8.1 (2024-04-18)
28
+
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))
30
+
18
31
  ## v1.8.0 (2024-04-12)
19
32
 
20
33
  - 💥 **Breaking Change**: This project now requires THEOplayer version 7.0.0 or higher. ([#60](https://github.com/THEOplayer/web-ui/pull/60))
package/README.md CHANGED
@@ -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,13 +125,13 @@ 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
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
 
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.0)
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';
@@ -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;
@@ -1190,7 +1197,8 @@ declare abstract class Range extends Range_base {
1190
1197
  static get observedAttributes(): Attribute[];
1191
1198
  protected readonly _rangeEl: HTMLInputElement;
1192
1199
  protected readonly _pointerEl: HTMLElement;
1193
- private _lastRangeWidth;
1200
+ private _rangeWidth;
1201
+ private _thumbWidth;
1194
1202
  constructor(options: RangeOptions);
1195
1203
  protected _upgradeProperty(prop: keyof this): void;
1196
1204
  connectedCallback(): void;
@@ -1229,7 +1237,7 @@ declare abstract class Range extends Range_base {
1229
1237
  attributeChangedCallback(attrName: string, oldValue: any, newValue: any): void;
1230
1238
  private readonly _onInput;
1231
1239
  protected handleInput(): void;
1232
- protected update(): void;
1240
+ protected update(useCachedWidth?: boolean): void;
1233
1241
  /**
1234
1242
  * The value for the `aria-label` attribute of the `<input type="range">` element.
1235
1243
  */
@@ -1250,6 +1258,8 @@ declare abstract class Range extends Range_base {
1250
1258
  * Creating an array so progress-bar can insert the buffered bar.
1251
1259
  */
1252
1260
  protected getBarColors(): ColorStops;
1261
+ private updateCachedWidths_;
1262
+ protected getMinimumStepForVisibleChange_(): number;
1253
1263
  private readonly _updatePointerBar;
1254
1264
  protected updatePointer_(mousePercent: number, rangeRect: DOMRectReadOnly): void;
1255
1265
  private readonly _onKeyDown;
@@ -1277,6 +1287,7 @@ declare class PreviewThumbnail extends PreviewThumbnail_base {
1277
1287
  private readonly _canvasContext;
1278
1288
  private readonly _thumbnailImageSource;
1279
1289
  private _player;
1290
+ private _textTrackList;
1280
1291
  private _previewTime;
1281
1292
  private _thumbnailTextTrack;
1282
1293
  private _lastLoadedThumbnailUrl;
@@ -1349,6 +1360,7 @@ declare class TimeRange extends TimeRange_base {
1349
1360
  private readonly _previewRailEl;
1350
1361
  private readonly _previewBoxEl;
1351
1362
  private _player;
1363
+ private _ads;
1352
1364
  private _pausedWhileScrubbing;
1353
1365
  private _autoAdvanceId;
1354
1366
  private _lastUpdateTime;
@@ -1362,7 +1374,7 @@ declare class TimeRange extends TimeRange_base {
1362
1374
  get streamType(): StreamType;
1363
1375
  set streamType(streamType: StreamType);
1364
1376
  private readonly _updateFromPlayer;
1365
- private readonly _updateDisabled;
1377
+ private updateDisabled_;
1366
1378
  protected getAriaLabel(): string;
1367
1379
  protected getAriaValueText(): string;
1368
1380
  attributeChangedCallback(attrName: string, oldValue: any, newValue: any): void;
@@ -1370,6 +1382,7 @@ declare class TimeRange extends TimeRange_base {
1370
1382
  private readonly _pauseOnScrubStart;
1371
1383
  private readonly _playOnScrubEnd;
1372
1384
  private shouldAutoAdvance_;
1385
+ private needToUpdateEveryFrame_;
1373
1386
  private readonly _toggleAutoAdvance;
1374
1387
  private readonly _autoAdvanceWhilePlaying;
1375
1388
  protected updatePointer_(mousePercent: number, rangeRect: DOMRectReadOnly): void;
@@ -1495,6 +1508,7 @@ declare const ChromecastDisplay_base: {
1495
1508
  declare class ChromecastDisplay extends ChromecastDisplay_base {
1496
1509
  private readonly _receiverNameEl;
1497
1510
  private _player;
1511
+ private _castApi;
1498
1512
  constructor();
1499
1513
  protected _upgradeProperty(prop: keyof this): void;
1500
1514
  connectedCallback(): void;
@@ -1570,6 +1584,7 @@ declare const GestureReceiver_base: {
1570
1584
  */
1571
1585
  declare class GestureReceiver extends GestureReceiver_base {
1572
1586
  private _player;
1587
+ private _playerElement;
1573
1588
  private _pointerType;
1574
1589
  constructor();
1575
1590
  protected _upgradeProperty(prop: keyof this): void;
@@ -1660,6 +1675,7 @@ declare const AdDisplay_base: {
1660
1675
  declare class AdDisplay extends AdDisplay_base {
1661
1676
  private readonly _spanEl;
1662
1677
  private _player;
1678
+ private _ads;
1663
1679
  constructor();
1664
1680
  protected _upgradeProperty(prop: keyof this): void;
1665
1681
  connectedCallback(): void;
@@ -1685,6 +1701,7 @@ declare const AdCountdown_base: {
1685
1701
  declare class AdCountdown extends AdCountdown_base {
1686
1702
  private readonly _spanEl;
1687
1703
  private _player;
1704
+ private _ads;
1688
1705
  constructor();
1689
1706
  protected _upgradeProperty(prop: keyof this): void;
1690
1707
  connectedCallback(): void;
@@ -1707,6 +1724,7 @@ declare const AdClickThroughButton_base: typeof LinkButton & Constructor<StateRe
1707
1724
  */
1708
1725
  declare class AdClickThroughButton extends AdClickThroughButton_base {
1709
1726
  private _player;
1727
+ private _ads;
1710
1728
  static get observedAttributes(): Attribute[];
1711
1729
  constructor();
1712
1730
  connectedCallback(): void;
@@ -1735,6 +1753,7 @@ declare class AdSkipButton extends AdSkipButton_base {
1735
1753
  private readonly _countdownEl;
1736
1754
  private readonly _skipEl;
1737
1755
  private _player;
1756
+ private _ads;
1738
1757
  static get observedAttributes(): Attribute[];
1739
1758
  constructor();
1740
1759
  connectedCallback(): void;
@@ -1945,6 +1964,7 @@ declare class UIContainer extends HTMLElement {
1945
1964
  private readonly registerStateReceiver_;
1946
1965
  private readonly unregisterStateReceiver_;
1947
1966
  private propagateStateToReceiver_;
1967
+ private propagatePlayerToAllReceivers_;
1948
1968
  private removeStateFromReceiver_;
1949
1969
  private openMenu_;
1950
1970
  private closeMenu_;
@@ -1985,6 +2005,9 @@ declare class UIContainer extends HTMLElement {
1985
2005
  private readonly _onChromeSlotTransition;
1986
2006
  private readonly _updateTextTrackMargins;
1987
2007
  private readonly _onPreviewTimeChange;
2008
+ private addPlayerListeners_;
2009
+ private removePlayerListeners_;
2010
+ private readonly _onDestroy;
1988
2011
  }
1989
2012
  declare global {
1990
2013
  interface HTMLElementTagNameMap {