Poly Os API
PolyOS API exposes the API between PolyOs and 3rd party applications.
This API can be called from either com.poly.polyos.room.DeviceType.PRIMARY or com.poly.polyos.room.DeviceType.CONTROLLER device.
Setup
//Create PolyOsManager, the entry point to PolyOs API
polyOsManager = PolyOsManager(context)
//Notify PolyOS when app state changes
polyOsManager.notifyAppStateChanged(AppState(inCall = true))
//Access PolyOs methods through helper suspend function
val isMuted = polyOsManager { audioService.isMicrophoneMuted }
//Mute microphone
polyOsManager { audioService.muteMicrophone(true)}
//Use runWhenConnected to perform any initialization or registration each time when PolyOsManager is connected
polyOsManager.runWhenConnected {
//Register for audio notifications
audioService.registerAudioListener(audioListener)
//Register for messages
roomService.registerRoomListener(roomListener)
}
Content copied to clipboard
Getting PolyOS API
repositories {
maven {
url 'http://public.polyrepo.com/artifactory/poly-local/'
allowInsecureProtocol = true
}
}
dependencies {
implementation 'com.poly.polyos:polyos-library:#VERSION'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1"
}
Content copied to clipboard
Changelog4.2.0.0-9 (2024-02-14)
Add setPTZ, getPTZ to interface IPolyCameraService to easy camera control from Tencent Rooms App.
Created CameraPTZValue class to represents camera PTZ values. reset camera PTZ
//Create PolyOsManager, the entry point to PolyOs API
val polyOsManager = PolyOsManager(context)
//Obtain cameraService
val cameraService = polyOsManager.cameraService
//reset PTZ values
cameraService.moveToHomePosition(cameraId)
Content copied to clipboard
License
Packages
Link copied to clipboard
com.poly.polyos.PolyOsManager is the entry point to PolyOs API
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard