@vestra-player/sdk 1.5.51 → 1.5.52

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,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.5.52
4
+
5
+ **Who must change: nobody.** Additive: `WindowState` gains `maximized`, `apiVersion` stays `vestra/1`, no new capability. Players before 0.6.3 do not report it and it reads `false` there; a plugin that depends on it sets `"minPlayerVersion": "0.6.3"`. A test that deep-compares the whole `plugin.window.state` now also sees `maximized: false`.
6
+
7
+ - **`plugin.window.state.maximized`** (player 0.6.3): `true` while the main window is maximized, `false` in fullscreen (also when the window was maximized before and is again after leaving it). Changes arrive through `plugin.window.onChange` like the other window facts (with `events` for changes made by the user). A plugin that resizes the window, such as the Window plugin's "Window size when playback starts", leaves a maximized window alone, as MPC-HC and mpv do. The player sends it as `maximized` in the `window.state` reply and event; the SDK reads a missing or non-boolean field as `false`.
8
+ - **`TestHost`**: `host.mainWindow.maximized` (default `false`) and `host.setMainWindow({ maximized: true })`, which broadcasts `window.state` as the player does; like the player, `window.state` reports `false` while fullscreen.
9
+ - _Docs_: `WindowState.maximized`, `MainWindow`, `TestHost.setMainWindow` and [Reference: testing](docs/reference/testing.md#simulating-the-player) describe it.
10
+
3
11
  ## 1.5.51
4
12
 
5
13
  **Who must change: nobody.** Additive: `MENU_IDS` and `MenuId` gain `reset`, `apiVersion` stays `vestra/1`, no new capability. A plugin that puts a command under `@reset` sets `"minPlayerVersion": "0.6.3"`: older players refuse `@reset` with `invalid` (since SDK 1.5.49 that command is skipped and the rest of the plugin activates).
Binary file
@@ -1664,14 +1664,22 @@ export declare class TestHost implements Transport {
1664
1664
  readonly confirms: Record<string, Json>[];
1665
1665
  /**
1666
1666
  * The main window as the player would show it. Change it with
1667
- * `setMainWindow` (the user resized it, entered fullscreen, closed the
1668
- * picture-in-picture window); `onTop`, `cursorAutoHide` and
1667
+ * `setMainWindow` (the user resized or maximized it, entered fullscreen,
1668
+ * closed the picture-in-picture window); `onTop`, `cursorAutoHide` and
1669
1669
  * `pictureInPicture.active` record the plugin's `window.set…` calls.
1670
1670
  * `pictureInPicture.supported: false` stands for Windows and Linux.
1671
1671
  */
1672
1672
  readonly mainWindow: {
1673
1673
  /** Whether the main window is fullscreen. */
1674
1674
  fullscreen: boolean;
1675
+ /**
1676
+ * Whether the main window is maximized (default `false`). Like the
1677
+ * player, `window.state` reports `false` while fullscreen and this
1678
+ * value again after leaving it.
1679
+ *
1680
+ * @since 1.5.52
1681
+ */
1682
+ maximized: boolean;
1675
1683
  /** The video area in logical points (default 780×609). */
1676
1684
  videoArea: {
1677
1685
  /** Width in logical points. */
@@ -2168,15 +2176,17 @@ export declare class TestHost implements Transport {
2168
2176
  */
2169
2177
  setSource(patch: Partial<SourceState>): void;
2170
2178
  /**
2171
- * Simulate the user changing the main window (resizing it, entering or
2172
- * leaving fullscreen, closing the picture-in-picture window) and broadcast
2173
- * it. Like the player, entering fullscreen collapses an attached, visible
2179
+ * Simulate the user changing the main window (resizing, maximizing or
2180
+ * restoring it, entering or leaving fullscreen, closing the
2181
+ * picture-in-picture window) and broadcast it. `maximized` (SDK 1.5.52)
2182
+ * reads `false` while fullscreen, as player 0.6.3 reports it. Like the player, entering fullscreen collapses an attached, visible
2174
2183
  * sidebar (`effective: false`, `reason: "fullscreen"`) and leaving
2175
2184
  * fullscreen docks it again.
2176
2185
  *
2177
- * @example Go fullscreen, then report picture-in-picture support
2186
+ * @example Go fullscreen, report picture-in-picture support, maximize
2178
2187
  * The plugin sees the main window fullscreen at 1920×1080, then learns
2179
- * that picture-in-picture is available. `setMainWindow` changes the
2188
+ * that picture-in-picture is available, then sees the window leave
2189
+ * fullscreen maximized. `setMainWindow` changes the
2180
2190
  * host's window facts and broadcasts them as the player does when the
2181
2191
  * user resizes or toggles fullscreen; entering fullscreen also collapses
2182
2192
  * an attached sidebar.
@@ -2188,6 +2198,10 @@ export declare class TestHost implements Transport {
2188
2198
  * await host.settle();
2189
2199
  * assert.equal(plugin.window.state.fullscreen, true);
2190
2200
  * host.setMainWindow({ pictureInPicture: { supported: true, active: false } });
2201
+ * // Leaving fullscreen into a maximized window: `maximized` reads true again.
2202
+ * host.setMainWindow({ fullscreen: false, maximized: true });
2203
+ * await host.settle();
2204
+ * assert.equal(plugin.window.state.maximized, true);
2191
2205
  * ```
2192
2206
  *
2193
2207
  * @capability None.
@@ -2195,6 +2209,7 @@ export declare class TestHost implements Transport {
2195
2209
  */
2196
2210
  setMainWindow(patch: Partial<{
2197
2211
  fullscreen: boolean;
2212
+ maximized: boolean;
2198
2213
  videoArea: {
2199
2214
  width: number;
2200
2215
  height: number;
@@ -1794,14 +1794,22 @@ export class TestHost {
1794
1794
  confirms = [];
1795
1795
  /**
1796
1796
  * The main window as the player would show it. Change it with
1797
- * `setMainWindow` (the user resized it, entered fullscreen, closed the
1798
- * picture-in-picture window); `onTop`, `cursorAutoHide` and
1797
+ * `setMainWindow` (the user resized or maximized it, entered fullscreen,
1798
+ * closed the picture-in-picture window); `onTop`, `cursorAutoHide` and
1799
1799
  * `pictureInPicture.active` record the plugin's `window.set…` calls.
1800
1800
  * `pictureInPicture.supported: false` stands for Windows and Linux.
1801
1801
  */
1802
1802
  mainWindow = {
1803
1803
  /** Whether the main window is fullscreen. */
1804
1804
  fullscreen: false,
1805
+ /**
1806
+ * Whether the main window is maximized (default `false`). Like the
1807
+ * player, `window.state` reports `false` while fullscreen and this
1808
+ * value again after leaving it.
1809
+ *
1810
+ * @since 1.5.52
1811
+ */
1812
+ maximized: false,
1805
1813
  /** The video area in logical points (default 780×609). */
1806
1814
  videoArea: {
1807
1815
  /** Width in logical points. */
@@ -2745,15 +2753,17 @@ export class TestHost {
2745
2753
  this.setBackdropEffective(true);
2746
2754
  }
2747
2755
  /**
2748
- * Simulate the user changing the main window (resizing it, entering or
2749
- * leaving fullscreen, closing the picture-in-picture window) and broadcast
2750
- * it. Like the player, entering fullscreen collapses an attached, visible
2756
+ * Simulate the user changing the main window (resizing, maximizing or
2757
+ * restoring it, entering or leaving fullscreen, closing the
2758
+ * picture-in-picture window) and broadcast it. `maximized` (SDK 1.5.52)
2759
+ * reads `false` while fullscreen, as player 0.6.3 reports it. Like the player, entering fullscreen collapses an attached, visible
2751
2760
  * sidebar (`effective: false`, `reason: "fullscreen"`) and leaving
2752
2761
  * fullscreen docks it again.
2753
2762
  *
2754
- * @example Go fullscreen, then report picture-in-picture support
2763
+ * @example Go fullscreen, report picture-in-picture support, maximize
2755
2764
  * The plugin sees the main window fullscreen at 1920×1080, then learns
2756
- * that picture-in-picture is available. `setMainWindow` changes the
2765
+ * that picture-in-picture is available, then sees the window leave
2766
+ * fullscreen maximized. `setMainWindow` changes the
2757
2767
  * host's window facts and broadcasts them as the player does when the
2758
2768
  * user resizes or toggles fullscreen; entering fullscreen also collapses
2759
2769
  * an attached sidebar.
@@ -2765,6 +2775,10 @@ export class TestHost {
2765
2775
  * await host.settle();
2766
2776
  * assert.equal(plugin.window.state.fullscreen, true);
2767
2777
  * host.setMainWindow({ pictureInPicture: { supported: true, active: false } });
2778
+ * // Leaving fullscreen into a maximized window: `maximized` reads true again.
2779
+ * host.setMainWindow({ fullscreen: false, maximized: true });
2780
+ * await host.settle();
2781
+ * assert.equal(plugin.window.state.maximized, true);
2768
2782
  * ```
2769
2783
  *
2770
2784
  * @capability None.
@@ -2815,6 +2829,8 @@ export class TestHost {
2815
2829
  #windowFacts() {
2816
2830
  return {
2817
2831
  fullscreen: this.mainWindow.fullscreen,
2832
+ // Like player 0.6.3: never maximized while fullscreen.
2833
+ maximized: this.mainWindow.maximized && !this.mainWindow.fullscreen,
2818
2834
  videoArea: { ...this.mainWindow.videoArea },
2819
2835
  pictureInPicture: { ...this.mainWindow.pictureInPicture },
2820
2836
  appearance: this.appearance,
@@ -4041,6 +4041,18 @@ export interface Timeline {
4041
4041
  export interface WindowState {
4042
4042
  /** The main window is fullscreen. */
4043
4043
  readonly fullscreen: boolean;
4044
+ /**
4045
+ * The main window is maximized (`false` in fullscreen, also when it was
4046
+ * maximized before and will be again after). Changes reach
4047
+ * {@link MainWindow.onChange}. A plugin that sizes the window, such as to
4048
+ * the video when playback starts, leaves a maximized window alone, as
4049
+ * MPC-HC and mpv do. Always `false` with players before 0.6.3, which do
4050
+ * not report it.
4051
+ *
4052
+ * @player 0.6.3; older players: always `false`.
4053
+ * @since 1.5.52
4054
+ */
4055
+ readonly maximized: boolean;
4044
4056
  /** The video column, without the bottom bar, sidebar and splitter. */
4045
4057
  readonly videoArea: {
4046
4058
  /** Logical points. */
@@ -4089,8 +4101,8 @@ export interface WindowState {
4089
4101
  * ```
4090
4102
  *
4091
4103
  * @remarks
4092
- * `plugin.window` is the player's main window: its size, fullscreen,
4093
- * picture-in-picture and the video area. Reading it needs no capability;
4104
+ * `plugin.window` is the player's main window: its size, whether it is
4105
+ * maximized or fullscreen, picture-in-picture and the video area. Reading it needs no capability;
4094
4106
  * changing it needs `window.control`. Changes that last only while the
4095
4107
  * plugin runs (always on top, pointer auto-hide) revert when it stops.
4096
4108
  *
@@ -2,6 +2,8 @@
2
2
  import { failure } from "./runtime.js";
3
3
  const view = (facts) => Object.freeze({
4
4
  fullscreen: facts.fullscreen === true,
5
+ // Players before 0.6.3 do not send it; never maximized in fullscreen.
6
+ maximized: facts.maximized === true && facts.fullscreen !== true,
5
7
  videoArea: Object.freeze({
6
8
  width: Number(facts.videoArea?.width ?? 0),
7
9
  height: Number(facts.videoArea?.height ?? 0),
package/dist/wire.d.ts CHANGED
@@ -233,6 +233,8 @@ export interface BindingTable {
233
233
  /** `window.state`: the main window, in logical points (zero without one). */
234
234
  export interface WindowFacts {
235
235
  fullscreen: boolean;
236
+ /** The main window is maximized, `false` in fullscreen (player 0.6.3; absent from older players: `false`). */
237
+ maximized?: boolean;
236
238
  videoArea: {
237
239
  width: number;
238
240
  height: number;
package/llms.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  # Vestra Player SDK
2
2
 
3
- > @vestra-player/sdk 1.5.51: write plugins for Vestra Player in TypeScript (plugin API `vestra/1`). A plugin is a folder with `manifest.json` and an entry module whose default export `activate(plugin)` the player calls. The documentation is a tree of short pages read by path, like `go doc`: the same pages and API as https://vestrasys.github.io/vestra-player-sdk/.
3
+ > @vestra-player/sdk 1.5.52: write plugins for Vestra Player in TypeScript (plugin API `vestra/1`). A plugin is a folder with `manifest.json` and an entry module whose default export `activate(plugin)` the player calls. The documentation is a tree of short pages read by path, like `go doc`: the same pages and API as https://vestrasys.github.io/vestra-player-sdk/.
4
4
 
5
5
  ## Read the documentation
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vestra-player/sdk",
3
- "version": "1.5.51",
3
+ "version": "1.5.52",
4
4
  "description": "Plugin API types, test host and plugin CLI for Vestra Player (apiVersion vestra/1)",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {