### Configuration and Settings Endpoints Source: https://github.com/nepose/mag_software_portal/blob/master/docs/stbapi/v342/tutorial-howto-windows.html Manage system configurations and settings. ```APIDOC ## POST /api/config/read ### Description Reads a configuration value. ### Method POST ### Endpoint /api/config/read ### Parameters #### Request Body - **key** (string) - Required - The configuration key. ### Request Example ```json { "key": "some_setting" } ``` ### Response #### Success Response (200) - **value** (string) - The configuration value. #### Response Example ```json { "value": "some_value" } ``` ``` ```APIDOC ## POST /api/config/write ### Description Writes a configuration value. ### Method POST ### Endpoint /api/config/write ### Parameters #### Request Body - **key** (string) - Required - The configuration key. - **value** (string) - Required - The configuration value. ### Request Example ```json { "key": "some_setting", "value": "new_value" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates success or failure. #### Response Example ```json { "status": "success" } ``` ``` ```APIDOC ## POST /api/settings/screensaver/time ### Description Sets the screen saver timeout. ### Method POST ### Endpoint /api/settings/screensaver/time ### Parameters #### Request Body - **time** (integer) - Required - The screen saver timeout in seconds. ### Request Example ```json { "time": 300 } ``` ### Response #### Success Response (200) - **status** (string) - Indicates success or failure. #### Response Example ```json { "status": "success" } ``` ``` ```APIDOC ## POST /api/settings/powersave/time ### Description Sets the auto power down time. ### Method POST ### Endpoint /api/settings/powersave/time ### Parameters #### Request Body - **time** (integer) - Required - The auto power down time in minutes. ### Request Example ```json { "time": 60 } ``` ### Response #### Success Response (200) - **status** (string) - Indicates success or failure. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### Get Metadata Examples Source: https://github.com/nepose/mag_software_portal/blob/master/docs/stbapi/v344/gSTB.html Examples demonstrating how to parse metadata for both MP3 and ISO files using gSTB.GetMetadataInfo(). ```APIDOC ## Get Metadata Examples ### Description Examples demonstrating how to parse metadata for both MP3 and ISO files using `gSTB.GetMetadataInfo()`. ### Request Example **MP3 File Metadata Parsing:** ```javascript JSON.parse(gSTB.GetMetadataInfo()); ``` **ISO File Metadata Parsing:** ```javascript JSON.parse(gSTB.GetMetadataInfo()); ``` ### Response Example **MP3 File Metadata:** ```json { "album": "album_1", "album_artist": "artist_1", "artist": "artist_1", "comment": "", "composer": "", "copyright": "", "date": "2000", "disc": "", "encoder": "", "encoded_by": "", "filename": "", "genre": "", "language": "", "performer": "", "publisher": "publisher_1", "title": "track_9", "track": "9" } ``` **ISO File Metadata:** ```json { "infoType": "dvdinfo", "titleCount": 10, "infoCurtitle": 4, "titles": [ { "Titleduration": 15000, "chapterCount": 1, "chapters": [{"startTime": 0, "duration": 0}] }, { "Titleduration": 7459000, "chapterCount": 9, "chapters": [ {"startTime": 0, "duration": 916000}, {"startTime": 916000, "duration": 772000}, {"startTime": 1688000, "duration": 636000}, {"startTime": 2324000, "duration": 148000}, {"startTime": 2472000, "duration": 1208000}, {"startTime": 3680000, "duration": 796000}, {"startTime": 4476000, "duration": 884000}, {"startTime": 5360000, "duration": 1204000}, {"startTime": 6564000, "duration": 896000} ] }, { "Titleduration": 150000, "chapterCount": 1, "chapters": [{"startTime": 0, "duration": 151000}] }, { "Titleduration": 90000, "chapterCount": 1, "chapters": [{"startTime": 0, "duration": 91000}] }, { "Titleduration": 154000, "chapterCount": 1, "chapters": [{"startTime": 0, "duration": 155000}] }, { "Titleduration": 140000, "chapterCount": 1, "chapters": [{"startTime": 0, "duration": 141000}] }, { "Titleduration": 125000, "chapterCount": 1, "chapters": [{"startTime": 0, "duration": 126000}] }, { "Titleduration": 67000, "chapterCount": 1, "chapters": [{"startTime": 0, "duration": 68000}] }, { "Titleduration": 139000, "chapterCount": 1, "chapters": [{"startTime": 0, "duration": 140000}] }, { "Titleduration": 136000, "chapterCount": 1, "chapters": [{"startTime": 0, "duration": 137000}] } ] } ``` ``` -------------------------------- ### SecureMedia Daemon Command Line Examples (Shell) Source: https://github.com/nepose/mag_software_portal/blob/master/docs/stbapi/v342/tutorial-cas.html Provides example command-line arguments for starting the SecureMedia daemon (smdemon). These examples vary based on whether gSTB.SetCASParam was used to set server address and port. ```shell smdaemon -daemon -l 0 -auto_register smdaemon -daemon -l 0 -auto_register –rsurl serverAddr smdaemon -daemon -l 0 -auto_register –rsurl serverAddr:port ``` -------------------------------- ### Configuration and Settings Source: https://github.com/nepose/mag_software_portal/blob/master/docs/stbapi/v343/tutorial-howto-display.html Endpoints for managing various settings, including audio/video parameters, network configurations, and system behaviors. ```APIDOC ## Settings Management API ### Description Allows modification and retrieval of various device and application settings, including display, audio, network, and system behavior configurations. ### Method POST ### Endpoint /nepose/mag_software_portal/settings ### Parameters #### Request Body - **setting** (string) - Required - The name of the setting to modify (e.g., "SetVolume", "SetBrightness", "SetAspect", "SetMute", "SetLoop"). - **value** (any) - Required - The value to set for the specified setting. ### Request Example ```json { "setting": "SetVolume", "value": 80 } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### Start Internet Stream Playback with TimeShift in JavaScript Source: https://github.com/nepose/mag_software_portal/blob/master/docs/stbapi/v344/tutorial-howto-timeshift.html Examples of how to start playback of an internet stream using the TimeShift subsystem. It includes both a legacy method and the new recommended approach using `stbPlayerManager`. ```JavaScript // legacy gSTB.Play('extTimeShift ' + uri); // new recommended approach stbPlayerManager.list[0].play({uri: uri, solution: 'extTimeShift'}); ``` -------------------------------- ### Utility and Miscellaneous Functions Source: https://github.com/nepose/mag_software_portal/blob/master/docs/stbapi/v342/tutorial-howto-audio.html Endpoints for various utility functions, including virtual keyboard control, updates, and player initialization. ```APIDOC ## Utility and Miscellaneous Functions Endpoints ### Init Player * **Description**: Initializes the media player. * **Method**: POST * **Endpoint**: `/api/player/init` ### Hide Virtual Keyboard * **Description**: Hides the virtual keyboard if it is currently displayed. * **Method**: POST * **Endpoint**: `/api/keyboard/hide` ### Is Virtual Keyboard Active * **Description**: Checks if the virtual keyboard is currently active. * **Method**: GET * **Endpoint**: `/api/keyboard/is-active` * **Response**: * **isActive** (boolean) - True if the virtual keyboard is active, false otherwise. ### Is Virtual Keyboard Active Ex * **Description**: Checks if the virtual keyboard is active with extended status. * **Method**: GET * **Endpoint**: `/api/keyboard/is-active-ex` * **Response**: * **status** (object) - Extended status of the virtual keyboard. ### Ignore Updates * **Description**: Ignores available system updates. * **Method**: POST * **Endpoint**: `/api/system/ignore-updates` ### Load URL * **Description**: Loads a URL, potentially for streaming or web content. * **Method**: POST * **Endpoint**: `/api/system/load-url` * **Parameters**: * **url** (string) - Required - The URL to load. ### Send Event To Portal * **Description**: Sends an event to the portal application. * **Method**: POST * **Endpoint**: `/api/portal/send-event` * **Parameters**: * **event** (string) - Required - The event identifier. * **data** (object) - Optional - Additional data associated with the event. ### Service Control * **Description**: Controls a specific service. * **Method**: POST * **Endpoint**: `/api/system/service-control` * **Parameters**: * **serviceName** (string) - Required - The name of the service. * **action** (string) - Required - The action to perform (e.g., "start", "stop", "restart"). ### Reset User Filesystem * **Description**: Resets the user-specific filesystem. * **Method**: POST * **Endpoint**: `/api/filesystem/reset-user-fs` ### Rotate * **Description**: Rotates the display or content. * **Method**: POST * **Endpoint**: `/api/display/rotate` * **Parameters**: * **direction** (string) - Required - The rotation direction (e.g., "left", "right", "180"). ### Set Internal Portal Active * **Description**: Enables or disables the internal portal. * **Method**: POST * **Endpoint**: `/api/portal/set-internal-active` * **Parameters**: * **active** (boolean) - Required - True to enable, false to disable. ### Is Internal Portal Active * **Description**: Checks if the internal portal is active. * **Method**: GET * **Endpoint**: `/api/portal/is-internal-active` * **Response**: * **isActive** (boolean) - True if the internal portal is active, false otherwise. ### Is File UTF8 Encoded * **Description**: Checks if a file is UTF-8 encoded. * **Method**: GET * **Endpoint**: `/api/filesystem/is-file-utf8` * **Parameters**: * **path** (string) - Required - The path to the file. * **Response**: * **isUtf8** (boolean) - True if the file is UTF-8 encoded, false otherwise. ``` -------------------------------- ### STB DVB Channel List Get Channel Example Source: https://github.com/nepose/mag_software_portal/blob/master/docs/stbapi/v342/stbDvbChannelList.html JavaScript example illustrating how to retrieve detailed information for a specific channel from the STB DVB channel list using its index or ccid, and then playing the channel. ```javascript var channel1 = someChannelList.getChannel(5); var channel2 = someChannelList.getChannel('ccid:0.12.1'); // start playback gSTB.Play(channel1.uri); ``` -------------------------------- ### System Configuration and Settings Source: https://github.com/nepose/mag_software_portal/blob/master/docs/stbapi/v342/tutorial-keys.html Configure various system settings, including display, networking, and portal behavior. ```APIDOC ## POST /nepose/mag_software_portal/SetDisplayMode ### Description Sets the display mode (e.g., aspect ratio, resolution). ### Method POST ### Endpoint /nepose/mag_software_portal/SetDisplayMode ### Parameters #### Request Body - **mode** (string) - Required - The desired display mode (e.g., "16:9", "4:3", "auto"). ### Request Example ```json { "mode": "16:9" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ## POST /nepose/mag_software_portal/SetAspect ### Description Sets the aspect ratio for video playback. ### Method POST ### Endpoint /nepose/mag_software_portal/SetAspect ### Parameters #### Request Body - **aspect_ratio** (string) - Required - The desired aspect ratio (e.g., "16:9", "4:3"). ### Request Example ```json { "aspect_ratio": "16:9" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ## POST /nepose/mag_software_portal/SetBrightness ### Description Adjusts the screen brightness. ### Method POST ### Endpoint /nepose/mag_software_portal/SetBrightness ### Parameters #### Request Body - **level** (integer) - Required - The brightness level (e.g., 0-100). ### Request Example ```json { "level": 80 } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ## POST /nepose/mag_software_portal/SetContrast ### Description Adjusts the screen contrast. ### Method POST ### Endpoint /nepose/mag_software_portal/SetContrast ### Parameters #### Request Body - **level** (integer) - Required - The contrast level (e.g., 0-100). ### Request Example ```json { "level": 70 } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ## POST /nepose/mag_software_portal/SetSaturation ### Description Adjusts the screen saturation. ### Method POST ### Endpoint /nepose/mag_software_portal/SetSaturation ### Parameters #### Request Body - **level** (integer) - Required - The saturation level (e.g., 0-100). ### Request Example ```json { "level": 60 } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ## POST /nepose/mag_software_portal/SetHue ### Description Adjusts the screen hue. ### Method POST ### Endpoint /nepose/mag_software_portal/SetHue ### Parameters #### Request Body - **level** (integer) - Required - The hue level (e.g., 0-360). ### Request Example ```json { "level": 180 } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ## POST /nepose/mag_software_portal/SetChromaKey ### Description Configures chroma key settings. ### Method POST ### Endpoint /nepose/mag_software_portal/SetChromaKey ### Parameters #### Request Body - **color** (string) - Required - The chroma key color (e.g., "00FF00"). - **tolerance** (integer) - Optional - The tolerance for the chroma key. ### Request Example ```json { "color": "00FF00", "tolerance": 50 } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ## POST /nepose/mag_software_portal/SetAlphaLevel ### Description Sets the alpha transparency level. ### Method POST ### Endpoint /nepose/mag_software_portal/SetAlphaLevel ### Parameters #### Request Body - **level** (number) - Required - The alpha level (0.0 to 1.0). ### Request Example ```json { "level": 0.75 } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ## POST /nepose/mag_software_portal/SetTransparentColor ### Description Sets a transparent color for image or video. ### Method POST ### Endpoint /nepose/mag_software_portal/SetTransparentColor ### Parameters #### Request Body - **color** (string) - Required - The color to make transparent (e.g., "FFFFFF"). ### Request Example ```json { "color": "FFFFFF" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ## POST /nepose/mag_software_portal/SetInternalPortalActive ### Description Activates or deactivates the internal portal. ### Method POST ### Endpoint /nepose/mag_software_portal/SetInternalPortalActive ### Parameters #### Request Body - **active** (boolean) - Required - True to activate, false to deactivate. ### Request Example ```json { "active": true } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ## POST /nepose/mag_software_portal/SetWebCASLogging ### Description Enables or disables WebCAS logging. ### Method POST ### Endpoint /nepose/mag_software_portal/SetWebCASLogging ### Parameters #### Request Body - **enable** (boolean) - Required - True to enable logging, false to disable. ### Request Example ```json { "enable": true } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ## POST /nepose/mag_software_portal/SetCheckSSLCertificate ### Description Configures SSL certificate checking. ### Method POST ### Endpoint /nepose/mag_software_portal/SetCheckSSLCertificate ### Parameters #### Request Body - **check** (boolean) - Required - True to enable certificate checking, false to disable. ### Request Example ```json { "check": true } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ## POST /nepose/mag_software_portal/SetMulticastProxyURL ### Description Sets the URL for the multicast proxy. ### Method POST ### Endpoint /nepose/mag_software_portal/SetMulticastProxyURL ### Parameters #### Request Body - **url** (string) - Required - The multicast proxy URL. ### Request Example ```json { "url": "http://proxy.example.com:8080" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ## POST /nep ``` -------------------------------- ### System Information and Settings Source: https://github.com/nepose/mag_software_portal/blob/master/docs/stbapi/v344/tutorial-howto-player-legacy.html Endpoints for retrieving system information, managing system paths, and configuring various system settings. ```APIDOC ## Get Statistics ### Description Retrieves statistical information about the system. ### Method GET ### Endpoint /api/system/statistics ### Parameters None ### Response #### Success Response (200) - **statistics** (object) - An object containing various system statistics. #### Response Example ```json { "statistics": { "cpu_usage": "25%", "memory_usage": "60%" } } ``` --- ## Get Storage Info ### Description Retrieves information about the device's storage. ### Method GET ### Endpoint /api/system/storage ### Parameters None ### Response #### Success Response (200) - **storage** (object) - An object containing storage details. #### Response Example ```json { "storage": { "total_space": "100GB", "free_space": "50GB" } } ``` --- ## Get System Paths ### Description Retrieves the system's configured paths. ### Method GET ### Endpoint /api/system/paths ### Parameters None ### Response #### Success Response (200) - **paths** (object) - An object containing system path information. #### Response Example ```json { "paths": { "log_path": "/var/log", "config_path": "/etc/config" } } ``` --- ## Set Environment Variable ### Description Sets an environment variable on the system. ### Method POST ### Endpoint /api/system/setEnv ### Parameters #### Request Body - **name** (string) - Required - The name of the environment variable. - **value** (string) - Required - The value to set for the environment variable. ### Request Example ```json { "name": "MY_VAR", "value": "my_value" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### DVD Information Data Structure Example Source: https://github.com/nepose/mag_software_portal/blob/master/docs/stbapi/v344/stbPlayer.html An example of a JSON object detailing DVD information, including the total number of titles, the current title, and a list of individual titles. Each title contains duration and chapter information, with chapters having start times and durations. ```json { "infoType": "dvdinfo", "titleCount": 10, "infoCurtitle": 4, "titles": [ { "Titleduration": 15000, "chapterCount": 1, "chapters": [{ "startTime": 0, "duration": 0 }] }, { "Titleduration": 7459000, "chapterCount": 9, "chapters": [ { "startTime": 0, "duration": 916000 }, { "startTime": 916000, "duration": 772000 }, { "startTime": 1688000, "duration": 636000 }, { "startTime": 2324000, "duration": 148000 }, { "startTime": 2472000, "duration": 1208000 }, { "startTime": 3680000, "duration": 796000 }, { "startTime": 4476000, "duration": 884000 }, { "startTime": 5360000, "duration": 1204000 }, { "startTime": 6564000, "duration": 896000 } ] }, { "Titleduration": 150000, "chapterCount": 1, "chapters": [{ "startTime": 0, "duration": 151000 }] }, { "Titleduration": 90000, "chapterCount": 1, "chapters": [{ "startTime": 0, "duration": 91000 }] }, { "Titleduration": 154000, "chapterCount": 1, "chapters": [{ "startTime": 0, "duration": 155000 }] }, { "Titleduration": 140000, "chapterCount": 1, "chapters": [{ "startTime": 0, "duration": 141000 }] }, { "Titleduration": 125000, "chapterCount": 1, "chapters": [{ "startTime": 0, "duration": 126000 }] }, { "Titleduration": 67000, "chapterCount": 1, "chapters": [{ "startTime": 0, "duration": 68000 }] }, { "Titleduration": 139000, "chapterCount": 1, "chapters": [{ "startTime": 0, "duration": 140000 }] }, { "Titleduration": 136000, "chapterCount": 1, "chapters": [{ "startTime": 0, "duration": 137000 }] } ] } ``` -------------------------------- ### Configuration and Settings Source: https://github.com/nepose/mag_software_portal/blob/master/docs/stbapi/v343/tutorial-howto-player.html Endpoints for reading configuration files and applying various settings. ```APIDOC ## GET /api/config/ReadCFG ### Description Reads a configuration value from a specified configuration file. ### Method GET ### Endpoint /api/config/ReadCFG ### Parameters #### Query Parameters - **file** (string) - Required - The name of the configuration file. - **key** (string) - Required - The key of the configuration value to read. ### Response #### Success Response (200) - **value** (string) - The value of the configuration key. #### Response Example ```json { "value": "some_setting_value" } ``` ## POST /api/settings/SetBrightness ### Description Sets the screen brightness level. ### Method POST ### Endpoint /api/settings/SetBrightness ### Parameters #### Request Body - **level** (integer) - Required - The desired brightness level (e.g., 0-100). ### Request Example ```json { "level": 80 } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### Get device image description Source: https://github.com/nepose/mag_software_portal/blob/master/docs/stbapi/v342/gSTB.html Retrieves a description of the device's current image. This is useful for identifying the software version installed on the device. ```javascript // execution result '0.2.18-250' ``` -------------------------------- ### Get Video Information Example Source: https://github.com/nepose/mag_software_portal/blob/master/docs/stbapi/v343/stbPlayer.html This example demonstrates the structure of the `videoInfo` object, which provides details about the currently playing video. It includes the frame rate, encoded video width and height, and pixel aspect ratio coefficients (hPAR and vPAR) to calculate the correct aspect ratio. ```json { "frameRate": 25000, "width": 704, "height": 576, "hPAR": 12, "vPAR": 11 } ``` -------------------------------- ### Get Available Audio Output Instances Source: https://github.com/nepose/mag_software_portal/blob/master/docs/stbapi/v344/tutorial-howto-audio.html Retrieves a list of all available audio output instances in the system. This is typically the first step before interacting with any specific audio output. ```javascript console.log(stbAudioManager.list); ``` -------------------------------- ### GET /nepose/mag_software_portal/slice Source: https://github.com/nepose/mag_software_portal/blob/master/docs/stbapi/v344/stbDvbChannelList.html Retrieves a range of channels from the channel list, starting at a specified index and with a defined size. Use caution with large size values. ```APIDOC ## GET /nepose/mag_software_portal/slice ### Description Get channel range. Retrieves a specified number of channels starting from a given index. It is not recommended to use excessively large values for the `size` parameter. ### Method GET ### Endpoint /nepose/mag_software_portal/slice ### Parameters #### Query Parameters - **index** (number) - Required - range start position - **size** (number) - Required - range size ### Request Example ``` { "index": 0, "size": 10 } ``` ### Response #### Success Response (200) - **data** (Array.<[stbDvbChannelList~dvbChannelInfo]>) - An array of channel information objects within the specified range. #### Response Example ```json [ { "frequency": 650015, "inputIndex": 0, "id": "T2_11_650000", "type": 3, "scrambled": false, "name": "Інтер", "provider": "ZEONBUD", "isRadio": false, "channelNumber": 1, "uri": "dvb://T2_11_650000" } ] ``` ``` -------------------------------- ### System Paths and Information Source: https://github.com/nepose/mag_software_portal/blob/master/docs/stbapi/v344/tutorial-howto-pvr.html APIs for retrieving system paths and video information. ```APIDOC ## GET /api/system/paths ### Description Retrieves the system's important file paths. ### Method GET ### Endpoint /api/system/paths ### Parameters None ### Request Example None ### Response #### Success Response (200) - **systemPaths** (object) - An object containing various system paths. #### Response Example ```json { "systemPaths": { "logPath": "/var/log", "configPath": "/etc/config" } } ``` ``` ```APIDOC ## GET /api/video/info ### Description Retrieves information about the currently playing video. ### Method GET ### Endpoint /api/video/info ### Parameters None ### Request Example None ### Response #### Success Response (200) - **videoInfo** (object) - An object containing video playback details. #### Response Example ```json { "videoInfo": { "resolution": "1920x1080", "frameRate": 29.97, "codec": "H.264" } } ``` ``` -------------------------------- ### Update and Initialization Operations Source: https://github.com/nepose/mag_software_portal/blob/master/docs/stbapi/v344/tutorial-howto-smb-legacy.html Handles software updates and player initialization. ```APIDOC ## POST /nepose/mag_software_portal/IgnoreUpdates ### Description Instructs the system to ignore any pending software updates. ### Method POST ### Endpoint /nepose/mag_software_portal/IgnoreUpdates ### Parameters None ### Request Example None ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation (e.g., "success"). #### Response Example ```json { "status": "success" } ``` ## POST /nepose/mag_software_portal/InitPlayer ### Description Initializes the media player. ### Method POST ### Endpoint /nepose/mag_software_portal/InitPlayer ### Parameters None ### Request Example None ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation (e.g., "success"). #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### Get available playback speeds Source: https://github.com/nepose/mag_software_portal/blob/master/docs/stbapi/v343/stbPlayer.html Retrieves an array of all available playback speed values for the current media. This information is collected with some delay after playback starts. ```javascript const availableSpeeds = stbPlayer.speeds; console.log(availableSpeeds); ``` -------------------------------- ### Get Tuner Signal Level - JavaScript Source: https://github.com/nepose/mag_software_portal/blob/master/docs/stbapi/v343/tutorial-howto-dvb.html Retrieves and logs the current signal level of the tuner. This property access is straightforward and requires no additional setup. ```javascript console.log(tuner.signalLevel); ``` -------------------------------- ### Miscellaneous System Functions Source: https://github.com/nepose/mag_software_portal/blob/master/docs/stbapi/v343/tutorial-keys.html A collection of other useful system functions, including initializing players, checking file encodings, and managing portal activity. ```APIDOC ## InitPlayer ### Description Initializes the media player. ### Method POST ### Endpoint /api/player/initialize ### Parameters None ### Request Example (No request body) ### Response #### Success Response (200) - **status** (string) - Indicates success ('OK'). #### Response Example ```json { "status": "OK" } ``` ## IsFileUTF8Encoded ### Description Checks if a file is encoded using UTF-8. ### Method GET ### Endpoint /api/filesystem/file/utf8/check ### Parameters #### Query Parameters - **path** (string) - Required - The path to the file to check. ### Request Example (Query parameter in URL) `/api/filesystem/file/utf8/check?path=/mnt/usb/myfile.txt` ### Response #### Success Response (200) - **isUtf8** (boolean) - True if the file is UTF-8 encoded, false otherwise. #### Response Example ```json { "isUtf8": true } ``` ## IsInternalPortalActive ### Description Checks if the internal portal application is currently active. ### Method GET ### Endpoint /api/portal/internal/active/check ### Parameters None ### Request Example (No request body for GET) ### Response #### Success Response (200) - **isActive** (boolean) - True if the internal portal is active, false otherwise. #### Response Example ```json { "isActive": false } ``` ``` -------------------------------- ### Get Available Playback Speeds Source: https://github.com/nepose/mag_software_portal/blob/master/docs/stbapi/v344/stbPlayer.html Retrieves an array of all available playback speed values for the current media. This property is read-only and collected with some delay after playback start. ```javascript const availableSpeeds = stbPlayer.speeds; ``` -------------------------------- ### System and File Operations Source: https://github.com/nepose/mag_software_portal/blob/master/docs/stbapi/v342/tutorial-howto-audio.html Endpoints for managing system paths, files, directories, and application settings. ```APIDOC ## System and File Operations Endpoints ### Get System Paths * **Description**: Retrieves system-defined paths for storage and configuration. * **Method**: GET * **Endpoint**: `/api/system/get-system-paths` * **Response**: * **storagePath** (string) - The path to the storage directory. * **configPath** (string) - The path to the configuration directory. * **logPath** (string) - The path to the log directory. ### Is File Exist * **Description**: Checks if a file exists at the specified path. * **Method**: GET * **Endpoint**: `/api/filesystem/is-file-exist` * **Parameters**: * **path** (string) - Required - The full path to the file. * **Response**: * **exists** (boolean) - True if the file exists, false otherwise. ### Is Folder Exist * **Description**: Checks if a directory exists at the specified path. * **Method**: GET * **Endpoint**: `/api/filesystem/is-folder-exist` * **Parameters**: * **path** (string) - Required - The full path to the directory. * **Response**: * **exists** (boolean) - True if the directory exists, false otherwise. ### List Directory * **Description**: Lists the contents of a directory. * **Method**: GET * **Endpoint**: `/api/filesystem/list-dir` * **Parameters**: * **path** (string) - Required - The path to the directory. * **Response**: * **files** (array of objects) - An array of file and directory information. * **name** (string) - The name of the file or directory. * **type** (string) - "file" or "directory". * **size** (integer) - The size in bytes (for files). * **modified** (string) - The last modified timestamp. ### Read CFG File * **Description**: Reads the content of a configuration file. * **Method**: GET * **Endpoint**: `/api/config/read-cfg` * **Parameters**: * **key** (string) - Required - The key or filename of the configuration to read. * **Response**: * **value** (string) - The content of the configuration file. ### Save User Data * **Description**: Saves user-specific data. * **Method**: POST * **Endpoint**: `/api/user/save-user-data` * **Parameters**: * **data** (object) - Required - The user data to save. ### Load User Data * **Description**: Loads user-specific data. * **Method**: GET * **Endpoint**: `/api/user/load-user-data` * **Response**: * **data** (object) - The loaded user data. ``` -------------------------------- ### List Audio Outputs using stbAudioManager JavaScript Source: https://github.com/nepose/mag_software_portal/blob/master/docs/stbapi/v342/tutorial-howto-audio.html This snippet demonstrates how to list all available audio output instances in the system using the stbAudioManager. It shows how to access the first audio output and configure its mute and volume settings. Dependencies include stbAudioManager and stbPlayerManager. No specific inputs are required, and the output is a console log of the audio list and configured settings. ```javascript console.log(stbAudioManager.list); var audio = stbAudioManager.list[0]; audio.mute = false; audio.volume = 100; audio.add(stbPlayerManager.list[1]); audio.remove(stbPlayerManager.list[0]); console.log(audio.list); audio.clear(); ``` -------------------------------- ### Start Bluetooth Discovery and Get Devices Source: https://github.com/nepose/mag_software_portal/blob/master/docs/stbapi/v342/tutorial-howto-bluetooth.html This snippet shows how to initiate a Bluetooth device discovery scan for a specified duration and how to retrieve a list of all discovered devices. ```javascript stbBluetooth.startDiscovery({duration: 20}); console.log(stbBluetooth.devices); ``` -------------------------------- ### General Settings and Controls Source: https://github.com/nepose/mag_software_portal/blob/master/docs/stbapi/v344/tutorial-howto-nfs.html APIs for adjusting various system settings like volume, brightness, and display modes. ```APIDOC ## GET /api/settings/volume ### Description Gets the current volume level. ### Method GET ### Endpoint /api/settings/volume ### Parameters None ### Request Example ```json {} ``` ### Response #### Success Response (200) - **level** (integer) - The current volume level (0-100). #### Response Example ```json { "level": 50 } ``` --- ## POST /api/settings/set_volume ### Description Sets the volume level. ### Method POST ### Endpoint /api/settings/set_volume ### Parameters #### Request Body - **level** (integer) - Required - The desired volume level (0-100). ### Request Example ```json { "level": 75 } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` --- ## POST /api/settings/set_brightness ### Description Sets the screen brightness level. ### Method POST ### Endpoint /api/settings/set_brightness ### Parameters #### Request Body - **level** (integer) - Required - The desired brightness level (0-100). ### Request Example ```json { "level": 80 } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` --- ## POST /api/settings/set_display_mode ### Description Sets the display mode (e.g., aspect ratio, resolution). ### Method POST ### Endpoint /api/settings/set_display_mode ### Parameters #### Request Body - **mode** (string) - Required - The desired display mode (e.g., "16:9", "4:3", "1080p"). ### Request Example ```json { "mode": "16:9" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### DVB Channel Playback URL Example Source: https://github.com/nepose/mag_software_portal/blob/master/docs/stbapi/v342/dvbManager.html Demonstrates how to construct a URL to start playback of a DVB channel. The channel ID is dynamically obtained from DVB API calls. ```javascript dvb:// ``` -------------------------------- ### System Configuration API Source: https://github.com/nepose/mag_software_portal/blob/master/docs/stbapi/v344/tutorial-howto-web-browser.html Endpoints for configuring various system settings. ```APIDOC ## GET /api/system/GetSystemPaths ### Description Retrieves system-defined paths. ### Method GET ### Endpoint /api/system/GetSystemPaths ### Parameters None ### Response #### Success Response (200) - **paths** (object) - Contains various system paths. #### Response Example ```json { "paths": { "logPath": "/var/log", "dataPath": "/data" } } ``` ``` ```APIDOC ## POST /api/system/SetEnv ### Description Sets an environment variable. ### Method POST ### Endpoint /api/system/SetEnv ### Parameters #### Request Body - **name** (string) - Required - The name of the environment variable. - **value** (string) - Required - The value to set for the environment variable. ### Request Example ```json { "name": "MY_VAR", "value": "my_value" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ``` ```APIDOC ## POST /api/settings/SetVolume ### Description Sets the system volume level. ### Method POST ### Endpoint /api/settings/SetVolume ### Parameters #### Request Body - **level** (integer) - Required - The volume level (0-100). ### Request Example ```json { "level": 50 } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ``` ```APIDOC ## POST /api/settings/SetMute ### Description Mutes or unmutes the system audio. ### Method POST ### Endpoint /api/settings/SetMute ### Parameters #### Request Body - **mute** (boolean) - Required - True to mute, false to unmute. ### Request Example ```json { "mute": true } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### File Operations with gSTB.RDir Source: https://github.com/nepose/mag_software_portal/blob/master/docs/stbapi/v344/gSTB.html Examples of using gSTB.RDir for file operations, including getting file content, creating files, writing data to files, and removing files or directories. ```javascript // Get file content gSTB.RDir('/media/USB-DEVICE/file.txt'); // Expected output: 'some content' // Create a file in /mnt/Userfs/data and write data gSTB.RDir('permfile write log.txt "some data"'); // Expected output: 'Ok' on success // Remove a folder on a removable device gSTB.RDir('RemoveDirFull "path_to_folder"'); // Expected output: 'Ok' on success ``` -------------------------------- ### Get Available Playback Speeds Source: https://github.com/nepose/mag_software_portal/blob/master/docs/stbapi/v342/stbPlayer.html Retrieves an array of all available playback speed values for the current media. This information is collected with a delay after playback starts. This is a static, readonly property. ```javascript stbPlayer.speeds; ``` -------------------------------- ### Configuration and Settings Source: https://github.com/nepose/mag_software_portal/blob/master/docs/stbapi/v343/tutorial-howto-nfs.html Endpoints for reading configuration files and applying various settings. ```APIDOC ## ReadCFG ### Description Reads a configuration file. ### Method GET ### Endpoint /nepose/mag_software_portal/ReadCFG ### Parameters #### Query Parameters - **file** (string) - Required - The name of the configuration file to read (e.g., "settings.cfg"). ### Request Example ```json /nepose/mag_software_portal/ReadCFG?file=settings.cfg ``` ### Response #### Success Response (200) - **content** (string) - The content of the configuration file. #### Response Example ```json { "content": "setting1=value1\nsetting2=value2" } ``` ## SetEnv ### Description Sets an environment variable. ### Method POST ### Endpoint /nepose/mag_software_portal/SetEnv ### Parameters #### Request Body - **name** (string) - Required - The name of the environment variable. - **value** (string) - Required - The value to set for the environment variable. ### Request Example ```json { "name": "MY_VAR", "value": "my_value" } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the environment variable was set successfully. #### Response Example ```json { "success": true } ``` ``` -------------------------------- ### Player Initialization API Source: https://github.com/nepose/mag_software_portal/blob/master/docs/stbapi/v342/tutorial-howto-nfs.html Initializes the media player. ```APIDOC ## POST /nepose/mag_software_portal/InitPlayer ### Description Initializes the media player. ### Method POST ### Endpoint /nepose/mag_software_portal/InitPlayer ### Parameters None ### Request Example None ### Response #### Success Response (200) - **status** (string) - Indicates the success or failure of the operation (e.g., "success", "error"). #### Response Example ```json { "status": "success" } ``` ```