Video Inputs and Internal Ports
Display content from another device over HDMI, Display Port, or other port. PIP (Picture in Picture) functionality allows you to display content from the internal port while keeping signageOS on.
All methods
Methods | Description | Supported since |
---|---|---|
play() | Method for starting stream | 1.0.18 |
stop() | Method stops using the internal port. | 1.0.18 |
play()
Method uses the same API as video streams. Instead of URL (for stream), specify an URI of the port to display.
Parameters
Param | Type | Required | Description |
---|---|---|---|
uri | String | Yes | Internal port URI |
x | Number | Yes | x-position for video on screen |
y | Number | Yes | y-position for video on screen |
width | Number | Yes | Video width on screen |
height | Number | Yes | Video height on screen |
Javascript example
await sos.stream.play(uri, x, y, width, height);
GitHub Example
Valid URI values
Value | Description |
---|---|
internal://hdmi<number> | HDMI |
internal://dp | DisplayPort |
internal://dvi | DVI |
internal://pc | PC or VGA |
warning
<number>
has to be a value between 1 - 4, depending on which of the available HDMI ports you want to use.
stop()
Method stops using the internal port.
Parameters:
Param | Type | Required | Description |
---|---|---|---|
uri | String | Yes | Internal port URI |
x | Number | Yes | x-position for video on screen |
y | Number | Yes | y-position for video on screen |
width | Number | Yes | Video width on screen |
height | Number | Yes | Video height on screen |
Javascript example
await sos.stream.stop(uri, x, y, width, height);
Internal port events
API reacts to events related to changes in internal port status. Events are only emitted for a currently playing internal port.
Event | Description |
---|---|
disconnected() | Emmited when the port is disconnected or does not receive any signal |
connected() | Emmited when the port is re-connected or starts receiving signal again after being disconnected |
error() | Emmited when an error occurs, is emmited only once |
Usage with Typescript
You can also use all these methods with signageOS TypeScript.
onDisconnected(listener: (event: {
type: 'disconnected';
srcArguments: {
uri: string;
x: number;
y: number;
width: number;
height: number;
};
}) => void): void;
onConnected(listener: (event: {
type: 'connected';
srcArguments: {
uri: string;
x: number;
y: number;
width: number;
height: number;
};
}) => void): void;
onError(listener: (event: {
type: 'error';
srcArguments: {
uri: string;
x: number;
y: number;
width: number;
height: number;
};
errorMessage: string;
}) => void): void;
Errors
Although we are doing our best, following errors may occur when playing content from the internal ports.
Code | Type | Message |
---|---|---|
51501 | InternalVideoError | Couldn't play the video. |
51503 | InternalVideoError | Couldn't stop the video. |