Navori QL Player application is a media engine that plays back scheduled media from a central server application.Under certain circumstances, the customer may require the ability to interact with the engine without having to go through the Manager Interface. Media items that exist in the content library can be triggered from external sensors and devices such as: motion or RFID sensors, fire alarms, merchandise stock levels via POS systems, and more.
In this documentation, we provide both Windows OS and Android OS triggering application détails.
Windows OS:
Prerequisites:
.NET framework 4.0
IDE that supports use of Microsoft .NET DLL libraries (Visual Studio Express http://msdn.microsoft.com/)
Navori API DLL file, latest NavoriQLSdk.dll will be located in the root Navori folder on Windows
QL Player license with Trigger API add-on
Downloads:
The Navori API DLL file and Sample C# .NET code can be downloaded.
Development:
Use the provided DLL file in your .NET application
Copy Navori DLL file to your project folder
Add Navori DLL File to project references
Build your.NET application. The application can be developed as:
a stand-alone application installed on each PC running Navori QL Player software
a networked application with the central controller and remote clients installed on each PC running Navori QL Player software
Deployment:
Copy your application and the Navori Trigger DLL file (NavoriQLSdk.dll) to your QL Player directory
On 32-bit system: C:\Program Files\Navori\Navori QL Player
On 64-bit system: C:\Program Files (x86)\Navori\Navori QL Player
In QL Manager, create your trigger content in the “Trigger > Published” directory for you player’s group Send an update to your player in QL Manager
Test your application by changing media or playlist using your application and the Navori Trigger API
Android OS:
The Navori Android API is provided as an Android “BroadcastReceiver” embedded into the Navori Engine. This enables the developer to create a third-party application to interact with the Engine.
The package is available on demand. –NAVORI ANDROID API PACKAGE
PREREQUISITES AND API INSTALLATION
Any IDE which supports Java / Android API Development.
The package includes the “NavoriAPIThirdPartyBroadcastReceiver.java” file that provides the API interface, a sample project, and a compatible Navori Player installer.
APPLICATION DEVELOPMENT AND DEPLOYMENT USING THE API
The API is intended for use by application developers. Confirmation from Navori is required in order to obtain permission for deployment.
1. Principle Development
To enable communication with the player, you must add the “NavoriAPIThirdPartyBroadcastReceiver.java” file into your project and initiate a “NavoriAPIThirdPartyBroadcastReceiver” object.
The third party application must implement the “OnDataIsReadyListener” interface that will be used to notify the third party application that the data is ready to be used.
Call the “init” function with the context of your application and the “OnDataIsReadyListener” as parameters and you are ready to receive data from the Navori Engine and to call the API functions to control the Engine playback as shown in the sample project below.
2. API functions
Available data:
The data is transferred using basic types such as String, int, long and boolean.
Field long[] MediaIdArray :
The list of IDs for the available medias.
? Field String[] MediaNameArray :
The list of names for the available medias
? Field int[] MediaTypeArray :
The list of the type of available medias. 0=media, 1=template
? Field long[] MediaDurationArray :
The duration for the available medias.
? Field boolean[] MediaIsTriggerArray :
The list of flags from the available medias. To determine if it’s a Trigger media or a media scheduled into the planning.
? Field long[] PlaylistIdArray :
The list of IDs for the available playlists.
? Field String[] PlaylistNameArray :
The list of names for the available playlists.
? Field long[] PlaylistDurationArray :
The duration for the available playlists.
Interface to implement:
? public interface OnDataIsReadyListener
{
public void DataIsReady()
}
The third party application must implement the OnDataIsReadyListener interface.
DataIsReady() is called when the data is completely received from the Engine.
From there all the data and API functions are available.
From the Engine to the third party application functions:
? Function SendDataToThirdPart() :
This is the only function the Engine calls on the third party application.
The Navori Engine calls this function when the data is ready or when the data has just been updated or after the third party application calls the SynchronizeData() function.
From this function the API calls the DataIsReady() on the OnDataIsReadyListener, so that the third party application doesn’t need to handle the SendDataToThirdPart() function itself.
From the third party application to the Engine functions:
? Function SynchronizeData() :
Requests for an update of the data, the response will be by calling the SendDataToThirdPart() function
? Function PlayMedia(long MediaId, int MediaType, int nbLoop) :
Requests to play “nbLoop” loops the media.
Set “nbLoop” to 0 for an infinite playback that will end with the call of Release().
? Function PlayMediaList(long[] MediaIdList, int[] MediaTypeList, int nbLoop) :
Requests to play “nbLoop” loops the playlist previously formed by the media contained in the “MediaIdList” array.
Set “nbLoop” to 0 for an infinite playback that will end with the call of Release().
? Function PlayPlaylist(long PlaylistId, int nbLoop) :
Requests to play “nbLoop” loops the playlist.
Set “nbLoop” to 0 for an infinite playback that will end with the call of Release().
? Function PlayWebUrl(String url, long duration, int nbLoop):
Requests to play “nbLoop” loops the web URL “url” for a duration of “duration” ms each loop.
Set “nbLoop” to 0 for an infinite playback that will end with the call of Release().
? Function PlayStreamingUrl(String url, long duration, int nbLoop):
Requests to play “nbLoop” loops the streaming video whose URL is “url” for a duration of “duration” ms each loop.
Set “nbLoop” to 0 for an infinite playback that will end with the call of Release().
? Function Release() :
Frees the player which takes up the playback of the scheduled playlist at the media where it has been stopped (even if a number of loop has been set).
? Function CloseEngine() :
Closes the player, the Conductor will not restart the engine.
3. The sample application project
The NavoriAPIDemo project is available for Eclipse with the Android plugin.
The project includes the “NavoriAPIThirdPartyBroadcastReceiver.java” file and shows in the “MainActivity.java” file how to implement the “OnDataIsReadyListener” interface and how to use the “NavoriAPIThirdPartyBroadcastReceiver” object.
In the real world we probably want to trigger a media after a specific event like user interaction or a sensor’s detection.
In the demo project we only use timer events to trigger media to make it simple and universal.
The demo application starts a timer that plays every 30 seconds the next media in the media list (using the PlayMedia function) until it has played all the media, then it plays a web page (using the PlayWebUrl function) and finally it plays all the “trigger” media (using the PlayMediaList function) and returns to the beginning.
TRIGGER PLAYBACK AND NOTIFICATION API ON WINDOWS OS:
1.Notification callback API
The SDK client application must add event handlers for the void NewPlayingElement(object sender, NewPlayingElementEventArgs args); When a new media is started for playback by player, it calls this function back for all media, Triggerred or scheduled.When its called by player at the time when its starting to play a triggerred media, it sets the member variable m_IsTriggeredContent of NewPlayingElementEventArgs class to TRUE. For the rest of the cases it remains FALSE. The client application, when this callback is hit, should check the value of the member of args.m_IsTriggeredContent to test whether this callback is invoked due to Triggered contents.
2. Trigger Playback report from Trigger SDK
Usually the Triggered contents can be located in the Analytic section in QL manager, in form of aggregated information. But the same can be retrieved from the player SDK using below API:bool GetMediaLog(string mediaName, DateTime date, DateTime start, DateTime end, bool checkForTriggered);-mediaName is the name of content to check in history, its case sensitive
-date is the date for which day this information is to be retrieved
-start is the first value of time range in which the information will be searched
-end is the last value of the time range in which the information will be searched.
-checkForTriggered is the boolean value, if TRUE, then search is made only for triggered contents, else only for scheduled media.
return value is TRUE/FALSE, based on search, if at least 1 record is located.
Pre-Requisite for this API:
— Please enable QL Engine playback log in the NavoriQLEngine.config
<add key=”playback_log_enable” value=”true” />
— It works on Windows player v2.1+
