Skip to main content
Skip table of contents

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.

CODE
@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.

CODE
@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.

CODE
@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.

CODE
@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.

CODE
@POST(CAMERAS_MOVE_HOME)
suspend fun moveCameraHome(@Path(ID) id: String): VMSStatusResponse

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.