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.
|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.