Skip to content

Commit 3e2e2c8

Browse files
committed
Document selector filters batches and preview in the bundled skill
Repository: 105 files and 3032203 bytes before; 105 files and 3044454 bytes after. Plugin: 49 files and 1954187 bytes before; 49 files and 1962285 bytes after.
1 parent 514bcde commit 3e2e2c8

8 files changed

Lines changed: 263 additions & 113 deletions

File tree

‎components.lock.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"state": "resolved",
44
"cli": {
55
"repository": "screenrig/cli",
6-
"commit": "923fa0084f9268871a36b5e2a12946d2be7b5707",
6+
"commit": "8100954cc0a7eec8310148d310030166fa846037",
77
"artifact": {
88
"file": "screenrig-cli.tgz",
9-
"sha256": "cde4cdad5c9f1c32163869ac5f00af6b0ae1de58dc6a41f0b3520e88412b2e62"
9+
"sha256": "7fd6a0432d61004d59fcabd95a82066acb953553c074d1b48db426375648dd3a"
1010
}
1111
}
1212
}

‎plugins/screenrig/cli/dist/bin.js‎

Lines changed: 103 additions & 103 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎plugins/screenrig/skills/screenrig/SKILL.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,3 +518,5 @@ For current rates and terms, use [pricing](https://screenrig.ai/pricing/).
518518
For product questions use [product context](https://screenrig.ai/llms.txt), then
519519
[expanded context](https://screenrig.ai/llms-full.txt) if needed. These explain the
520520
product; the installed CLI and its responses determine available operations.
521+
522+
For dynamic media, use the tag filters, playback batches, and `media selector-preview` workflow in [playlists](references/playlists.md#tag-filters-and-playback-batches). Resolve catalog membership once per playlist loop; see that reference for cursor and static bundle behavior.

‎plugins/screenrig/skills/screenrig/references/media.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,10 @@ On a build that converts:
200200
object. Hyphens are rejected; `ExecIntro2026` is valid and `exec-intro`
201201
is not. `media list --tag TAG [--primitive image|video|audio]` filters by that tag
202202
and is the reliable filename → id map after upload.
203-
`media update <id> (--tag TAG | --clear-tag)` changes
204-
or clears it. Untagged objects are omitted when `--tag` is present on
203+
`media update <id> (--tag TAG | --tags TAG1,TAG2 | --clear-tag)`
204+
replaces or clears the whole tag set. Use `media selector-preview selector.json
205+
--primitive image|video` to inspect combined `all`/`any`/`none` tag filters
206+
before publishing; see [Playback batches](playlists.md#tag-filters-and-playback-batches). Untagged objects are omitted when `--tag` is present on
205207
`media list`.
206208
- The conversion runs `ffmpeg` and `ffprobe`. They must be on `PATH`, or their
207209
absolute paths must be in `SCREENRIG_FFMPEG` and `SCREENRIG_FFPROBE`.

‎plugins/screenrig/skills/screenrig/references/playlists.md‎

Lines changed: 73 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ linear gradient. The gradient is `{ "type": "linear", "stops": [...] }` with
175175
Selector `by` values:
176176

177177
- `id`: one ready `media_id`. `one_at_a_time` must be false.
178-
- `ids`: 1–32 unique ready IDs.
178+
- `ids`: 1–1,024 unique ready IDs.
179179
- `all`: every ready object of that primitive, image or video.
180180
- `tag`: ready objects of that primitive whose tag matches
181181
`^[A-Za-z0-9]{1,32}$`.
@@ -184,7 +184,7 @@ Selector `by` values:
184184
Players resolve all dynamic selectors together at playlist startup and each
185185
loop boundary. Uploads, removals and tag edits take effect on the next loop;
186186
the manifest revision stays stable. An empty match skips the primitive and
187-
any resulting empty page. Each selector resolves at most 32 ready items.
187+
any resulting empty page. Each selector resolves at most 1,024 ready items.
188188

189189
With `one_at_a_time: true`, each page appearance plays one item and advances
190190
a persistent cursor. With `false` on a `media_end` page, every matched item
@@ -606,3 +606,74 @@ UDP/MPEG-TS multicast. HLS is also supported on Web, Android, macOS, and Windows
606606
Every Player download is at https://screenrig.ai/downloads/ (Android on Google
607607
Play: https://play.google.com/store/apps/details?id=ai.screenrig.player). See https://screenrig.ai/docs/players.md for the
608608
platform matrix.
609+
610+
### Tag filters and playback batches
611+
612+
Media carries up to 32 unique tags, each 1–32 letters or digits. Replace the
613+
whole set with `screenrig media update med_ID --tags Summer,Drinks`.
614+
`--tag Summer` replaces it with one tag; `--clear-tag` clears every tag.
615+
`media list --tag Summer` matches membership anywhere in the set. Tags are
616+
case-sensitive and are never authorization.
617+
618+
A dynamic selector can use one `tag` or a `tags` filter object:
619+
620+
```json
621+
{
622+
"by": "tag",
623+
"tags": { "all": ["Summer", "Drinks"], "any": ["Lobby", "Patio"], "none": ["Expired"] },
624+
"order": "random",
625+
"one_at_a_time": false,
626+
"batch_size": 3
627+
}
628+
```
629+
630+
`all` requires every listed tag, `any` requires at least one, and `none`
631+
excludes any listed tag. Present groups combine with AND; omitted groups
632+
impose no condition. Supply at least one nonempty group. Each group accepts
633+
up to 32 unique tags. `tag` and `tags` are mutually exclusive. A `none`-only
634+
filter selects all ready media of that primitive except the excluded tags.
635+
Image selectors select images and video selectors select videos.
636+
637+
The candidate pool contains up to 1,024 ready media per selector, with 1,024
638+
media references across the complete loop snapshot. A larger match returns
639+
an error; narrow the filters. `batch_size` is a separate limit of 1–1,024
640+
items per page visit. On a `media_end` page, `one_at_a_time: false` plays the
641+
next batch in sequence; omitting `batch_size` plays the remaining pass.
642+
`one_at_a_time: true` plays one item per appearance and allows only an omitted
643+
batch size or `batch_size: 1`. Duration and application pages require
644+
`one_at_a_time: true`. Images on `media_end` also require `dwell_ms`; videos
645+
cannot loop on that page.
646+
647+
The Player resolves every dynamic media primitive in one request at playlist
648+
startup and at each loop boundary. Membership is frozen during the loop.
649+
Uploads, removals, and tagging changes do not regenerate the manifest.
650+
At the next refresh, removed or newly excluded items leave the pending queue;
651+
new matches join when the current pass finishes. A final batch may contain
652+
fewer than the requested number; it does not refill from the next pass.
653+
Filename order sorts by filename, then media ID. Random order shuffles once
654+
per complete pass, preserving the remaining order across loop refreshes.
655+
The cursor is local to the screen, playlist, page, and primitive, persists
656+
across restart, and resets when the filter, order, or batch policy changes.
657+
Offline playback uses the last successful snapshot. Empty matches skip the
658+
primitive and any resulting empty page.
659+
660+
Save the selector object above as `selector.json`, then inspect its current
661+
candidate catalog before publishing:
662+
663+
```sh
664+
screenrig media selector-preview selector.json --primitive video
665+
```
666+
667+
Preview returns `matched_count`, filename-ordered `candidates` with media
668+
IDs and tags, and the normalized `selector` policy. With random order it
669+
shows the pool and shuffle policy; it does not choose the Player's shuffle,
670+
advance a cursor, create a playback grant, or change a manifest. The API is
671+
`POST /api/v1/selectors/preview` with `{ "primitive": "video", "selector": ... }`.
672+
It uses the authenticated project and the same matching rules as playback.
673+
Catalog changes after preview are resolved at playback's next loop boundary.
674+
675+
Static bundle export freezes dynamic matches as exact IDs. It preserves
676+
one-at-a-time or complete-pass playback; a bounded runtime sequence using
677+
`batch_size` with `one_at_a_time: false` requires removing that field or
678+
choosing explicit IDs before export. This prevents silently losing a runtime
679+
batch cursor in a static bundle.

‎skills/screenrig/SKILL.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,3 +518,5 @@ For current rates and terms, use [pricing](https://screenrig.ai/pricing/).
518518
For product questions use [product context](https://screenrig.ai/llms.txt), then
519519
[expanded context](https://screenrig.ai/llms-full.txt) if needed. These explain the
520520
product; the installed CLI and its responses determine available operations.
521+
522+
For dynamic media, use the tag filters, playback batches, and `media selector-preview` workflow in [playlists](references/playlists.md#tag-filters-and-playback-batches). Resolve catalog membership once per playlist loop; see that reference for cursor and static bundle behavior.

‎skills/screenrig/references/media.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,10 @@ On a build that converts:
200200
object. Hyphens are rejected; `ExecIntro2026` is valid and `exec-intro`
201201
is not. `media list --tag TAG [--primitive image|video|audio]` filters by that tag
202202
and is the reliable filename → id map after upload.
203-
`media update <id> (--tag TAG | --clear-tag)` changes
204-
or clears it. Untagged objects are omitted when `--tag` is present on
203+
`media update <id> (--tag TAG | --tags TAG1,TAG2 | --clear-tag)`
204+
replaces or clears the whole tag set. Use `media selector-preview selector.json
205+
--primitive image|video` to inspect combined `all`/`any`/`none` tag filters
206+
before publishing; see [Playback batches](playlists.md#tag-filters-and-playback-batches). Untagged objects are omitted when `--tag` is present on
205207
`media list`.
206208
- The conversion runs `ffmpeg` and `ffprobe`. They must be on `PATH`, or their
207209
absolute paths must be in `SCREENRIG_FFMPEG` and `SCREENRIG_FFPROBE`.

‎skills/screenrig/references/playlists.md‎

Lines changed: 73 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ linear gradient. The gradient is `{ "type": "linear", "stops": [...] }` with
175175
Selector `by` values:
176176

177177
- `id`: one ready `media_id`. `one_at_a_time` must be false.
178-
- `ids`: 1–32 unique ready IDs.
178+
- `ids`: 1–1,024 unique ready IDs.
179179
- `all`: every ready object of that primitive, image or video.
180180
- `tag`: ready objects of that primitive whose tag matches
181181
`^[A-Za-z0-9]{1,32}$`.
@@ -184,7 +184,7 @@ Selector `by` values:
184184
Players resolve all dynamic selectors together at playlist startup and each
185185
loop boundary. Uploads, removals and tag edits take effect on the next loop;
186186
the manifest revision stays stable. An empty match skips the primitive and
187-
any resulting empty page. Each selector resolves at most 32 ready items.
187+
any resulting empty page. Each selector resolves at most 1,024 ready items.
188188

189189
With `one_at_a_time: true`, each page appearance plays one item and advances
190190
a persistent cursor. With `false` on a `media_end` page, every matched item
@@ -606,3 +606,74 @@ UDP/MPEG-TS multicast. HLS is also supported on Web, Android, macOS, and Windows
606606
Every Player download is at https://screenrig.ai/downloads/ (Android on Google
607607
Play: https://play.google.com/store/apps/details?id=ai.screenrig.player). See https://screenrig.ai/docs/players.md for the
608608
platform matrix.
609+
610+
### Tag filters and playback batches
611+
612+
Media carries up to 32 unique tags, each 1–32 letters or digits. Replace the
613+
whole set with `screenrig media update med_ID --tags Summer,Drinks`.
614+
`--tag Summer` replaces it with one tag; `--clear-tag` clears every tag.
615+
`media list --tag Summer` matches membership anywhere in the set. Tags are
616+
case-sensitive and are never authorization.
617+
618+
A dynamic selector can use one `tag` or a `tags` filter object:
619+
620+
```json
621+
{
622+
"by": "tag",
623+
"tags": { "all": ["Summer", "Drinks"], "any": ["Lobby", "Patio"], "none": ["Expired"] },
624+
"order": "random",
625+
"one_at_a_time": false,
626+
"batch_size": 3
627+
}
628+
```
629+
630+
`all` requires every listed tag, `any` requires at least one, and `none`
631+
excludes any listed tag. Present groups combine with AND; omitted groups
632+
impose no condition. Supply at least one nonempty group. Each group accepts
633+
up to 32 unique tags. `tag` and `tags` are mutually exclusive. A `none`-only
634+
filter selects all ready media of that primitive except the excluded tags.
635+
Image selectors select images and video selectors select videos.
636+
637+
The candidate pool contains up to 1,024 ready media per selector, with 1,024
638+
media references across the complete loop snapshot. A larger match returns
639+
an error; narrow the filters. `batch_size` is a separate limit of 1–1,024
640+
items per page visit. On a `media_end` page, `one_at_a_time: false` plays the
641+
next batch in sequence; omitting `batch_size` plays the remaining pass.
642+
`one_at_a_time: true` plays one item per appearance and allows only an omitted
643+
batch size or `batch_size: 1`. Duration and application pages require
644+
`one_at_a_time: true`. Images on `media_end` also require `dwell_ms`; videos
645+
cannot loop on that page.
646+
647+
The Player resolves every dynamic media primitive in one request at playlist
648+
startup and at each loop boundary. Membership is frozen during the loop.
649+
Uploads, removals, and tagging changes do not regenerate the manifest.
650+
At the next refresh, removed or newly excluded items leave the pending queue;
651+
new matches join when the current pass finishes. A final batch may contain
652+
fewer than the requested number; it does not refill from the next pass.
653+
Filename order sorts by filename, then media ID. Random order shuffles once
654+
per complete pass, preserving the remaining order across loop refreshes.
655+
The cursor is local to the screen, playlist, page, and primitive, persists
656+
across restart, and resets when the filter, order, or batch policy changes.
657+
Offline playback uses the last successful snapshot. Empty matches skip the
658+
primitive and any resulting empty page.
659+
660+
Save the selector object above as `selector.json`, then inspect its current
661+
candidate catalog before publishing:
662+
663+
```sh
664+
screenrig media selector-preview selector.json --primitive video
665+
```
666+
667+
Preview returns `matched_count`, filename-ordered `candidates` with media
668+
IDs and tags, and the normalized `selector` policy. With random order it
669+
shows the pool and shuffle policy; it does not choose the Player's shuffle,
670+
advance a cursor, create a playback grant, or change a manifest. The API is
671+
`POST /api/v1/selectors/preview` with `{ "primitive": "video", "selector": ... }`.
672+
It uses the authenticated project and the same matching rules as playback.
673+
Catalog changes after preview are resolved at playback's next loop boundary.
674+
675+
Static bundle export freezes dynamic matches as exact IDs. It preserves
676+
one-at-a-time or complete-pass playback; a bounded runtime sequence using
677+
`batch_size` with `one_at_a_time: false` requires removing that field or
678+
choosing explicit IDs before export. This prevents silently losing a runtime
679+
batch cursor in a static bundle.

0 commit comments

Comments
 (0)