@thestatic-tv/dcl-sdk 2.6.1 → 2.8.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/README.md +23 -1
- package/dist/index.d.mts +45 -6
- package/dist/index.d.ts +45 -6
- package/dist/index.js +124 -10
- package/dist/index.mjs +124 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -99,7 +99,24 @@ staticTV.guideUI.toggle()
|
|
|
99
99
|
staticTV.chatUI.toggle()
|
|
100
100
|
```
|
|
101
101
|
|
|
102
|
-
##
|
|
102
|
+
## 18+ channels (2.8.0)
|
|
103
|
+
|
|
104
|
+
18+ channels are in the lineup with the rest: each 18+ channel and each of its VODs carries
|
|
105
|
+
`isNsfw: true` (on `GuideVideo`, `Channel` and `Vod`). Before one plays, the viewer chooses yes or
|
|
106
|
+
no - nothing is proven, and nothing is sent or stored.
|
|
107
|
+
|
|
108
|
+
- **The built-in Guide UI asks for you.** Picking an 18+ entry (a card, or RANDOM SIGNAL landing on
|
|
109
|
+
one) shows MATURE CONTENT with YES and NO. YES hands it to `onVideoSelect` (and to your
|
|
110
|
+
`videoScreen` or `onVideoPlay`) and covers that channel until the scene unloads; NO, or closing
|
|
111
|
+
the guide, plays nothing.
|
|
112
|
+
- **A scene that starts entries itself must ask too.** If you play from `staticTV.guide`
|
|
113
|
+
(`getChannels()`, `getLiveChannels()`, `getVods()`) or from your own copy of the lineup - a
|
|
114
|
+
picker of your own, an auto-play of a live channel, a default channel - check `isNsfw` and play
|
|
115
|
+
an 18+ entry only after the viewer answers yes.
|
|
116
|
+
|
|
117
|
+
SDK versions before 2.8.0 drop the flag and play every pick at once.
|
|
118
|
+
|
|
119
|
+
## In-world admin, chat, watch time (2.6.0) and session tracking (2.7.0)
|
|
103
120
|
|
|
104
121
|
The Admin Panel, Chat, the watch heartbeat and like/follow send DCL signed requests: Decentraland
|
|
105
122
|
signs each one as the player, and thestatic.tv checks that it came from the scene deployed where
|
|
@@ -110,6 +127,11 @@ update and redeploy your scene to keep them working. Chill to Earn credits the p
|
|
|
110
127
|
the heartbeat; a guest's minutes count for the channel but earn nothing, and a guest cannot like
|
|
111
128
|
or follow.
|
|
112
129
|
|
|
130
|
+
Since 2.7.0 the session calls (enter, heartbeat, leave) are signed too, on every tier: the visitor
|
|
131
|
+
in your analytics is the player who signed them, and the SDK names no wallet. A scene on an older
|
|
132
|
+
SDK keeps every feature after the server change; its visitors read as anonymous in analytics until
|
|
133
|
+
it updates.
|
|
134
|
+
|
|
113
135
|
## Pricing & Tiers
|
|
114
136
|
|
|
115
137
|
See [thestatic.tv/info](https://thestatic.tv/info) for current pricing and tier features.
|
package/dist/index.d.mts
CHANGED
|
@@ -15,9 +15,14 @@ declare global {
|
|
|
15
15
|
* Player identity data from DCL
|
|
16
16
|
*/
|
|
17
17
|
interface PlayerData {
|
|
18
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* Player's wallet address (userId from DCL).
|
|
20
|
+
* @deprecated Since 2.7.0 the session calls are DCL signed requests and thestatic.tv records the
|
|
21
|
+
* signer as the visitor, so the server never reads this for sessions and the SDK sends no wallet
|
|
22
|
+
* in them. Kept for compatibility; only the read-only `getStats()` query still uses it.
|
|
23
|
+
*/
|
|
19
24
|
wallet?: string;
|
|
20
|
-
/** Player's display name */
|
|
25
|
+
/** Player's display name - sent with the session's enter call */
|
|
21
26
|
name?: string;
|
|
22
27
|
}
|
|
23
28
|
|
|
@@ -89,13 +94,15 @@ interface StaticTVConfig {
|
|
|
89
94
|
baseUrl?: string;
|
|
90
95
|
apiUrl?: string;
|
|
91
96
|
/**
|
|
92
|
-
* Player data from DCL - pass from your scene's getPlayer() call
|
|
97
|
+
* Player data from DCL - pass from your scene's getPlayer() call.
|
|
98
|
+
* `name` goes with the session's enter call; `wallet` is deprecated (see PlayerData) - the
|
|
99
|
+
* signed session identifies the visitor itself.
|
|
93
100
|
* @example
|
|
94
101
|
* import { getPlayer } from '@dcl/sdk/players'
|
|
95
102
|
* const player = getPlayer()
|
|
96
103
|
* new StaticTVClient({
|
|
97
104
|
* apiKey: 'dcls_...',
|
|
98
|
-
* player: {
|
|
105
|
+
* player: { name: player?.name }
|
|
99
106
|
* })
|
|
100
107
|
*/
|
|
101
108
|
player?: PlayerData;
|
|
@@ -134,6 +141,11 @@ interface Channel {
|
|
|
134
141
|
logo: string | null;
|
|
135
142
|
description: string;
|
|
136
143
|
socials: string | null;
|
|
144
|
+
/**
|
|
145
|
+
* True for an 18+ channel (thestatic.tv's flag since 2026-10-15). Listed like any other: a scene
|
|
146
|
+
* that plays it without the guide UI asks the viewer yes or no first.
|
|
147
|
+
*/
|
|
148
|
+
isNsfw?: boolean;
|
|
137
149
|
}
|
|
138
150
|
/**
|
|
139
151
|
* VOD (Video on Demand) information
|
|
@@ -145,6 +157,8 @@ interface Vod {
|
|
|
145
157
|
thumbnail: string | null;
|
|
146
158
|
channelId: string;
|
|
147
159
|
createdAt: string;
|
|
160
|
+
/** True for each VOD of an 18+ channel (since 2026-10-15) - ask the viewer yes or no before it plays */
|
|
161
|
+
isNsfw?: boolean;
|
|
148
162
|
}
|
|
149
163
|
/**
|
|
150
164
|
* Guide response from the API
|
|
@@ -233,6 +247,11 @@ interface GuideVideo {
|
|
|
233
247
|
channelId?: string;
|
|
234
248
|
duration?: number;
|
|
235
249
|
requiresAuth?: boolean;
|
|
250
|
+
/**
|
|
251
|
+
* True for an 18+ channel and each of its VODs (thestatic.tv's flag since 2026-10-15). The entry
|
|
252
|
+
* stays in the lineup; the guide UI asks the viewer yes or no before it calls onVideoSelect.
|
|
253
|
+
*/
|
|
254
|
+
isNsfw?: boolean;
|
|
236
255
|
}
|
|
237
256
|
/**
|
|
238
257
|
* Featured playlist for the guide UI
|
|
@@ -247,7 +266,8 @@ interface GuideFeaturedPlaylist {
|
|
|
247
266
|
interface GuideUIConfig {
|
|
248
267
|
/**
|
|
249
268
|
* Callback when user selects a video
|
|
250
|
-
* Developer should handle playback
|
|
269
|
+
* Developer should handle playback. An 18+ entry (isNsfw) arrives only after the viewer answers
|
|
270
|
+
* the guide's MATURE CONTENT question yes (2.8.0); a no never calls it.
|
|
251
271
|
*/
|
|
252
272
|
onVideoSelect?: (video: GuideVideo) => void;
|
|
253
273
|
/**
|
|
@@ -426,6 +446,11 @@ interface AdminPanelConfig {
|
|
|
426
446
|
|
|
427
447
|
/**
|
|
428
448
|
* Guide module - fetch channel lineup from thestatic.tv
|
|
449
|
+
*
|
|
450
|
+
* Each channel and VOD carries isNsfw since 2026-10-15 (true for an 18+ channel and each of its
|
|
451
|
+
* VODs), passed through as the API sends it - nothing is left out. This module plays nothing; a
|
|
452
|
+
* scene that plays an entry from it without the guide UI asks the viewer yes or no first when
|
|
453
|
+
* isNsfw is true, as the guide UI does (README, "18+ channels").
|
|
429
454
|
*/
|
|
430
455
|
|
|
431
456
|
declare class GuideModule {
|
|
@@ -463,6 +488,11 @@ declare class GuideModule {
|
|
|
463
488
|
* Works with both channel keys (dclk_) and scene keys (dcls_).
|
|
464
489
|
* Scene keys use /scene-session endpoint, channel keys use /session.
|
|
465
490
|
*
|
|
491
|
+
* Enter, heartbeat and leave are DCL signed requests (2.7.0): the explorer signs each one as the
|
|
492
|
+
* player and thestatic.tv records that proven wallet as the visitor. They name no wallet - earlier
|
|
493
|
+
* versions put one in the enter body, and the server took it as the visitor. An unsigned call
|
|
494
|
+
* still gets its tier and every answer, its visitor recorded as anonymous.
|
|
495
|
+
*
|
|
466
496
|
* Includes automatic boundary detection to ensure metrics only track
|
|
467
497
|
* players who are actually within the scene's parcel boundaries.
|
|
468
498
|
*/
|
|
@@ -509,7 +539,9 @@ declare class SessionModule {
|
|
|
509
539
|
*/
|
|
510
540
|
private getEndpoint;
|
|
511
541
|
/**
|
|
512
|
-
* Get player wallet - prioritize config, fallback to runtime detection
|
|
542
|
+
* Get player wallet - prioritize config, fallback to runtime detection.
|
|
543
|
+
* Only the read-only getStats() query uses it (2.7.0): the session calls are signed and name
|
|
544
|
+
* no wallet, so the signer is the visitor.
|
|
513
545
|
*/
|
|
514
546
|
private getWallet;
|
|
515
547
|
/**
|
|
@@ -640,6 +672,8 @@ declare class GuideUIModule {
|
|
|
640
672
|
private itemsPerPage;
|
|
641
673
|
private searchQuery;
|
|
642
674
|
private _currentVideoId;
|
|
675
|
+
private _ageAsk;
|
|
676
|
+
private _ageYes;
|
|
643
677
|
constructor(client: StaticTVClient, config?: GuideUIConfig);
|
|
644
678
|
/**
|
|
645
679
|
* Initialize the guide - fetch channel data
|
|
@@ -684,7 +718,10 @@ declare class GuideUIModule {
|
|
|
684
718
|
private getBaseUrl;
|
|
685
719
|
private fetchGuideData;
|
|
686
720
|
private s;
|
|
721
|
+
/** The channel a yes covers: the entry's channel, else the entry itself */
|
|
722
|
+
private ageKey;
|
|
687
723
|
private handleVideoSelect;
|
|
724
|
+
private answerAge;
|
|
688
725
|
private handleChannelClick;
|
|
689
726
|
/**
|
|
690
727
|
* Get the guide UI component for rendering
|
|
@@ -696,6 +733,8 @@ declare class GuideUIModule {
|
|
|
696
733
|
private renderRightPanel;
|
|
697
734
|
private renderCardGrid;
|
|
698
735
|
private renderGuideCard;
|
|
736
|
+
/** The 18+ question over the guide panel: MATURE CONTENT, the pick's name, YES or NO */
|
|
737
|
+
private renderAgeChoice;
|
|
699
738
|
private renderCloseButton;
|
|
700
739
|
private renderToggleButton;
|
|
701
740
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -15,9 +15,14 @@ declare global {
|
|
|
15
15
|
* Player identity data from DCL
|
|
16
16
|
*/
|
|
17
17
|
interface PlayerData {
|
|
18
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* Player's wallet address (userId from DCL).
|
|
20
|
+
* @deprecated Since 2.7.0 the session calls are DCL signed requests and thestatic.tv records the
|
|
21
|
+
* signer as the visitor, so the server never reads this for sessions and the SDK sends no wallet
|
|
22
|
+
* in them. Kept for compatibility; only the read-only `getStats()` query still uses it.
|
|
23
|
+
*/
|
|
19
24
|
wallet?: string;
|
|
20
|
-
/** Player's display name */
|
|
25
|
+
/** Player's display name - sent with the session's enter call */
|
|
21
26
|
name?: string;
|
|
22
27
|
}
|
|
23
28
|
|
|
@@ -89,13 +94,15 @@ interface StaticTVConfig {
|
|
|
89
94
|
baseUrl?: string;
|
|
90
95
|
apiUrl?: string;
|
|
91
96
|
/**
|
|
92
|
-
* Player data from DCL - pass from your scene's getPlayer() call
|
|
97
|
+
* Player data from DCL - pass from your scene's getPlayer() call.
|
|
98
|
+
* `name` goes with the session's enter call; `wallet` is deprecated (see PlayerData) - the
|
|
99
|
+
* signed session identifies the visitor itself.
|
|
93
100
|
* @example
|
|
94
101
|
* import { getPlayer } from '@dcl/sdk/players'
|
|
95
102
|
* const player = getPlayer()
|
|
96
103
|
* new StaticTVClient({
|
|
97
104
|
* apiKey: 'dcls_...',
|
|
98
|
-
* player: {
|
|
105
|
+
* player: { name: player?.name }
|
|
99
106
|
* })
|
|
100
107
|
*/
|
|
101
108
|
player?: PlayerData;
|
|
@@ -134,6 +141,11 @@ interface Channel {
|
|
|
134
141
|
logo: string | null;
|
|
135
142
|
description: string;
|
|
136
143
|
socials: string | null;
|
|
144
|
+
/**
|
|
145
|
+
* True for an 18+ channel (thestatic.tv's flag since 2026-10-15). Listed like any other: a scene
|
|
146
|
+
* that plays it without the guide UI asks the viewer yes or no first.
|
|
147
|
+
*/
|
|
148
|
+
isNsfw?: boolean;
|
|
137
149
|
}
|
|
138
150
|
/**
|
|
139
151
|
* VOD (Video on Demand) information
|
|
@@ -145,6 +157,8 @@ interface Vod {
|
|
|
145
157
|
thumbnail: string | null;
|
|
146
158
|
channelId: string;
|
|
147
159
|
createdAt: string;
|
|
160
|
+
/** True for each VOD of an 18+ channel (since 2026-10-15) - ask the viewer yes or no before it plays */
|
|
161
|
+
isNsfw?: boolean;
|
|
148
162
|
}
|
|
149
163
|
/**
|
|
150
164
|
* Guide response from the API
|
|
@@ -233,6 +247,11 @@ interface GuideVideo {
|
|
|
233
247
|
channelId?: string;
|
|
234
248
|
duration?: number;
|
|
235
249
|
requiresAuth?: boolean;
|
|
250
|
+
/**
|
|
251
|
+
* True for an 18+ channel and each of its VODs (thestatic.tv's flag since 2026-10-15). The entry
|
|
252
|
+
* stays in the lineup; the guide UI asks the viewer yes or no before it calls onVideoSelect.
|
|
253
|
+
*/
|
|
254
|
+
isNsfw?: boolean;
|
|
236
255
|
}
|
|
237
256
|
/**
|
|
238
257
|
* Featured playlist for the guide UI
|
|
@@ -247,7 +266,8 @@ interface GuideFeaturedPlaylist {
|
|
|
247
266
|
interface GuideUIConfig {
|
|
248
267
|
/**
|
|
249
268
|
* Callback when user selects a video
|
|
250
|
-
* Developer should handle playback
|
|
269
|
+
* Developer should handle playback. An 18+ entry (isNsfw) arrives only after the viewer answers
|
|
270
|
+
* the guide's MATURE CONTENT question yes (2.8.0); a no never calls it.
|
|
251
271
|
*/
|
|
252
272
|
onVideoSelect?: (video: GuideVideo) => void;
|
|
253
273
|
/**
|
|
@@ -426,6 +446,11 @@ interface AdminPanelConfig {
|
|
|
426
446
|
|
|
427
447
|
/**
|
|
428
448
|
* Guide module - fetch channel lineup from thestatic.tv
|
|
449
|
+
*
|
|
450
|
+
* Each channel and VOD carries isNsfw since 2026-10-15 (true for an 18+ channel and each of its
|
|
451
|
+
* VODs), passed through as the API sends it - nothing is left out. This module plays nothing; a
|
|
452
|
+
* scene that plays an entry from it without the guide UI asks the viewer yes or no first when
|
|
453
|
+
* isNsfw is true, as the guide UI does (README, "18+ channels").
|
|
429
454
|
*/
|
|
430
455
|
|
|
431
456
|
declare class GuideModule {
|
|
@@ -463,6 +488,11 @@ declare class GuideModule {
|
|
|
463
488
|
* Works with both channel keys (dclk_) and scene keys (dcls_).
|
|
464
489
|
* Scene keys use /scene-session endpoint, channel keys use /session.
|
|
465
490
|
*
|
|
491
|
+
* Enter, heartbeat and leave are DCL signed requests (2.7.0): the explorer signs each one as the
|
|
492
|
+
* player and thestatic.tv records that proven wallet as the visitor. They name no wallet - earlier
|
|
493
|
+
* versions put one in the enter body, and the server took it as the visitor. An unsigned call
|
|
494
|
+
* still gets its tier and every answer, its visitor recorded as anonymous.
|
|
495
|
+
*
|
|
466
496
|
* Includes automatic boundary detection to ensure metrics only track
|
|
467
497
|
* players who are actually within the scene's parcel boundaries.
|
|
468
498
|
*/
|
|
@@ -509,7 +539,9 @@ declare class SessionModule {
|
|
|
509
539
|
*/
|
|
510
540
|
private getEndpoint;
|
|
511
541
|
/**
|
|
512
|
-
* Get player wallet - prioritize config, fallback to runtime detection
|
|
542
|
+
* Get player wallet - prioritize config, fallback to runtime detection.
|
|
543
|
+
* Only the read-only getStats() query uses it (2.7.0): the session calls are signed and name
|
|
544
|
+
* no wallet, so the signer is the visitor.
|
|
513
545
|
*/
|
|
514
546
|
private getWallet;
|
|
515
547
|
/**
|
|
@@ -640,6 +672,8 @@ declare class GuideUIModule {
|
|
|
640
672
|
private itemsPerPage;
|
|
641
673
|
private searchQuery;
|
|
642
674
|
private _currentVideoId;
|
|
675
|
+
private _ageAsk;
|
|
676
|
+
private _ageYes;
|
|
643
677
|
constructor(client: StaticTVClient, config?: GuideUIConfig);
|
|
644
678
|
/**
|
|
645
679
|
* Initialize the guide - fetch channel data
|
|
@@ -684,7 +718,10 @@ declare class GuideUIModule {
|
|
|
684
718
|
private getBaseUrl;
|
|
685
719
|
private fetchGuideData;
|
|
686
720
|
private s;
|
|
721
|
+
/** The channel a yes covers: the entry's channel, else the entry itself */
|
|
722
|
+
private ageKey;
|
|
687
723
|
private handleVideoSelect;
|
|
724
|
+
private answerAge;
|
|
688
725
|
private handleChannelClick;
|
|
689
726
|
/**
|
|
690
727
|
* Get the guide UI component for rendering
|
|
@@ -696,6 +733,8 @@ declare class GuideUIModule {
|
|
|
696
733
|
private renderRightPanel;
|
|
697
734
|
private renderCardGrid;
|
|
698
735
|
private renderGuideCard;
|
|
736
|
+
/** The 18+ question over the guide panel: MATURE CONTENT, the pick's name, YES or NO */
|
|
737
|
+
private renderAgeChoice;
|
|
699
738
|
private renderCloseButton;
|
|
700
739
|
private renderToggleButton;
|
|
701
740
|
}
|
package/dist/index.js
CHANGED
|
@@ -420,7 +420,9 @@ var SessionModule = class {
|
|
|
420
420
|
return this.client.keyType === "scene" ? "/scene-session" : "/session";
|
|
421
421
|
}
|
|
422
422
|
/**
|
|
423
|
-
* Get player wallet - prioritize config, fallback to runtime detection
|
|
423
|
+
* Get player wallet - prioritize config, fallback to runtime detection.
|
|
424
|
+
* Only the read-only getStats() query uses it (2.7.0): the session calls are signed and name
|
|
425
|
+
* no wallet, so the signer is the visitor.
|
|
424
426
|
*/
|
|
425
427
|
getWallet() {
|
|
426
428
|
const config = this.client.getConfig();
|
|
@@ -463,14 +465,12 @@ var SessionModule = class {
|
|
|
463
465
|
}
|
|
464
466
|
await this.initializeBounds();
|
|
465
467
|
try {
|
|
466
|
-
const walletAddress = this.getWallet();
|
|
467
468
|
const dclDisplayName = this.getDisplayName();
|
|
468
|
-
this.client.log(`Starting session
|
|
469
|
-
const response = await this.client.
|
|
469
|
+
this.client.log(`Starting session (signed) - name: ${dclDisplayName}`);
|
|
470
|
+
const response = await this.client.signedRequest(this.getEndpoint(), {
|
|
470
471
|
method: "POST",
|
|
471
472
|
body: JSON.stringify({
|
|
472
473
|
action: "enter",
|
|
473
|
-
walletAddress,
|
|
474
474
|
dclDisplayName,
|
|
475
475
|
metadata
|
|
476
476
|
})
|
|
@@ -522,7 +522,7 @@ var SessionModule = class {
|
|
|
522
522
|
this._outOfBoundsCount = 0;
|
|
523
523
|
}
|
|
524
524
|
try {
|
|
525
|
-
await this.client.
|
|
525
|
+
await this.client.signedRequest(this.getEndpoint(), {
|
|
526
526
|
method: "POST",
|
|
527
527
|
body: JSON.stringify({
|
|
528
528
|
action: "heartbeat",
|
|
@@ -547,7 +547,7 @@ var SessionModule = class {
|
|
|
547
547
|
}
|
|
548
548
|
if (this.sessionId) {
|
|
549
549
|
try {
|
|
550
|
-
await this.client.
|
|
550
|
+
await this.client.signedRequest(this.getEndpoint(), {
|
|
551
551
|
method: "POST",
|
|
552
552
|
body: JSON.stringify({
|
|
553
553
|
action: "leave",
|
|
@@ -1001,6 +1001,10 @@ var GuideUIModule = class {
|
|
|
1001
1001
|
this.searchQuery = "";
|
|
1002
1002
|
// Current video tracking (for "PLAYING" indicator)
|
|
1003
1003
|
this._currentVideoId = null;
|
|
1004
|
+
// The 18+ question (2026-10-15): the pick it is asking about, and the channels answered yes
|
|
1005
|
+
// while the scene runs - in memory only, nothing is sent or stored
|
|
1006
|
+
this._ageAsk = null;
|
|
1007
|
+
this._ageYes = /* @__PURE__ */ new Set();
|
|
1004
1008
|
// =============================================================================
|
|
1005
1009
|
// --- UI RENDERING ---
|
|
1006
1010
|
// =============================================================================
|
|
@@ -1038,7 +1042,8 @@ var GuideUIModule = class {
|
|
|
1038
1042
|
children: [
|
|
1039
1043
|
this.renderLeftPanel(),
|
|
1040
1044
|
this.renderRightPanel(),
|
|
1041
|
-
this.renderCloseButton()
|
|
1045
|
+
this.renderCloseButton(),
|
|
1046
|
+
this._ageAsk ? this.renderAgeChoice(this._ageAsk) : null
|
|
1042
1047
|
]
|
|
1043
1048
|
}) : null
|
|
1044
1049
|
]
|
|
@@ -1070,6 +1075,7 @@ var GuideUIModule = class {
|
|
|
1070
1075
|
*/
|
|
1071
1076
|
hide() {
|
|
1072
1077
|
this._isVisible = false;
|
|
1078
|
+
this._ageAsk = null;
|
|
1073
1079
|
this.activeTab = "SIGNALS";
|
|
1074
1080
|
this.searchQuery = "";
|
|
1075
1081
|
this.currentPage = 0;
|
|
@@ -1153,7 +1159,9 @@ var GuideUIModule = class {
|
|
|
1153
1159
|
isCreator: v.isCreator === true || v.type === "live",
|
|
1154
1160
|
channelId: v.channelId || slug,
|
|
1155
1161
|
duration: v.duration,
|
|
1156
|
-
requiresAuth: v.requiresAuth
|
|
1162
|
+
requiresAuth: v.requiresAuth,
|
|
1163
|
+
// An 18+ channel or one of its VODs (thestatic.tv's flag since 2026-10-15): it stays listed and asks first
|
|
1164
|
+
isNsfw: v.isNsfw === true
|
|
1157
1165
|
};
|
|
1158
1166
|
videos.push(mapped);
|
|
1159
1167
|
if (mapped.isLive) {
|
|
@@ -1175,7 +1183,8 @@ var GuideUIModule = class {
|
|
|
1175
1183
|
isCreator: v.isCreator,
|
|
1176
1184
|
channelId: v.channelId || v.id,
|
|
1177
1185
|
duration: v.duration,
|
|
1178
|
-
requiresAuth: v.requiresAuth
|
|
1186
|
+
requiresAuth: v.requiresAuth,
|
|
1187
|
+
isNsfw: v.isNsfw === true
|
|
1179
1188
|
}))
|
|
1180
1189
|
});
|
|
1181
1190
|
}
|
|
@@ -1198,11 +1207,30 @@ var GuideUIModule = class {
|
|
|
1198
1207
|
s(value) {
|
|
1199
1208
|
return Math.round(value * this.client.uiScale);
|
|
1200
1209
|
}
|
|
1210
|
+
/** The channel a yes covers: the entry's channel, else the entry itself */
|
|
1211
|
+
ageKey(video) {
|
|
1212
|
+
return video.channelId || video.id;
|
|
1213
|
+
}
|
|
1214
|
+
// An 18+ pick asks first (2026-10-15, Joseph's rule): until 2.8.0 every pick went to the scene at
|
|
1215
|
+
// once. An 18+ channel and its VODs stay in the lineup; before one reaches onVideoSelect (and the
|
|
1216
|
+
// client's own player behind it) the viewer chooses yes or no - no proof, nothing sent anywhere.
|
|
1217
|
+
// A yes covers that channel while the scene runs; a no plays nothing.
|
|
1201
1218
|
handleVideoSelect(video) {
|
|
1219
|
+
if (video.isNsfw && !this._ageYes.has(this.ageKey(video))) {
|
|
1220
|
+
this._ageAsk = video;
|
|
1221
|
+
return;
|
|
1222
|
+
}
|
|
1202
1223
|
if (this.config.onVideoSelect) {
|
|
1203
1224
|
this.config.onVideoSelect(video);
|
|
1204
1225
|
}
|
|
1205
1226
|
}
|
|
1227
|
+
answerAge(yes) {
|
|
1228
|
+
const video = this._ageAsk;
|
|
1229
|
+
this._ageAsk = null;
|
|
1230
|
+
if (!video || !yes) return;
|
|
1231
|
+
this._ageYes.add(this.ageKey(video));
|
|
1232
|
+
this.handleVideoSelect(video);
|
|
1233
|
+
}
|
|
1206
1234
|
handleChannelClick(video) {
|
|
1207
1235
|
const baseUrl = this.getBaseUrl();
|
|
1208
1236
|
const channelUrl = `${baseUrl}/${video.channelId || video.id}`;
|
|
@@ -1609,6 +1637,92 @@ var GuideUIModule = class {
|
|
|
1609
1637
|
]
|
|
1610
1638
|
});
|
|
1611
1639
|
}
|
|
1640
|
+
/** The 18+ question over the guide panel: MATURE CONTENT, the pick's name, YES or NO */
|
|
1641
|
+
renderAgeChoice(video) {
|
|
1642
|
+
const buttonW = this.s(170);
|
|
1643
|
+
const buttonH = this.s(44);
|
|
1644
|
+
return import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
1645
|
+
key: "age-choice",
|
|
1646
|
+
uiTransform: {
|
|
1647
|
+
positionType: "absolute",
|
|
1648
|
+
position: { top: 0, left: 0 },
|
|
1649
|
+
width: "100%",
|
|
1650
|
+
height: "100%",
|
|
1651
|
+
justifyContent: "center",
|
|
1652
|
+
alignItems: "center",
|
|
1653
|
+
// The cards under it take no clicks while it asks
|
|
1654
|
+
pointerFilter: "block"
|
|
1655
|
+
},
|
|
1656
|
+
uiBackground: { color: import_math3.Color4.create(0, 0, 0, 0.85) },
|
|
1657
|
+
children: [
|
|
1658
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
1659
|
+
uiTransform: {
|
|
1660
|
+
width: this.s(480),
|
|
1661
|
+
flexDirection: "column",
|
|
1662
|
+
alignItems: "center",
|
|
1663
|
+
padding: this.s(24),
|
|
1664
|
+
border: { top: 2, bottom: 2, left: 2, right: 2 },
|
|
1665
|
+
borderColor: THEME.colors.red
|
|
1666
|
+
},
|
|
1667
|
+
uiBackground: { color: THEME.colors.panel },
|
|
1668
|
+
children: [
|
|
1669
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
1670
|
+
uiTransform: { marginBottom: this.s(8) },
|
|
1671
|
+
uiText: { value: "MATURE CONTENT", fontSize: this.s(24), color: THEME.colors.red }
|
|
1672
|
+
}),
|
|
1673
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
1674
|
+
uiTransform: { marginBottom: this.s(12) },
|
|
1675
|
+
uiText: { value: truncateText(video.name || "Unknown", 40), fontSize: this.s(16), color: THEME.colors.cyan }
|
|
1676
|
+
}),
|
|
1677
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
1678
|
+
uiTransform: { width: "100%", marginBottom: this.s(20) },
|
|
1679
|
+
uiText: {
|
|
1680
|
+
value: "This channel is for viewers aged 18 and older. Are you 18 or older?",
|
|
1681
|
+
fontSize: this.s(UI_DIMENSIONS.guide.content.bodySize),
|
|
1682
|
+
color: THEME.colors.white,
|
|
1683
|
+
textAlign: "middle-center",
|
|
1684
|
+
textWrap: "wrap"
|
|
1685
|
+
}
|
|
1686
|
+
}),
|
|
1687
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
1688
|
+
uiTransform: { flexDirection: "row", justifyContent: "center", gap: this.s(16) },
|
|
1689
|
+
children: [
|
|
1690
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
1691
|
+
key: "age-yes",
|
|
1692
|
+
uiTransform: { width: buttonW, height: buttonH, justifyContent: "center", alignItems: "center" },
|
|
1693
|
+
uiBackground: { color: THEME.colors.red },
|
|
1694
|
+
onMouseDown: () => this.answerAge(true),
|
|
1695
|
+
children: [
|
|
1696
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
1697
|
+
uiText: { value: "YES, I AM 18+", fontSize: this.s(14), color: THEME.colors.white }
|
|
1698
|
+
})
|
|
1699
|
+
]
|
|
1700
|
+
}),
|
|
1701
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
1702
|
+
key: "age-no",
|
|
1703
|
+
uiTransform: {
|
|
1704
|
+
width: buttonW,
|
|
1705
|
+
height: buttonH,
|
|
1706
|
+
justifyContent: "center",
|
|
1707
|
+
alignItems: "center",
|
|
1708
|
+
border: { top: 1, bottom: 1, left: 1, right: 1 },
|
|
1709
|
+
borderColor: THEME.colors.gray
|
|
1710
|
+
},
|
|
1711
|
+
uiBackground: { color: THEME.colors.buttonBackground },
|
|
1712
|
+
onMouseDown: () => this.answerAge(false),
|
|
1713
|
+
children: [
|
|
1714
|
+
import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
|
1715
|
+
uiText: { value: "NO", fontSize: this.s(14), color: THEME.colors.white }
|
|
1716
|
+
})
|
|
1717
|
+
]
|
|
1718
|
+
})
|
|
1719
|
+
]
|
|
1720
|
+
})
|
|
1721
|
+
]
|
|
1722
|
+
})
|
|
1723
|
+
]
|
|
1724
|
+
});
|
|
1725
|
+
}
|
|
1612
1726
|
renderCloseButton() {
|
|
1613
1727
|
const closeSize = this.s(UI_DIMENSIONS.closeButton.size);
|
|
1614
1728
|
return import_react_ecs2.default.createElement(import_react_ecs2.UiEntity, {
|
package/dist/index.mjs
CHANGED
|
@@ -372,7 +372,9 @@ var SessionModule = class {
|
|
|
372
372
|
return this.client.keyType === "scene" ? "/scene-session" : "/session";
|
|
373
373
|
}
|
|
374
374
|
/**
|
|
375
|
-
* Get player wallet - prioritize config, fallback to runtime detection
|
|
375
|
+
* Get player wallet - prioritize config, fallback to runtime detection.
|
|
376
|
+
* Only the read-only getStats() query uses it (2.7.0): the session calls are signed and name
|
|
377
|
+
* no wallet, so the signer is the visitor.
|
|
376
378
|
*/
|
|
377
379
|
getWallet() {
|
|
378
380
|
const config = this.client.getConfig();
|
|
@@ -415,14 +417,12 @@ var SessionModule = class {
|
|
|
415
417
|
}
|
|
416
418
|
await this.initializeBounds();
|
|
417
419
|
try {
|
|
418
|
-
const walletAddress = this.getWallet();
|
|
419
420
|
const dclDisplayName = this.getDisplayName();
|
|
420
|
-
this.client.log(`Starting session
|
|
421
|
-
const response = await this.client.
|
|
421
|
+
this.client.log(`Starting session (signed) - name: ${dclDisplayName}`);
|
|
422
|
+
const response = await this.client.signedRequest(this.getEndpoint(), {
|
|
422
423
|
method: "POST",
|
|
423
424
|
body: JSON.stringify({
|
|
424
425
|
action: "enter",
|
|
425
|
-
walletAddress,
|
|
426
426
|
dclDisplayName,
|
|
427
427
|
metadata
|
|
428
428
|
})
|
|
@@ -474,7 +474,7 @@ var SessionModule = class {
|
|
|
474
474
|
this._outOfBoundsCount = 0;
|
|
475
475
|
}
|
|
476
476
|
try {
|
|
477
|
-
await this.client.
|
|
477
|
+
await this.client.signedRequest(this.getEndpoint(), {
|
|
478
478
|
method: "POST",
|
|
479
479
|
body: JSON.stringify({
|
|
480
480
|
action: "heartbeat",
|
|
@@ -499,7 +499,7 @@ var SessionModule = class {
|
|
|
499
499
|
}
|
|
500
500
|
if (this.sessionId) {
|
|
501
501
|
try {
|
|
502
|
-
await this.client.
|
|
502
|
+
await this.client.signedRequest(this.getEndpoint(), {
|
|
503
503
|
method: "POST",
|
|
504
504
|
body: JSON.stringify({
|
|
505
505
|
action: "leave",
|
|
@@ -953,6 +953,10 @@ var GuideUIModule = class {
|
|
|
953
953
|
this.searchQuery = "";
|
|
954
954
|
// Current video tracking (for "PLAYING" indicator)
|
|
955
955
|
this._currentVideoId = null;
|
|
956
|
+
// The 18+ question (2026-10-15): the pick it is asking about, and the channels answered yes
|
|
957
|
+
// while the scene runs - in memory only, nothing is sent or stored
|
|
958
|
+
this._ageAsk = null;
|
|
959
|
+
this._ageYes = /* @__PURE__ */ new Set();
|
|
956
960
|
// =============================================================================
|
|
957
961
|
// --- UI RENDERING ---
|
|
958
962
|
// =============================================================================
|
|
@@ -990,7 +994,8 @@ var GuideUIModule = class {
|
|
|
990
994
|
children: [
|
|
991
995
|
this.renderLeftPanel(),
|
|
992
996
|
this.renderRightPanel(),
|
|
993
|
-
this.renderCloseButton()
|
|
997
|
+
this.renderCloseButton(),
|
|
998
|
+
this._ageAsk ? this.renderAgeChoice(this._ageAsk) : null
|
|
994
999
|
]
|
|
995
1000
|
}) : null
|
|
996
1001
|
]
|
|
@@ -1022,6 +1027,7 @@ var GuideUIModule = class {
|
|
|
1022
1027
|
*/
|
|
1023
1028
|
hide() {
|
|
1024
1029
|
this._isVisible = false;
|
|
1030
|
+
this._ageAsk = null;
|
|
1025
1031
|
this.activeTab = "SIGNALS";
|
|
1026
1032
|
this.searchQuery = "";
|
|
1027
1033
|
this.currentPage = 0;
|
|
@@ -1105,7 +1111,9 @@ var GuideUIModule = class {
|
|
|
1105
1111
|
isCreator: v.isCreator === true || v.type === "live",
|
|
1106
1112
|
channelId: v.channelId || slug,
|
|
1107
1113
|
duration: v.duration,
|
|
1108
|
-
requiresAuth: v.requiresAuth
|
|
1114
|
+
requiresAuth: v.requiresAuth,
|
|
1115
|
+
// An 18+ channel or one of its VODs (thestatic.tv's flag since 2026-10-15): it stays listed and asks first
|
|
1116
|
+
isNsfw: v.isNsfw === true
|
|
1109
1117
|
};
|
|
1110
1118
|
videos.push(mapped);
|
|
1111
1119
|
if (mapped.isLive) {
|
|
@@ -1127,7 +1135,8 @@ var GuideUIModule = class {
|
|
|
1127
1135
|
isCreator: v.isCreator,
|
|
1128
1136
|
channelId: v.channelId || v.id,
|
|
1129
1137
|
duration: v.duration,
|
|
1130
|
-
requiresAuth: v.requiresAuth
|
|
1138
|
+
requiresAuth: v.requiresAuth,
|
|
1139
|
+
isNsfw: v.isNsfw === true
|
|
1131
1140
|
}))
|
|
1132
1141
|
});
|
|
1133
1142
|
}
|
|
@@ -1150,11 +1159,30 @@ var GuideUIModule = class {
|
|
|
1150
1159
|
s(value) {
|
|
1151
1160
|
return Math.round(value * this.client.uiScale);
|
|
1152
1161
|
}
|
|
1162
|
+
/** The channel a yes covers: the entry's channel, else the entry itself */
|
|
1163
|
+
ageKey(video) {
|
|
1164
|
+
return video.channelId || video.id;
|
|
1165
|
+
}
|
|
1166
|
+
// An 18+ pick asks first (2026-10-15, Joseph's rule): until 2.8.0 every pick went to the scene at
|
|
1167
|
+
// once. An 18+ channel and its VODs stay in the lineup; before one reaches onVideoSelect (and the
|
|
1168
|
+
// client's own player behind it) the viewer chooses yes or no - no proof, nothing sent anywhere.
|
|
1169
|
+
// A yes covers that channel while the scene runs; a no plays nothing.
|
|
1153
1170
|
handleVideoSelect(video) {
|
|
1171
|
+
if (video.isNsfw && !this._ageYes.has(this.ageKey(video))) {
|
|
1172
|
+
this._ageAsk = video;
|
|
1173
|
+
return;
|
|
1174
|
+
}
|
|
1154
1175
|
if (this.config.onVideoSelect) {
|
|
1155
1176
|
this.config.onVideoSelect(video);
|
|
1156
1177
|
}
|
|
1157
1178
|
}
|
|
1179
|
+
answerAge(yes) {
|
|
1180
|
+
const video = this._ageAsk;
|
|
1181
|
+
this._ageAsk = null;
|
|
1182
|
+
if (!video || !yes) return;
|
|
1183
|
+
this._ageYes.add(this.ageKey(video));
|
|
1184
|
+
this.handleVideoSelect(video);
|
|
1185
|
+
}
|
|
1158
1186
|
handleChannelClick(video) {
|
|
1159
1187
|
const baseUrl = this.getBaseUrl();
|
|
1160
1188
|
const channelUrl = `${baseUrl}/${video.channelId || video.id}`;
|
|
@@ -1561,6 +1589,92 @@ var GuideUIModule = class {
|
|
|
1561
1589
|
]
|
|
1562
1590
|
});
|
|
1563
1591
|
}
|
|
1592
|
+
/** The 18+ question over the guide panel: MATURE CONTENT, the pick's name, YES or NO */
|
|
1593
|
+
renderAgeChoice(video) {
|
|
1594
|
+
const buttonW = this.s(170);
|
|
1595
|
+
const buttonH = this.s(44);
|
|
1596
|
+
return ReactEcs2.createElement(UiEntity2, {
|
|
1597
|
+
key: "age-choice",
|
|
1598
|
+
uiTransform: {
|
|
1599
|
+
positionType: "absolute",
|
|
1600
|
+
position: { top: 0, left: 0 },
|
|
1601
|
+
width: "100%",
|
|
1602
|
+
height: "100%",
|
|
1603
|
+
justifyContent: "center",
|
|
1604
|
+
alignItems: "center",
|
|
1605
|
+
// The cards under it take no clicks while it asks
|
|
1606
|
+
pointerFilter: "block"
|
|
1607
|
+
},
|
|
1608
|
+
uiBackground: { color: Color43.create(0, 0, 0, 0.85) },
|
|
1609
|
+
children: [
|
|
1610
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
1611
|
+
uiTransform: {
|
|
1612
|
+
width: this.s(480),
|
|
1613
|
+
flexDirection: "column",
|
|
1614
|
+
alignItems: "center",
|
|
1615
|
+
padding: this.s(24),
|
|
1616
|
+
border: { top: 2, bottom: 2, left: 2, right: 2 },
|
|
1617
|
+
borderColor: THEME.colors.red
|
|
1618
|
+
},
|
|
1619
|
+
uiBackground: { color: THEME.colors.panel },
|
|
1620
|
+
children: [
|
|
1621
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
1622
|
+
uiTransform: { marginBottom: this.s(8) },
|
|
1623
|
+
uiText: { value: "MATURE CONTENT", fontSize: this.s(24), color: THEME.colors.red }
|
|
1624
|
+
}),
|
|
1625
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
1626
|
+
uiTransform: { marginBottom: this.s(12) },
|
|
1627
|
+
uiText: { value: truncateText(video.name || "Unknown", 40), fontSize: this.s(16), color: THEME.colors.cyan }
|
|
1628
|
+
}),
|
|
1629
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
1630
|
+
uiTransform: { width: "100%", marginBottom: this.s(20) },
|
|
1631
|
+
uiText: {
|
|
1632
|
+
value: "This channel is for viewers aged 18 and older. Are you 18 or older?",
|
|
1633
|
+
fontSize: this.s(UI_DIMENSIONS.guide.content.bodySize),
|
|
1634
|
+
color: THEME.colors.white,
|
|
1635
|
+
textAlign: "middle-center",
|
|
1636
|
+
textWrap: "wrap"
|
|
1637
|
+
}
|
|
1638
|
+
}),
|
|
1639
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
1640
|
+
uiTransform: { flexDirection: "row", justifyContent: "center", gap: this.s(16) },
|
|
1641
|
+
children: [
|
|
1642
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
1643
|
+
key: "age-yes",
|
|
1644
|
+
uiTransform: { width: buttonW, height: buttonH, justifyContent: "center", alignItems: "center" },
|
|
1645
|
+
uiBackground: { color: THEME.colors.red },
|
|
1646
|
+
onMouseDown: () => this.answerAge(true),
|
|
1647
|
+
children: [
|
|
1648
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
1649
|
+
uiText: { value: "YES, I AM 18+", fontSize: this.s(14), color: THEME.colors.white }
|
|
1650
|
+
})
|
|
1651
|
+
]
|
|
1652
|
+
}),
|
|
1653
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
1654
|
+
key: "age-no",
|
|
1655
|
+
uiTransform: {
|
|
1656
|
+
width: buttonW,
|
|
1657
|
+
height: buttonH,
|
|
1658
|
+
justifyContent: "center",
|
|
1659
|
+
alignItems: "center",
|
|
1660
|
+
border: { top: 1, bottom: 1, left: 1, right: 1 },
|
|
1661
|
+
borderColor: THEME.colors.gray
|
|
1662
|
+
},
|
|
1663
|
+
uiBackground: { color: THEME.colors.buttonBackground },
|
|
1664
|
+
onMouseDown: () => this.answerAge(false),
|
|
1665
|
+
children: [
|
|
1666
|
+
ReactEcs2.createElement(UiEntity2, {
|
|
1667
|
+
uiText: { value: "NO", fontSize: this.s(14), color: THEME.colors.white }
|
|
1668
|
+
})
|
|
1669
|
+
]
|
|
1670
|
+
})
|
|
1671
|
+
]
|
|
1672
|
+
})
|
|
1673
|
+
]
|
|
1674
|
+
})
|
|
1675
|
+
]
|
|
1676
|
+
});
|
|
1677
|
+
}
|
|
1564
1678
|
renderCloseButton() {
|
|
1565
1679
|
const closeSize = this.s(UI_DIMENSIONS.closeButton.size);
|
|
1566
1680
|
return ReactEcs2.createElement(UiEntity2, {
|
package/package.json
CHANGED