Programmatically controlling the RIN player

The state of a RIN player control can be manipulated programmatically. Consider the following example:


The code in the example executes when the HTML document is loaded. The code first calls rin.processAll to bind all RIN elements. It then looks up the first div element with ID “myrin” by an id and retrieves its associated RIN player control. Finally it invokes the players’ play and pause methods within the context of timer callback functions.
The RIN player control object has following public members:

Name Type Comment
play(offset, screenplayId)play() method Causes RIN to play. The offset parameter specifies the offset in seconds at which pay begins. The screenplayId parameter specifies a RIN Screenplay ID to play. If called with no parameters, the play method starts at the current position (which defaults to the beginning), and plays the current screenplay (which defaults to defaultScreenplayId as specified in the RIN data).
pause(offset, screenplayId)pause() method Causes RIN to pause. The parameters are same as in play method.
load(narrativeUrl, onComplete) method Loads the JSON RIN file located in the given narrativeUrl. onComplete callback is fired after load, if provided.
loadData(rinData, onComplete) method Loads JSON object passed as rinData. onComplete callback is fired after load, if provided.
getPlayerState() method Returns enumeration value of player state. The values under rin.contracts.PlayerState are : playing, pausedForBuffering, pausedForExplore, stopped, inTransition
getCurrentTimeOffset() method Returns current time offset in seconds.

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