MediaObjectVisibilityChangedPayload media.object.visibility_changed@1

Generated at from openvibe-contracts v0.34.2 and openvibe-sdk v0.5.0.

Version
1.0.0
Owner
media
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/events/payloads/media.object.visibility_changed.v1.json

media.object.visibility_changed v1 (OpenVibe.Media server/events.js objectChangeEvent and recordObjectChanges, commit 039dc48, from the media_object_changes rows that the AFTER UPDATE OF visibility trigger on media_objects writes). An object's visibility changed to another value (public, unlisted or private), by any write path: the v2 objects API, the inherited vods/clips/files rows it projects, or operator SQL. Never emitted when the value did not change, nor for an object that is deleted at the time of the change (that object's last word is media.object.deleted). The event exists if and only if the change committed: the trigger row and the outbox envelope are written in the transaction of the change, or by the relay's drain for a change made outside Media's own transactions. Consumers that hold a public copy, index entry or cache of the object re-check it (roadmap §29.3); a move away from public means stop showing it. Deliberately minimal, identity and state only: never the title, description or metadata, the owner's ids or subject, storage keys, paths or providers, sizes or hashes. Developer-project sandbox tenants produce none. Envelope: subject { type: object, id: <object_id> }, visibility internal, priority important, actor service:media.

Fields

FieldTypeRequiredDescriptionConstraints
object_idstringyes
  • pattern ^med_[0-9A-HJKMNP-TV-Z]{26}$
app_idstringyesThe tenant that owns the object: an app (live, tools…) or a developer project's production tenant (prj_…).
  • minLength 1
  • maxLength 200
kindenumyes
  • one of "vod", "clip", "file", "thumbnail", "screenshot", "avatar", "asset"
legacy_refstring | nullyesThe inherited row the object projects (legacy:<app>:<kind>:<id>, a media.media-ref@1 legacy id); null for a native v2 object.
  • maxLength 300
visibilityenumyesThe new value.
  • one of "public", "unlisted", "private"
previous_visibilityenumyesThe value before the change; never equal to visibility.
  • one of "public", "unlisted", "private"
changed_atstringyesWhen the change committed, ISO 8601 UTC.
  • format date-time

Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

Valid: clip-made-private
{
  "object_id": "med_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "app_id": "live",
  "kind": "clip",
  "legacy_ref": "legacy:live:clip:77",
  "visibility": "private",
  "previous_visibility": "public",
  "changed_at": "2026-09-24T01:02:03.000Z"
}
Valid: native-unlisted-to-public
{
  "object_id": "med_01JAB2C3D4E5F6G7H8J9K0MNPR",
  "app_id": "tools",
  "kind": "asset",
  "legacy_ref": null,
  "visibility": "public",
  "previous_visibility": "unlisted",
  "changed_at": "2026-09-24T01:02:03.000Z"
}
Rejected: deleted-is-not-a-visibility
{
  "object_id": "med_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "app_id": "live",
  "kind": "clip",
  "legacy_ref": null,
  "visibility": "deleted",
  "previous_visibility": "public",
  "changed_at": "2026-09-24T01:02:03.000Z"
}
Rejected: unchanged
{
  "object_id": "med_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "app_id": "live",
  "kind": "clip",
  "legacy_ref": null,
  "visibility": "unlisted",
  "previous_visibility": "unlisted",
  "changed_at": "2026-09-24T01:02:03.000Z"
}
Rejected: with-title
{
  "object_id": "med_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "app_id": "live",
  "kind": "vod",
  "legacy_ref": null,
  "visibility": "public",
  "previous_visibility": "private",
  "changed_at": "2026-09-24T01:02:03.000Z",
  "title": "My stream"
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('media.object.visibility_changed@1', value);   // { valid, errors: [{ path, message }] }