Skip to main content

proofOfPlay

The sos.proofOfPlay API provides methods for recording information about played content on the device.

Can be useful for tracking the playback of content, which can be used for analytics, reporting, or debugging purposes.

Methods

recordItemPlayed()

The recordItemPlayed() method dispatches a sos.command.dispatch() command. It sends provided information about played content along with additional metadata about current applet and device to signageOS.

recordItemPlayed(options: IRecordItemOptions): Promise<void>;

Params

NameTypeRequiredDescription
optionsIRecordItemOptions
Yes
The options for recording the played item.
options.namestring
Yes
The name of the item that was played.
options.customIdstring
No
An optional custom identifier for the item.
options.type"video" | "image" | "html" | "custom"
No
The type of the item that was played. It can be one of the following: video, image, html, or custom.
options.tagsstring[]
No
An array of tags associated with the item.
options.fileNamestring
No
The name of the file that was played.
options.playbackSuccessboolean
No
A boolean indicating whether the playback was successful.
options.errorMessagestring
No
An optional error message if the playback was not successful.

Return value

A promise that resolves when the item has been recorded.

Possible errors

If any of the provided options are invalid.

API Example

import { sos } from '@signageos/front-applet';

void sos.onReady(async () => {
await sos.proofOfPlay.recordItemPlayed({
name: 'generic-brand-christmas-coffee-ad',
customId: 'dBE43bFB3312VFfvd34bgGHJVV334cd2',
type: 'video',
tags: ['generic-brand', 'christmas'],
fileName: 'coffee.mp4',
playbackSuccess: false,
errorMessage: 'Unsupported framerate 60fps',
});
});