@theoplayer/web-ui 2.2.0 → 2.3.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,15 @@
1
1
  # @theoplayer/web-ui
2
2
 
3
+ ## 2.3.0
4
+
5
+ ### ✨ Features
6
+
7
+ - Added 360°/VR support: `<theoplayer-vr-button>` and `<theoplayer-vr-compass>`, included by default in `<theoplayer-default-ui>`.
8
+
9
+ ### 🐛 Issues
10
+
11
+ - Fixed an issue where the subtitles were briefly overlapping the control bar.
12
+
3
13
  ## 2.2.0
4
14
 
5
15
  ### ✨ Features
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * THEOplayer Open Video UI for Web (v2.2.0)
2
+ * THEOplayer Open Video UI for Web (v2.3.0)
3
3
  * License: MIT
4
4
  */
5
5
  import * as lit from 'lit';
@@ -1058,6 +1058,58 @@ declare global {
1058
1058
  }
1059
1059
  }
1060
1060
 
1061
+ /**
1062
+ * A button that toggles stereoscopic VR mode.
1063
+ *
1064
+ * The button is only shown when the current source supports VR (e.g. a 360° video),
1065
+ * and is disabled when the device cannot present VR content.
1066
+ */
1067
+ declare class VRButton extends Button {
1068
+ private _player;
1069
+ connectedCallback(): void;
1070
+ get player(): ChromelessPlayer | undefined;
1071
+ set player(player: ChromelessPlayer | undefined);
1072
+ /**
1073
+ * Whether stereoscopic VR mode is currently active.
1074
+ */
1075
+ accessor stereo: boolean;
1076
+ accessor lang: string;
1077
+ private readonly _updateFromPlayer;
1078
+ protected handleClick(): void;
1079
+ willUpdate(changedProperties: PropertyValues): void;
1080
+ private _updateAriaLabel;
1081
+ protected render(): HTMLTemplateResult;
1082
+ }
1083
+ declare global {
1084
+ interface HTMLElementTagNameMap {
1085
+ 'theoplayer-vr-button': VRButton;
1086
+ }
1087
+ }
1088
+
1089
+ /**
1090
+ * A compass that indicates the current viewing direction of a 360° (VR) video.
1091
+ *
1092
+ * @cssproperty `--theoplayer-vr-compass-size` - The size (diameter) of the compass. Defaults to `26px`.
1093
+ * @cssproperty `--theoplayer-vr-compass-color` - The color of the compass border, center dot and pointer.
1094
+ * Defaults to `#fff`.
1095
+ * @cssproperty `--theoplayer-vr-compass-fov-color` - The color of the field-of-view indicator.
1096
+ * Defaults to `rgba(255, 255, 255, 0.75)`.
1097
+ */
1098
+ declare class VRCompass extends LitElement {
1099
+ static styles: lit.CSSResult[];
1100
+ private _player;
1101
+ private accessor _yaw;
1102
+ get player(): ChromelessPlayer | undefined;
1103
+ set player(player: ChromelessPlayer | undefined);
1104
+ private readonly _updateFromPlayer;
1105
+ protected render(): HTMLTemplateResult;
1106
+ }
1107
+ declare global {
1108
+ interface HTMLElementTagNameMap {
1109
+ 'theoplayer-vr-compass': VRCompass;
1110
+ }
1111
+ }
1112
+
1061
1113
  declare class ColorStops {
1062
1114
  private _stops;
1063
1115
  constructor();
@@ -2116,6 +2168,7 @@ declare class UIContainer extends LitElement {
2116
2168
  private tryInitializePlayer_;
2117
2169
  protected createRenderRoot(): HTMLElement | DocumentFragment;
2118
2170
  protected firstUpdated(): void;
2171
+ protected updated(): void;
2119
2172
  disconnectedCallback(): void;
2120
2173
  private readonly _onMutation;
2121
2174
  private readonly _onSlotChange;
@@ -2137,7 +2190,15 @@ declare class UIContainer extends LitElement {
2137
2190
  private readonly _onMenuPointerDown;
2138
2191
  private readonly _onMenuClick;
2139
2192
  private readonly _onEnterFullscreen;
2193
+ private _enterFullscreen;
2140
2194
  private readonly _onExitFullscreen;
2195
+ private _exitFullscreen;
2196
+ /**
2197
+ * On iOS, presenting stereoscopic VR requires the player to fill the screen.
2198
+ */
2199
+ private _vrFullscreen;
2200
+ private _vrWasFullscreen;
2201
+ private readonly _onVrStateChange;
2141
2202
  private readonly _onFullscreenChange;
2142
2203
  private readonly _exitFullscreenOnEsc;
2143
2204
  private readonly _updateAspectRatio;
@@ -2468,6 +2529,7 @@ declare enum Attribute {
2468
2529
  REMAINING = "remaining",
2469
2530
  REMAINING_WHEN_LIVE = "remaining-when-live",
2470
2531
  SHOW_DURATION = "show-duration",
2532
+ STEREO = "stereo",
2471
2533
  SEEK_OFFSET = "seek-offset",
2472
2534
  MENU = "menu",
2473
2535
  MENU_OPENED = "menu-opened",
@@ -2550,6 +2612,18 @@ interface Locale {
2550
2612
  * The {@link HTMLElement.ariaLabel | `aria-label`} for a {@link FullscreenButton} when in fullscreen mode.
2551
2613
  */
2552
2614
  fullscreenExitAria: string;
2615
+ /**
2616
+ * The {@link HTMLElement.ariaLabel | `aria-label`} for a {@link VRButton}.
2617
+ */
2618
+ vrAria: string;
2619
+ /**
2620
+ * The {@link HTMLElement.ariaLabel | `aria-label`} for a {@link VRButton} when VR (stereo) mode is active.
2621
+ */
2622
+ vrExitAria: string;
2623
+ /**
2624
+ * The {@link HTMLElement.ariaLabel | `aria-label`} for a {@link VRButton} when no VR capable device is available.
2625
+ */
2626
+ vrUnavailableAria: string;
2553
2627
  /**
2554
2628
  * The {@link HTMLElement.ariaLabel | `aria-label`} for an {@link AirPlayButton}.
2555
2629
  */
@@ -2903,6 +2977,6 @@ declare function addLocale(name: string, locale: PartialLocale): void;
2903
2977
  */
2904
2978
  declare const version: string;
2905
2979
 
2906
- export { ActiveQualityDisplay, AdClickThroughButton, AdCountdown, AdDisplay, AdSkipButton, AirPlayButton, Attribute, AutomaticQualitySelector, BadNetworkModeButton, BadNetworkModeMenu, BadNetworkModeSelector, Button, CastButton, ChromecastButton, ChromecastDisplay, CloseMenuButton, ColorStops, ControlBar, DefaultUI, DurationDisplay, ErrorDisplay, ExtensionSlot, FullscreenButton, GestureReceiver, LanguageMenu, LanguageMenuButton, LinkButton, LiveButton, LoadingIndicator, MediaTrackRadioButton, Menu, MenuButton, MenuGroup, MuteButton, PlayButton, PlaybackRateDisplay, PlaybackRateMenu, PlaybackRateMenuButton, PlaybackRateRadioGroup, PreviewThumbnail, PreviewTimeDisplay, QualityRadioButton, QualityRadioGroup, RadioButton, RadioGroup, Range, SeekButton, SettingsMenu, SettingsMenuButton, SlotContainer, StateReceiverMixin, THEOliveDefaultUI, TextTrackOffRadioButton, TextTrackRadioButton, TextTrackStyleDisplay, TextTrackStyleMenu, TextTrackStyleRadioGroup, TextTrackStyleResetButton, TimeDisplay, TimeRange, TrackRadioGroup, UIContainer, VolumeRange, addLocale, buttonTemplate, linkButtonTemplate, menuGroupTemplate, menuTemplate, registerExtension, stateReceiver, version };
2980
+ export { ActiveQualityDisplay, AdClickThroughButton, AdCountdown, AdDisplay, AdSkipButton, AirPlayButton, Attribute, AutomaticQualitySelector, BadNetworkModeButton, BadNetworkModeMenu, BadNetworkModeSelector, Button, CastButton, ChromecastButton, ChromecastDisplay, CloseMenuButton, ColorStops, ControlBar, DefaultUI, DurationDisplay, ErrorDisplay, ExtensionSlot, FullscreenButton, GestureReceiver, LanguageMenu, LanguageMenuButton, LinkButton, LiveButton, LoadingIndicator, MediaTrackRadioButton, Menu, MenuButton, MenuGroup, MuteButton, PlayButton, PlaybackRateDisplay, PlaybackRateMenu, PlaybackRateMenuButton, PlaybackRateRadioGroup, PreviewThumbnail, PreviewTimeDisplay, QualityRadioButton, QualityRadioGroup, RadioButton, RadioGroup, Range, SeekButton, SettingsMenu, SettingsMenuButton, SlotContainer, StateReceiverMixin, THEOliveDefaultUI, TextTrackOffRadioButton, TextTrackRadioButton, TextTrackStyleDisplay, TextTrackStyleMenu, TextTrackStyleRadioGroup, TextTrackStyleResetButton, TimeDisplay, TimeRange, TrackRadioGroup, UIContainer, VRButton, VRCompass, VolumeRange, addLocale, buttonTemplate, linkButtonTemplate, menuGroupTemplate, menuTemplate, registerExtension, stateReceiver, version };
2907
2981
  export type { ButtonOptions, Constructor, DeviceType, Duration, Extension, KnownColor, KnownFontFamily, Locale, MenuGroupOptions, MenuOptions, PartialLocale, StateReceiverElement, StateReceiverPropertyMap, StreamType, TextTrackStyleMap, TextTrackStyleOption, TrackType, VolumeLevel };
2908
2982
  export as namespace THEOplayerUI;