Network commands for Appspace App
This article lists the network commands that are available to invoke certain functions remotely via the network for the Appspace App in Interactive mode. The network commands can be used on the following operating environments:
- Android
- BrightSign
- Chrome OS
- iOS
- LG webOS
- MediaVue SureVue
- Universal Windows Platform (UWP)
Prerequisites
- Appspace App in Interactive mode.
- Administrator privilege.
- A WebSocket client application, or Packet Sender client application (UDP)
- Set the Remote.Enable player property to True on the Appspace App device, for network commands to function. Refer to Managing device properties and Device property dictionary.
Important
For MediaVue SureVue devices, the firewall must be disabled for network commands to function.
For BrightSign devices, UDP is supported.
Executing network commands
To execute network commands, you must connect to the Appspace App via a WebSocket protocol.
The required port for Appspace App is 55537.
You may use your desired WebSocket client application to invoke the commands. Below is an example using HTML Javascript:
// Create WebSocket connection. const socket = new WebSocket('ws://[device ip address]:55537'); // Connection opened socket.addEventListener('open', function (event) { socket.send('?remote=system'); }); // Listen for messages socket.addEventListener('message', function (event) { console.log('Message from server ', event.data); });
Listed below are the types of network commands currently available for the Appspace App:
System commands
Listed below are the available system commands to invoke a function in the Appspace App, via the following code:
?system=[action]
These are the available actions:
- Restart the Appspace App = restart
- Resync the Appspace App = resync
- Reset content in the Appspace App = reset-content
- Unregister the Appspace App = unregister
Example:
To restart the Appspace App, execute the following command:
?system=restart
Important
Executing system commands results in the Appspace App restarting, thus port 55537 must be opened again after the restart. This however does not apply when unregistering the Appspace App.
Channel functions
Listed below are the available commands to invoke channel specific functions in the Appspace App, via the following code:
?channel=[action]&[searchby]=[value after URI encode]
Important
You must URI encode text strings that contain unicode and non-latin characters before executing the commands.
For example:
Channel name: My Channel
Network command: ?channel=loadchannel&channelname=[channel name]
Network command to execute:
?channel=loadchannel&channelname=My%20Channel
Listed below are the network commands for channel specific functions.
Load channel
To load channels either by channel ID or channel name, execute the following commands:
by ID: ?channel=loadchannel&channelid=[ID]
Example:
?channel=loadchannel&channelid=52654
by Name: ?channel=loadchannel&channelname=[channel name]
Example:
?channel=loadchannel&channelname=Appspace%20App%20Devices
Load channel group
To load channel groups either by channel group ID or channel group name, execute the following commands:
By ID: ?channel=loadchannelgroup&channelgroupid=[ID]
Example:
?channel=loadchannelgroup&channelgroupid=52654
By Name: ?channel=loadchannelgroup&channelgroupname=[channel group name]
Example:
?channel=loadchannelgroup&channelgroupname=Appspace%20Business%20Solutions
Load live channel
To load live channels either by channel ID or channel name, execute the following commands:
By ID: ?channel=loadlivechannel&livechannelid=[ID]
Example:
?channel=loadlivechannel&livechannelid=0001
By Name: ?channel=loadlivechannel&livechannelname=[live channel name]
Example:
?channel=loadlivechannel&livechannelname=The%20Appspace%20Channel
Load EPG
To load the EPG data, execute the following command:
?channel=loadepg
Load Recently Added page
To load the Recently Added page, execute the following command:
?channel=loadrecent
Load Homepage
To load the homepage, execute the following command:
?channel=loadhome
Search
To search, execute the following command with a search keyword:
?channel=search&query=[keyword]
Example:
?channel=search&query=Appspace%20App
Note
You may test invoking network commands to your Appspace App device by installing the Chrome extension Simple WebSocket Client or Dark Websocket Terminal from the Chrome WebStore.
To test network commands on UDP devices such as BrightSign, use the Packet Sender application which can be downloaded from: https://packetsender.com/download
Enter the command line in the ASCII field, and click the HEX button, which will auto generate the Hex codes based on the ASCII Data.