Manage Advertisement Mode
To configure advertisement mode via API, a video must be loaded on the device to enable it. If there isn't one, a new video can be uploaded using the send_video.fcgi
command. After that, the user can enable or disable the loaded video using the set_custom_video.fcgi
command.
The rules for video submission are:
- MP4 format
- Vertical video orientation - preferably 800x1280 dimension.
- Files under 20MB
Upload video remotely
To upload a new video to the device, the user can use the API, or choose to upload via Web or USB. However, via API, the maximum size of each request package is 2MB of data, so the upload must be done in fragments. The user must separate their video into blocks (2MB max) and send each part sequentially, in separate requests. To do this, they must work with the current and total parameters, explained below:
POST /send_video.fcgi
Parameters
- current (int) : corresponds to the value of the current part of the video being sent. Example: when sending a video file divided into 2 parts, the first submission must have the current value equal to 1 and the second submission equal to 2. (mandatory).
- total (int) : corresponds to the total number of parts that will be sent. Example: in the case of sending a file divided into 2 parts, the total number of parts is equal to 2, so the total must be equal to 2 (mandatory).
Example request
This request loads the video file onto the device. The request corresponds to the first submission of a file divided into 2 parts.
$.ajax({
url: "/send_video.fcgi?current=1&total=2&session=" + session
type: 'POST',
contentType: 'application/octet-stream',
data: [bytes of the video sent]
});
Response
- The return of the request is an empty json object.
Enable or disable advertisement mode
After sending the video, the user can choose to enable or disable advertisement mode via API.
POST /set_custom_video.fcgi
Parameters
- custom_video_enable (boolean) : Enables or disables advertisement mode. If enabling the mode without any video loaded, an error is returned. (mandatory):
Response
- The return of the request is an empty json object.
Example request
$.ajax({
url: "/set_custom_video.fcgi?session=session",
type: 'POST',
contentType: 'application/json',
data: JSON.stringify({
"custom_video_enabled": "1"
})
});
Hide items on the idle screen
If the user wants to hide items on the idle screen to display only the loaded video, it can be configured via API. To display hidden items, just click on the screen once.
The parameters are:
Parameters
- hide_control_bar (boolean) : Hides the control bar
- hide_clock (boolean) : Hides the clock
- hide_menu_button (boolean) : Hides the menu button
- hide_logo (boolean) : Hides the logo
- hide_device_name (boolean) : Hides the device name in online mode
- hide_call_buttons (boolean) : Hides the call buttons
Response
- The return of the request is an empty json object.
Example request
Hides all items on the idle screen:
$.ajax({
url: "/set_configuration.fcgi?session=" + session,
type: 'POST',
contentType: 'application/json',
data: JSON.stringify(
{
"video_player": {
"custom_video_enabled": "1",
"hide_clock": "1",
"hide_menu_button": "1",
"hide_logo": "1",
"hide_device_name": "1",
"hide_call_buttons": "1"
}
}
)
});
Remove custom video
If the user wants to remove the video loaded on the device, the following command is used:
POST /remove_custom_video.fcgi
Response
- The return of the request is an empty json object.
Example request
$.ajax({
url: "/remove_custom_video.fcgi?session=" + session,
type: 'POST',
contentType: 'application/json'
});