Skip to content

Exports ​

Exports are called as exports.np_screens:<name>(...). They are server-side, except the live channel exports, which exist on both sides. The audio channel exports (createAudioChannel, channelLoad, channelSetVolume …) for synced speaker playback are listed on their own page.

Server ​

server

Export Returns Description
GetBoard(surfaceId) table | nil The surface and what it shows: { contentId, revision, mode, snapshotUrl, descriptor, slideIndex, surface }
SetBoardContent(contentId, canvasJson, pngBytes?) ok, reason? Write a whiteboard canvas (Fabric JSON) as a new revision, with an optional PNG snapshot. Validated like an editor save. Stops any playback on the content
SetBoardMedia(contentId, url) ok, result | reason Resolve a link with the providers and show it. Yields until it is resolved (15 s deadline, then false, 'timed out')
ClearBoard(contentId) true Clear what the content shows
SetSlide(contentId, index) ok, reason? Go to a slide on a deck. index is 0-based and clamped to the deck. false, 'no_deck' when the content isn't a deck. Ignores the presenter lock
GrantAccess(contentId, identifier, level) ok, reason? Grant 'view', 'edit' or 'present' to a player identifier. false, 'invalid level' otherwise
RevokeAccess(contentId, identifier) true Drop that identifier's grant
SetBoardOwner(contentId, identifier) true Set the content owner. nil clears it. The owner has full access to the content
CastToNearestScreen(src, url) ok, message Cast a link as that player to the nearest screen they may present or edit on, with the same checks as the Cast app. Needs np_phone and Config.Cast.enabled. message is a localised sentence
StartBroadcast(src, channelId, mode?) ok, reasonKey? Put that player live on a live channel, with the channel's job and item checks. mode = 'tripod' = from their tripod
StopBroadcast(src) ok, reasonKey? End that player's broadcast
SetLiveGraphics(channelId, { headline, ticker }) boolean Set a live channel's lower third and ticker
GetLiveChannels() table Every live channel: { id, label, onAir, viewers, by, source, director, link }
GetLiveCameras(channelId) table A live channel's studio cameras and tripods: { id, label, kind, pose }

Changes made through exports are audited like any other and fire np_screens:updated with source 0. Exports don't check permissions: the calling resource decides who may do what.

lua
-- put the briefing deck on the board and jump to slide 3
local ok, err = exports.np_screens:SetBoardMedia('demo_briefing', 'https://docs.google.com/presentation/d/…/pub')
if ok then exports.np_screens:SetSlide('demo_briefing', 2) end

-- let a business owner run their own TV
exports.np_screens:SetBoardOwner('bean_machine_tv', xPlayer.identifier)

-- a "share to TV" option in another resource
local ok, msg = exports.np_screens:CastToNearestScreen(source, url)
TriggerClientEvent('chat:addMessage', source, { args = { 'Cast', msg } })

Identifiers are whatever the framework uses (the ESX identifier, the qb / qbx citizenid, or the license standalone), the same value /screens_grant stores.

Item callbacks ​

useRemoteItem and cinemaTicketUse are exported for np_inventory's item callbacks (server.export). np_screens registers them with np_inventory itself. Don't call them from your own code.