PlayerApi. Android
Api to use inside player.
Get live stream
Get camera's live stream of chosen quality.
If request was successful you'll get url to play.
@GET(STREAMS)
suspend fun getStreams(
@Path(ID) id: String,
@Query(TYPE) type: String, // 'low' or 'high'
@Query(SOURCE) source: String?
): VMSStreamsResponse
Get archive stream
Get camera's archive stream.
If request was successful you'll get url to play.
If you need to cancel this request use cancelArchiveRequest() method with specified camera id.
@GET(ARCHIVE)
suspend fun getArchive(
@Path(ID) id: String,
@Query(START) start: String,
@Query(DURATION) duration: String = "36000",
@Query(SOURCE) source: String?
): VMSStreamsResponse
start
- a date from which this archive should play
Get url to download archive
Get url to download specific part of camera's archive.
After that you'll receive socket push with VMSArchiveLinkSocket
object with generated url for downloading.
If request was successful response will return VMSStatusResponse
.
@GET(CAMERAS_ARCHIVE_LINK)
suspend fun getArchiveLink(
@Path(ID) id: String,
@Query(FROM) from: String,
@Query(TO) to: String
): VMSStatusResponse
Move camera
Move camera to specific direction.
If request was successful response will return nil
.
@POST(CAMERAS_MOVE)
suspend fun moveCamera(@Path(ID) id: String, @Body ptz: Any): VMSStatusResponse
To use '@Body ptz: Any' see file PTZ.kt
Move camera to default
Move camera to initial position.
If request was successful response will return VMSStatusResponse
.
@POST(CAMERAS_MOVE_HOME)
suspend fun moveCameraHome(@Path(ID) id: String): VMSStatusResponse