API: Check Current Audio Output
Allows you to check which audio output is currently in use by the device.
Requirements
- Integration of our JavaScript API into your webpage
- Sample code to run within the app and download for integration into your own project is available here.
- Best practices for working with the JavaScript API are available here.
- App Settings
- Content > JavaScript API > Access JavaScript API = By Import
Triggers via API Functions
Check Current Audio Output
This function determines which audio output is currently being used.
Format | kp_AudioSessionAPI_getCurrentAudioOutputPortType(callback); |
Parameters | callback - [string] the name of the callback to be triggered after the function has been executed |
Callback format | callback(outputPortTypeString); |
Callback return values | outputPortTypeString - [string] representing the current output type. Possible values are:
|
Notifications via API Callbacks
On Audio Output Change
This callback is triggered when the audio output has changed. For example, when headphones are plugged into the device.
Format | kp_AudioSessionAPI_audioOutputPortTypeDidChange(outputPortTypeString); |
Return values | outputPortTypeString - [string] representing the current output type. Possible values are:
|
Sample Code
- This sample code relies on the JavaScript APIs built into Kiosk Pro and will not run successfully in other browsers or within our in-app help interface.
- To run sample code, set the app's homepage to kioskgroup.com/audio-output-api
- To download a .zip of sample code, click here.
Change Log
- Added in version 9.0.7