@flowplayer/spins 0.7.0 → 0.9.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/dist/types.d.ts CHANGED
@@ -13,6 +13,12 @@ declare const spinEvents: {
13
13
  * Emitted when a different spin enters the viewport.
14
14
  */
15
15
  readonly SPIN_IN_VIEWPORT: "spin:viewport";
16
+ /**
17
+ * Emitted when the user taps the close button.
18
+ * The library does not remove the container — the implementor must listen
19
+ * for this event and handle teardown.
20
+ */
21
+ readonly CLOSE: "spins:close";
16
22
  };
17
23
  declare const mediaEvents: {
18
24
  /** Fired when the browser can start playing the media without stopping for buffering. */
@@ -29,6 +35,8 @@ declare const mediaEvents: {
29
35
  readonly PLAY: "play";
30
36
  /** Fired when the user begins seeking to a new playback position. */
31
37
  readonly SEEKING: "seeking";
38
+ /** Fired when a seek operation completed. */
39
+ readonly SEEKED: "seeked";
32
40
  /** Fired when playback has reached the end of the media resource. */
33
41
  readonly ENDED: "ended";
34
42
  };
@@ -120,6 +128,19 @@ interface SpinsConfig {
120
128
  * @see https://developer.wowza.com/docs/wowza-flowplayer/plugins/about-plugins/#plugin-descriptions
121
129
  */
122
130
  plugins?: (typeof PlayerPlugins)[number][];
131
+ /**
132
+ * When `true`, renders a close button overlaid on the player.
133
+ * Clicking it dispatches a `spins:close` event on the container — the library
134
+ * does not remove the element; the implementor is responsible for teardown.
135
+ * @default false
136
+ */
137
+ closeButton?: boolean;
138
+ /**
139
+ * The label rendered on the link anchor for each spin that has a {@link SpinItem.article_url}.
140
+ * Applies to the entire feed.
141
+ * @default "Read more"
142
+ */
143
+ articleLabel?: string;
123
144
  }
124
145
  /**
125
146
  * Describes an individual item used in a Spin playlist.
@@ -137,6 +158,12 @@ interface SpinItem {
137
158
  title?: Config["title"];
138
159
  poster?: Config["poster"];
139
160
  description?: Config["description"];
161
+ /**
162
+ * A URL linking to an article or external resource related to this spin.
163
+ * Must be an absolute http/https URL. Rendered as an anchor element using
164
+ * the feed-level {@link SpinsConfig.articleLabel} as the link text.
165
+ */
166
+ article_url?: string;
140
167
  /**
141
168
  * Subtitles plugin configuration. Requires Subtitles plugin to be attached.
142
169
  * @see https://developer.wowza.com/docs/wowza-flowplayer/plugins/html-subtitles/#configure-the-plugin
package/package.json CHANGED
@@ -1,14 +1,13 @@
1
1
  {
2
2
  "name": "@flowplayer/spins",
3
3
  "module": "dist/index.js",
4
- "version": "0.7.0",
4
+ "version": "0.9.0",
5
5
  "type": "module",
6
6
  "types": "./dist/types.d.ts",
7
7
  "exports": {
8
8
  ".": {
9
9
  "types": "./dist/types.d.ts",
10
- "import": "./dist/index.js",
11
- "require": "./dist/index.js"
10
+ "import": "./dist/index.js"
12
11
  }
13
12
  },
14
13
  "files": [
@@ -21,37 +20,40 @@
21
20
  "lint": "bunx @biomejs/biome check --write .",
22
21
  "fix:unsafe": "bunx @biomejs/biome check --unsafe --write .",
23
22
  "dev": "bun run storybook",
23
+ "serve": "bun serve.js",
24
24
  "build-storybook": "storybook build",
25
25
  "test": "bun run vitest",
26
26
  "prepare": "bun run build"
27
27
  },
28
28
  "devDependencies": {
29
+ "@alugha/ima": "^2.2.1",
29
30
  "@biomejs/biome": "2.1.1",
30
31
  "@chromatic-com/storybook": "^4.0.1",
31
- "@storybook/addon-a11y": "^9.0.16",
32
- "@storybook/addon-docs": "^9.0.16",
33
- "@storybook/addon-vitest": "^9.0.16",
34
- "@storybook/web-components-vite": "^9.0.16",
32
+ "@storybook/addon-a11y": "^10.4.1",
33
+ "@storybook/addon-docs": "^10.4.1",
34
+ "@storybook/addon-vitest": "^10.4.1",
35
+ "@storybook/web-components-vite": "^10.4.1",
35
36
  "@types/bun": "latest",
36
- "@vitest/browser": "^3.2.4",
37
- "@alugha/ima": "^2.2.1",
37
+ "@types/can-autoplay": "^3.0.1",
38
38
  "@types/qs": "^6.9.7",
39
+ "@vitest/browser": "^3.2.4",
39
40
  "@vitest/coverage-v8": "^3.2.4",
40
- "@types/can-autoplay": "^3.0.1",
41
+ "browser-sync": "^3.0.4",
41
42
  "chromatic": "^13.1.2",
42
43
  "husky": "^9.1.7",
43
- "tsup": "^8.5.0",
44
44
  "lit": "^3.3.0",
45
45
  "playwright": "^1.53.2",
46
- "storybook": "^9.0.16",
46
+ "tsup": "^8.5.0",
47
+ "storybook": "^10.4.1",
47
48
  "vitest": "^3.2.4"
48
49
  },
49
50
  "peerDependencies": {
50
51
  "typescript": "5"
51
52
  },
52
53
  "dependencies": {
53
- "@flowplayer/player": "^3.29.0",
54
- "@flowplayer/translations": "^2.2.0",
54
+ "@flowplayer/player": "^3.37.0",
55
+ "qs": "^6.5.3",
56
+ "@flowplayer/translations": "^2.6.0",
55
57
  "bowser": "^2.11.0",
56
58
  "can-autoplay": "^3.0.2",
57
59
  "jwt-decode": "^2.2.0",