Building your Experience Provider

To build your Experience Stream, you can use one of samples as starting point or build your own project. The steps are:

–          Add a new js file. If keyframes in your EP simply jumps in state between keyframes, you can save time by inheriting from rin.contracts.DiscreteKeyframeESBase (as described in Sample 2)

–          The experience providers should implement below public members.

 

Name Type Comments
load(experienceStreamId) method Load experience data during this call. Called only one. experienceStreamId param indicates the experience that’ll be played.
play(offset, experienceStreamId) method EP should play the contents at given time offset and experienceStreamId.
pause(offset, experienceStreamId) method EP should display the contents at given time offset and experienceStreamId and be in paused state.
unload() method Unload objects loaded in memory and release memory to prepare for removal from stage
getState() method Return one of valid states from rin.contracts.ExperienceStreamState enum. Values are: Closed, Buffering, Ready, Error. The initial default state should be Closed. The state moves to Buffering when loading is going on. Once the experience provider is ready to play, the state should change to Ready. If any error occurs during loading, the state should change to Error.
stateChangedEvent rin.contracts.Event Event to be triggered whenever experience provider state changes. The event args should be of type rin.contracts.ESStateChangedEventArgs
getUserInterfaceControl() method EP should return the HTML element where contents are displayed. If the EP has no user interface, return null.
onESEvent(sender, eventId, eventData) method This is an optional method to be implemented if communication across experience providers is needed. If implemented, this method is called by RIN core whenever an ES event is raised by other experience providers.
setVolume(baseVolume) Method This is an optional method to be implemented if the experience provider supports volume control
setIsMuted(value) Method This is an optional method to be implemented if the experience provider supports mute

 

–          The experience provider needs to be registered by calling below method:

 

rin.Ext.registerESFactory takes a unique provider ID as first param. To make the provider ID unique, use this suggested format <CompanyName>.Rin.<ProviderName>. The second parameter is factory function.

The factory function has 2 parameters. First one is “orchestrator” – this is a proxy object to host. See Communicating with RIN Core Host for details. The second parameter “esData” is javascript data object specific to the Experience Provider as given in the xrin JSON file.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s