Usage Examples
Features
- For instantiating the TimelineSDK, accessToken and cameraId is the required parameters, while all other parameters are optional
- The default value for isTimelineControlsVisible and isVerticalRecordingsVisible is true, which means by default the vertical recording bar and the bottom tab bar will be visible. We can hide it by setting these bool values as false.
- The TimelineSDK provides 3 levels of zoom from 0 to 2. 0 is the lowest zoom level that means No zoom and 2 is the maximum zoom level.
- In the most zoomed-in state, there will be three dots icon visible for each event. Users will be able to Download and Share through the three-dot menu.
- User can set the Primary and Secondary color in Hex string form. Eg: "#0c94c8" By default it will show the camera manager’s primary and secondary color i.e. primaryColor = @"#0c94c8" and secondaryColor = @"#333333".
- The SDK supports localizations, it will select the device language. The default language is English.
- The SDK supports Poppins and Default (Roboto) font. User can set the font while instantiating the SDK by settings customFont parameter. Eg: timelineObj.customFont = poppinsFont.
- The SDK supports hiding specific event types. Eg: timelineObj.hideEventTypes = @"vmdDetected,pirDetected"
Camera name can be hidden. Eg: timelineObj.isCameraNameVisible = NO;
Instantiation
#import <CMMobileTimelineSDK/CMMobileTimelineSDK.h>
@property (nonatomic, strong) CMMobileTimelineSDK *timeline;
_timeline = [_timelineObj initWithAccessToken:ACCESS_TOKEN cameraId:CAMERA_ID time:0 viewController:self];
_timeline.isTimelineControlsVisible = false;
_timeline.isVerticalRecordingsVisible = false;
_timeline.primaryColor = @"#0c94c8";
_timeline.secondaryColor = @"#333333";
_timeline.customFont = poppinsFont;
_timeline.zoomLevel = 1;
_timeline.hideEventTypes = @"vmdDetected,pirDetected";
_timeline.isCameraNameVisible = NO;
[_timeline present];
import CMMobileTimelineSDK
var timeline = CMMobileTimelineSDK(accessToken: ACCESS_TOKEN, cameraId: CAMERA_ID, time: 0, viewController: self)
timeline.isTimelineControlsVisible = false
timeline.isVerticalRecordingsVisible = false
timeline.primaryColor = @"#0c94c8"
timeline.secondaryColor = @"#333333"
timeline.customFont = poppinsFont
timeline.zoomLevel = 1
timeline.hideEventTypes = "vmdDetected,pirDetected"
timeline.isCameraNameVisible = false
timeline.present()
Parameter | Data Type | Description | Is Required |
---|---|---|---|
accessToken | String | Access Token required to passed for Authentication/authorization | true |
cameraId | Int | Camera Id to identify Camera | true |
startTime | Date | Start time for laoding events and recordings.Default value : Most recent date and time. | |
primaryColor | String | Takes hex value of color as string.Eg:timelineObj.primaryColor = "#0c94c8"; | |
secondaryColor | String | Takes hex value of color as string.Eg:timelineObj.secondaryColor = "#333333"; | |
customFont | FontType (enum) | Allows user to select default or poppins font. The dafault font is Roboto.Available font types:poppinsFont, defaultFontEg:timelineObj.customFont = poppinsFont;Default Font value: defaultFont | |
isTimelineControlsVisible | Bool | Set True/False to Show/Hide the bottom tab bar control on timeline screen.Eg: timelineObj.isTimelineControlsVisible = true;Default value: True | |
isVerticalRecordingsVisible | Bool | Set True/False to Show/Hide the vertical timeline recordings.Eg:timelineObj.isVerticalRecordingsVisible = false;Default value: True | |
zoomLevel | Int | Set the value from 0 to 2 to set the Zoom level, where 0 is No-zoom and 2 is the highest zoom level.Default value: 0 (No zoom) | |
albumName | String | To specify the album name for saving the Snapshots and downloaded events.Default album name is: Timeline | |
hideEventTypes | String | String of event types to hide (comma-separated).Eg: timelineObject.hideEventTypes = "vmdDetected,pirDetected" | |
isCameraNameVisible | Bool | Allows the user to hide Camera name.Default value: True |
Initialize the SDK
// Initialize timeline with the given parameters
// accessToken: Access token
// time: Timestamp of the time to show as selected time, default is current date & time - 0
// viewController: the viewController on the timeline is going to be presented
var timelineObj = CMMobileTimelineSDK(accessToken: "123-1234-2345", cameraId: 23443, time: 0, viewController: vc)
// Set zoom level
// available zoom levels are 0, 1, 2. Default=0
timelineObj.zoomLevel = 2
// Show or hide timeline controls (bottom bar)
timelineObj.isTimelineControlsVisible = false
// Show or hide vertical recordings line
timelineObj.isVerticalRecordingsVisible = false
// Set the primary color
timelineObj.primaryColor = "#000000"
// Set the secondary color
timelineObj.secondaryColor = "#FFFFFF"
// Set custom font
// Roboto: defaultFont
// Poppins: poppinsFont
timelineObj.customFont = poppinsFont
// Hide specific event types
timelineObj.hideEventTypes = @"vmdDetected,pirDetected"
// Hide camera name
timelineObj.isCameraNameVisible = false
// Present the timeline on the provided ViewController
timelineObj.present()
Authentication/Authorization
Set initialization parameter accessToken.
accessToken = ``"123-1234-2345"
Select Camera
Set initialization parameter cameraId.
cameraId = ``123455
Set Date-Time
Set initialization parameter time with seconds. - timestamp.
time = ``0
or ``1610368200
(in seconds)
Set Zoom Level
Available zoom levels are 0,1,2. Default = 0
timelineObj.zoomLevel = ``2
Set Colors
The default colors are primaryColor = "#0c94c8" and secondaryColor = "#333333"
// Set the primary color
timelineObj.primaryColor = "#000000"
// Set the secondary color
timelineObj.secondaryColor = "#FFFFFF"
Set Font Family
Available font families are Roboto and Poppins.
// Roboto: defaultFont
// Poppins: poppinsFont
timelineObj.customFont = poppinsFont
Hide Bottom Tab Bar GUI Component
timelineObj.isTimelineControlsVisible = ``false
Hide Vertical Recording Line GUI Component
timelineObj.isVerticalRecordingsVisible = ``false
Hide Specific Event Types
timelineObj.hideEvenTypes = ``"vmdDetected,pirDetected"
Hide Camera Name
timelineObj.isCameraNameVisible = ``false
Localization
Device language will be set by the SDK. Supported languages are English, Dutch, German, Spanish, Turkish. For unsupported language, the default language is English.
Updated over 1 year ago