@denevads/dnv-smo
v1.0.40
Published
SMO module
Downloads
140
Readme
Introduction
Communication interface library between an HTML5 object and the functions of a Digital Signage Player from DenevaDS CMS.
Here we define the use of the library and the functions provided by the library
Instalation
The library is intended to be used together with Angular, so if we do not have the Angular CLI in the system it is convenient to install it to initialize the project.
npm install -g @angular/cli
We start a test project called html-deneva in the path we are in.
ng new html-deneva
Once we have the basic structure of the project we can install the library in the project by executing the following line inside the project folder:
npm install @denevads/dnv-smo
Initialization
Once we have the Angular project initialized, we proceed to import the module.
Inside the app.module definition in the app folder, we import the library.
import { SMO } from '@denevads/dnv-smo/dist/smo';
and then add it as a provider in @NgModule
providers: [SMO]
Now all you have to do is add it to the Angular component and start using it.
Again in app.component we import the library
import { LogLevel, SMO } from '@denevads/dnv-smo/dist/smo'
And in the export of the AppComponent class, we add the constructor
constructor(private smo:SMO){ }
In this way we would already have available for use all the calls provided by the library using
this.smo.
Also in the import we have brought the enumeration of the log levels, which are used to log in the local storage. The usage would be as follows:
this.smo.smoCallBacks.smoLog('Test Message',LogLevel.Info);
Compilation and packaging.
In order for the project to run on a computer without problems, a couple of changes must be made to the default project code.
The first one is to modify the tsconfig.json so that the "target" is "ES5" instead of "ES2022".
And the second change is in the index file. Here we will do two things: -Delete the favicon import (in addition to deleting it from the file folder). -And we change the line
<base href="/">
to
<script>document.write('<base href="' + document.location + '" />');</script>
With these changes made, we can compile the project by executing the command line
ng b
This will generate a dist folder with the content of our compiled HTML5.
In order to upload it to the deneva player, we simply have to create a zip with the content in the root, and change the extension to
.wgt
npm run build npm login npm publish