SkmXmlApi

Public Member Functions | Properties | Events | List of all members
SkmXmlApi.Camera Class Reference

Skm Camera represents an Skm camera object More...

Inheritance diagram for SkmXmlApi.Camera:

## Public Member Functions
string | GetLiveUrl (bool analytics=false)
| Gets the live Rtsp url for a Skm camera More...
string | GetArchiveUrl (DateTime StartTime, DateTime EndTime, bool skipGaps=false)
| Gets the Rtsp Url for an archive time span. The times requested must be in Utc/Universal time. The method will create a single use ticket, that is a part of the returned string, on the Skm server. This Url/ticket is only good for ten seconds. More...
Bitmap | GetThumbnail ()
| Retrieves the thumbnail/snapshot for a specific device. This method will return a null Bitmap if there is an error. More...
byte[] | GetRawThumbnail ()
| Retrieves the thumbnail for a specific device More...
DownloadTask | StartDownloadMediaClip (string FilePath, DateTime StartTime, DateTime EndTime)
| Starts video export from the server. More...
Public Member Functions inherited from SkmXmlApi.SkmBase
| SkmBase (SkmSession Session)
| Constructor More...

## Properties
string | ThumbnailUrl`[get]`
| Gets the Url for the thumbnail of a Skm camera More...
MemoryStream | RawThumbnailStream`[get]`
| Retrieves the thumbnail for a specific device More...
string | TimeZone`[get]`
| Time zone name in IANA format (TZ database name). More...
SkmObject | Audio`[get, set]`
| Audio object corresponding to the camera. More...
Dictionary< string, string > | CameraData = new Dictionary<string, string>()`[get]`
| Camera metadata. Can contain the following keys: Id, Name, TimeZone, PTZ, MD, Analytics, GeoLat, GeoLong, GeoAlt, Location, Note, AudioId, AudioName, etc. More...
Properties inherited from SkmXmlApi.SkmObject
SkmObjectType | ObjectType`[get]`
| Skm resource object type More...
int | Id`[get]`
| Skm's object identifier More...
string | Name`[get, set]`
| The Skm name of the Skm object More...
string | Location`[get, set]`
| The user defined location of the Skm object More...
List< SkmPermissionList > | Roles`[get]`
| The user's roles that are associated to the resource More...
bool | IsPtz`[get]`
| Flag is set true if the camera is a PTZ device. More...
ObjectAttributes | Attributes`[get, protected set]`
| Skm object attributes. More...
Properties inherited from SkmXmlApi.SkmBase
SkmSession | Session`[get]`
| The current Skm session of the Skm object More...

## Events
EventHandler< DownloadProgressEventArgs > | DownloadMediaClipProgress
| Download video progress. More...

## Additional Inherited Members
Static Public Member Functions inherited from SkmXmlApi.SkmObject
static void | LoadFromXml (SkmObject SkmResource, XmlNode SkmObjectNode)
| Loads abstract resource data from Xml node into the current instance More...
Protected Attributes inherited from SkmXmlApi.SkmObject
SkmObjectType | m_objectType
| Skm resource object type More...
int | m_id = 0
| Skm's object identifier More...
string | m_name = ""
| The Skm name of the Skm object More...
string | m_location = ""
| The user defined location of the Skm object More...
List< SkmPermissionList > | m_roles = new List<SkmPermissionList>()
| The user's roles associated with the Skm resouce More...
bool | m_isPtz = false
| Flag if camera is a ptz device More...
Protected Attributes inherited from SkmXmlApi.SkmBase
SkmSession | m_session
| Reference to the Skm session of the object More...

## Detailed Description

Skm Camera represents an Skm camera object

## Member Function Documentation

## ◆ GetArchiveUrl()

string SkmXmlApi.Camera.GetArchiveUrl | ( | DateTime | StartTime,
|  | DateTime | EndTime,
|  | bool | skipGaps = `false`
| ) |  |

Gets the Rtsp Url for an archive time span. The times requested must be in Utc/Universal time. The method will create a single use ticket, that is a part of the returned string, on the Skm server. This Url/ticket is only good for ten seconds.

Parameters

  StartTime | Start time of the archive clip in Utc/Universal time
  EndTime | End time of the archive clip in Utc/Universal
  skipGaps | Skip archive gaps

Returns
  Rtsp Url of the requested archive clip

string url = string.Empty;
try
{
/* Get the archive Rtsp Url *&zwj;/
url = m_camera.GetArchiveUrl(StartTime, EndTime);
}
catch (SkmApiException ex)
{
ChangePlayerState(SkmPlayState.Error, ex.Message);
}
catch (Exception ex)
{
ChangePlayerState(SkmPlayState.Error, ex.Message);
}

## ◆ GetLiveUrl()

string SkmXmlApi.Camera.GetLiveUrl | ( | bool | analytics = `false` | ) |

Gets the live Rtsp url for a Skm camera

Parameters

  analytics | True for analytics

Returns
  Live Rtsp Url of the camera

string url = string.Empty;
try
{
/* Get the live Rtsp Url *&zwj;/
url = m_camera.GetLiveUrl();
}
catch (SkmApiException ex)
{
ChangePlayerState(SkmPlayState.Error, ex.Message);
}
catch (Exception ex)
{
ChangePlayerState(SkmPlayState.Error, ex.Message);
}

## ◆ GetRawThumbnail()

byte [] SkmXmlApi.Camera.GetRawThumbnail | ( |  | ) |

Retrieves the thumbnail for a specific device

Returns
  Raw bytes of the thumbnail, usually in Jpeg format

Bitmap image = null;
byte[] imageBytes = null;
/* Download the thumbnail bytes *&zwj;/
imageBytes = SkmCamera.GetRawThumbnail();
try
{
/* Load our image bytes into a Bitmap <em>&zwj;/
image = new Bitmap(new MemoryStream(imageBytes));
}
catch(Exception)
{
/</em> Suppress errors *&zwj;/
}

## ◆ GetThumbnail()

Bitmap SkmXmlApi.Camera.GetThumbnail | ( |  | ) |

Retrieves the thumbnail/snapshot for a specific device.
This method will return a null Bitmap if there is an error.

Returns
  Bitmap image of the thumbnail

Bitmap image = null;
try
{
/* Get our Bitmap thumbnail <em>&zwj;/
image = camera.GetThumbnail();
}
catch(Exception)
{
/</em> Suppress errors *&zwj;/
}

## ◆ StartDownloadMediaClip()

DownloadTask SkmXmlApi.Camera.StartDownloadMediaClip | ( | string | FilePath,
|  | DateTime | StartTime,
|  | DateTime | EndTime
| ) |  |

Starts video export from the server.

Parameters

  FilePath | Path and filename of where to store the media clip.
  StartTime | The UTC time of where the export should begin.
  EndTime | The UTC time of where the export should end.

## Property Documentation

## ◆ Audio

SkmObject SkmXmlApi.Camera.Audio
| get set

Audio object corresponding to the camera.

## ◆ CameraData

Dictionary<string, string> SkmXmlApi.Camera.CameraData = new Dictionary<string, string>()
| get

Camera metadata. Can contain the following keys: Id, Name, TimeZone, PTZ, MD, Analytics, GeoLat, GeoLong, GeoAlt, Location, Note, AudioId, AudioName, etc.

## ◆ RawThumbnailStream

MemoryStream SkmXmlApi.Camera.RawThumbnailStream
| get

Retrieves the thumbnail for a specific device

Returns
  Raw bytes of the thumbnail, usually in Jpeg format

Bitmap image = null;
MemoryStream imageBytes = null;
/* Download the thumbnail bytes *&zwj;/
imageBytes = SkmCamera.GetRawThumbnail();
try
{
/* Load our image bytes into a Bitmap <em>&zwj;/
image = new Bitmap(imageBytes);
}
catch(Exception)
{
/</em> Suppress errors *&zwj;/
}

## ◆ ThumbnailUrl

string SkmXmlApi.Camera.ThumbnailUrl
| get

Gets the Url for the thumbnail of a Skm camera

## ◆ TimeZone

string SkmXmlApi.Camera.TimeZone
| get

Time zone name in IANA format (TZ database name).

## Event Documentation

## ◆ DownloadMediaClipProgress

EventHandler<DownloadProgressEventArgs> SkmXmlApi.Camera.DownloadMediaClipProgress

Download video progress.

The documentation for this class was generated from the following file:

- src/SkmXmlApi/Camera.cs