0.0.7 • Published 1 year ago

@i2v/ngx-live-view v0.0.7

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

LibLiveView

npm i @i2v/ngx-live-view

This project was generated with Angular CLI version 12.2.13.

Building Library

During development the best way to consume our library is using npm link. This will allow us to symlink from a directory in our consuming application’s node modules folder to the compiled application in the library’s dist folder.

cd dist/ngx-live-view
npm link

We can link an Angular project to this library from anywhere our local machine. From the project root folder:

npm link ngx-live-view

If we now run the library with the watch flag,

ng build --watch

And at the same time run ng serve in another terminal window for our demo app.

ng serve

This will allow us to develop an application and (one or more) linked libraries simultaneously, and see the app recompile with each modification to the library’s source code.

Library Components

Import in main module

import { NgxLiveViewModule } from 'ngx-live-view';

The library contains the following components:

  • Video Grid

    • Grid
      • I2V Video Grid
        • Web Player
  • Event-Card

    • Event-Details
  • Tree-View

  1. Video-Grid

Input properties:

PropertyTypeDefaultDescriptionNecessity
ViewListany array-Grid Configuaration Layout.Optional
inputPlayVideoany-If any particulay video to play at Initialization.Optional
optionsCustomOption []-Custom Options to pass to Grid.Optional
themestringdarkTo change theme of Video Grid. (light)Optional
playDuplicatebooleanfalseTo play duplicate video in Grid.Optional
streamerIpstring-To play video from different streamer.Optional
playerserverIpstring-To play video from different player server.Optional
gridModestringgeneralTo change Grid Mode. (FRS - for frs)Optional
gridViewViewListModelGrid is Set for 2X2Passes Grid View Configuration to Event Card.Optional

Output callback Events:

CallbackDescription
VideoStartedThe callback that is called when an video is created.
VideoClosedThe callback that is called when an video is closed.
ClearGridEventThe callback that is called when we clear the Grid.
ClickFunctionThe callback that is called when we The callback that is called when an custom function is clicked

Example:

<div class="item2">
    <lib-video-grid [ViewList]=" {id: 2, Text: '2x1', heading: '2 cameras', Rows: 2, Cols: 1}, { id: 3, Text: '1 + 2', heading: '3 cameras', Rows: 2, Cols: 2,      hasSpecial: true, SpecialElement: 0, SEWidth: 2, SEHeight: 1, NumberofTiles: 3, }"
        [inputPlayVideo]="ExampleInputvideoObject"
        [theme]="light"
        [streamerIp]="192.168.x.x"
        [playerserverIp]="192.168.x.x"
        [gridMode]="FRS"
        [playDuplicate]="true"
        [options]="[{Title : 'clickSnapShot', Callback: 'snapshot', Icon :'camera_enhance'}]"
        [gridView]="{ id: 5,Text: '1 + 5',heading: '6 cameras',Rows: 3,      Cols: 3,
        hasSpecial: true,
        SpecialElement: 0,
        SEWidth: 2,
        SEHeight: 2,
        NumberofTiles: 6}"
        (VideoStarted)="onVideoStarted($event)"
        (ClearGridEvent)="GridClear()"
        (VideoClosed)="onVideoClosed($event)">
        (ClickFunction)="VideoGridFunctionCallback($event)">
        
    </lib-video-grid>
  </div>
  1. Event-Card

Input properties:

PropertyTypeDefaultDescriptionNecessity
queueLimitnumber10No. of events to be stored in Queue.Optional
toolbaroptionsCustomOption []-Custom Options to pass to Grid.Optional
filtersFilterModel []-Passes filter to Event Card.Optional
propertiesany[]-Passes properties to show in Event Card.Optional
cardOptionsCustomOption []-Passes options to show in Event Card.Optional

Output callback Events:

CallbackDescription
dblclickEventCardThe callback that is called when double click on Event Card
ClickFunctionThe callback that is called when an custom function is clicked

Example:

<div class="item3">
    <lib-event-card 
      (dblclickEventCard)="EventCardDblClickCallback($event)"
      (ClickFunction)="EventCardFunctionCallback($event)" 
      [queueLimit]="10" 
      [toolbarOptions]="[{ Title: 'clickSnapShot', Callback: 'snapshot', Icon: 'camera_enhance'}, { Title: 'clickSnapShot', Callback: 'snapshot', Icon: 'camera_enhance' }]"
      [filters]="[{ name: 'Area Name', type: 'multiselect', values: ['Area 1', 'Area 2', 'Area 3', 'Area 4']}, { name: 'Camera Name', type: 'array',values:['Camera1', 'Camera2', 'Camera3']
      }, { name: 'Wanted', type: 'boolean', values: ['true', 'false'] }, { name: 'Color', type: 'array', values: ['Red', 'Green', 'Blue'] }]" 
      [cardOptions]="[{ Title: 'clickSnapShot', Callback: 'snapshot', Icon: 'camera_enhance' }]">
      [properties]="['cameraName', 'areaName', 'time', 'color', 'wanted']"
    }" 
    </lib-event-card>

  </div>
  1. Tree-View

Input properties:

PropertyTypeDefaultDescription
queueLimitnumber10No. of events to be stored in Queue.
toolbarButtonstoolbarButtonsModel{"id": "refresh", "matIcon": "autorenew", "toolTip": "Refresh"}Passes Button to toolbar
availableGroupsany-Pass Availabale Group to Tree.
themestringdarkpasses theme to Tree

Output callback Events:

CallbackDescription
NodeSelectedThe callback that is called when select a node
NodeUnSelectedThe callback that is called when we unselect a node
NodeCheckedThe callback that is called when we check a node
NodeUnCheckedThe callback that is called when we uncheck a node
NodeSingleClickThe callback that is called when single click on Node
NodedoubleClickThe callback that is called when double click on node
NodeContextmenuClickedThe callback that is called when we click Context Menu
toolbarButtonClickedThe callback that is called when an toolabr custom function is clicked
NodeExpandThe callback that is called when we expand an node

Example:

<div class="item1" style="width: 15%;">
    <lib-tree-view [treeID]="treeId"
    [toolbarButtons]="toolbarButtons"
    (NodeSelected)="CallBackNodeSelected($event)"
    (NodeSingleClick)="CallBackNodeSingleClick($event)"
    (NodeDoubleClick)="CallBackNodeDoubleClick($event)"
    (NodeContextmenuClicked)="CallBackNodeRightClick($event)"
    (NodeExpand)="CallBackNodeExpanded($event)"

    ></lib-tree-view>
  </div>

Library Services

The library contains the following services:

  • Ngx-live-view.service
  • Tree-View.service
  1. Ngx-live-view.service

Subjects :

NameDescriptionModel
eventsCardsThe subject is used to pass events to event cardsIEvent[]
playVideoUsed to play video in Grids either on node drop or clicksplayVideo[]
notificationemitterUsed to emit notification from library to appNotificationModel[]
  1. Video-Grid.service

Methods :

NameDescription
resizerUsed to resize Grids
  1. Tree-View.service

Methods :

NameDescription
createNodeUsed to create Node
getTreeObjectUsed to get Tree Object as per Tree Id
getTreeNodeByParamUsed to get Tree Node By Param
insertNodesUsed to insert nodes
getTreeNodeByIdUsed to get Tree Node By Id
getTreeNodeByRandomIdUsed to get Tree Node By Random Id
getTreeNodeByNameUsed to get Tree Node By Name
isNodeCheckedUsed to check if Node is Checked
checkNodeUsed to Check Node
removeAllChildNodesUsed to remove all Child Node
selectNodeUsed to select node
getParentNodeUsed to get Parent Node
deleteNodeUsed to Delete Node
getFirstNodeUsed to get First Node
updateNodeUsed to update Nodes
deSelectAllNodesUsed to Deselect all Nodes as per Tree ID
deSelectNodeUsed to Deselect any Node as per Tree ID and node
isTreeIntilizedCheck If tree is initialized or not as per Tree ID
getAllNodesTo get all nodes of Any Tree ID
clearTreeIt clears the tree by destroying it and then recreating it.
getSelectedNodesGet the selected nodes from the tree object.

Library Models

The library contains the following Models:

  • IEventCard

  • CustomOption

  • treeToolbarButtonModel

  • ZTreeModel

  • FilterModel

  • NotificationModel

  • ViewListModel

0.0.5

1 year ago

0.0.4

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago