Configuration API

Here you will be able to find various configurations that can be done for webReader. If you cannot find what you're looking for, please contact us at moc.rekaepsdaer@troppus

General settings

Path: rsConf.general

Settings that affect the service in general.

  • cookieLifetime

    Description: How long the settings cookie should survive on the user’s computer, expressed in milliseconds. The default setting is just over four days. Set this to null in order to use a session-only cookie that is not stored on the user’s computer after the browser closes. Note! Some browsers have functionality for restoring previous sessions when starting. This might cause session-only cookies to be restored as well. This is something that is handled entirely by the browser and is not something ReadSpeaker can control.

  • cookieName

    Description: The name of the main cookie that will be used to store users’ personalized settings.

  • defaultSpeedValue

    Description: This is the default speed value sent to ReadSpeaker. This value is equal to the medium speed setting. Slow will be 25 units lower, relative to this default value and fast will be 25 units higher.

  • domain

    Description: The domain that is used for the calls to the ReadSpeaker servers.

  • popupCloseTime

    Description: Determines the amount of time the popup will be visible when the user has selected some text. Expressed in milliseconds.

  • subdomain

    Description: The sub-domain that is used for the calls to the ReadSpeaker servers.

  • syncContainer

    Description: Sets the type of element the sync tags will use. By default <font> is used in Interner Explorer and <rs:span> in other browsers.

Default settings

Path: rsConf.settings
The difference between configuration and settings is that configuration affects everyone that uses the service, whereas settings/properties only affect the current user in the current browser. (The words settings and properties are used interchangeably throughout this document.)
In this section you specify which default settings should be used, if the user has not yet made any active choices.

  • hl

    Description: Which highlighting style to use. Default setting is highlighting both word and sentence.

  • hlicon

    Description: Whether or not to display a popup button when selecting text on a web page. The popup button can be used to start the audio playback.

  • hlscroll

    Description: Whether or not to automatically scroll the page vertically when the reading has reached the bottom of the browser’s viewport.

  • hlsent

    Description: The color that will be used for highlighting sentences, expressed as a valid CSS color value.

  • hlspeed

    Description: The reading speed.

  • hltext

    Description: The color that will be used for the text in the highlighted elements, expressed as a valid CSS color value.

  • hltoggle

    Description: This setting toggles highlighting on or off (hlon or hloff). If set to off, it overrides the rsConf.settings.hl value.

  • hlword

    Description: The color that will be used for highlighting words, expressed as a valid CSS color value.

Phrases

Path: rsConf.phrases
The phrases section defines the translation of labels that are used in the user interface. Each supported language is defined in a separate object, defined by its five-letter countrylanguage code. For languages that have identical phrase sets a function can be used to return the language which serves as the basis for the current language, in order to avoid redundant entries.
Example:

window.rsConf = {
	phrases: {
		en_uk: {
			play: 'Play',
			...
			...
		},
		en_us: function() {
			return this.en_uk;
		}
	}
};

Or, alternatively, if you want to do this programmatically:

window.rsConf.phrases.en_us = function() {
	return window.rsConf.phrases.en_uk;
};

We will not list every single phrase, but we use American English, en_us, as the basis for all other languages. Consequently, en_us lists all phrases that are available for use.

    Callback

    Path: rsConf.cb
    The callback API can be used to trigger custom functions when certain pre-defined events occur. Inside the callback functions the context (the this keyword) is always set to the player element that triggered the event. Optionally, some events provide arguments as well.
    Example:

    window.rsConf = {
    	cb: {
    		ui: {
    			open: function() {
    				doSomething();
    			}
    		}
    	}
    };
    • ui.beforeclose

      Description: Fires immediately after the user clicks on the close button in the player before any native close events have taken place. Note that opening a new player while the previous player is playing does not trigger this event, it only responds to direct user interaction. The this keyword will refer to the container element of the closed player.

    • ui.close

      Description: Fires when the user clicks on the close button in the player and after all native close events have taken place. Note that opening a new player while the previous player is playing does not trigger this event, it only responds to direct user interaction. The this keyword will refer to the container element of the closed player.

    • ui.open

      Description: This event fires when the user opens a player, which happens when the user clicks on a listen button, it always fire before rsConf.cb.ui.play. The reference to this will refer to the container element of the current player.

    • ui.pause

      Description: Fires when the user clicks on the pause button. The this keyword will refer to the container element of the current player.

    • ui.play

      Description: Fires when the user clicks on a listen button, right after rsConf.cb.ui.open if the player was previously closed. Note that this event also fires when playback starts after the player has been paused or stopped. The this keyword will refer to the container element of the current player.

    • ui.progresschanged

      Description: Fires when everytime the progressbar is updated, either because the audio is playing or because the user drag’n’dropped the playhead to a new position. The new value (in percent) is provided as the only parameter.

    • ui.settingsopened

      Description: Fires when the user clicks on the settings button. In this case the this keyword will refer to the container element of the settings panel.

    • ui.stop

      Description: Fires when the user clicks on the stop button. The this keyword will refer to the container element of the current player.

    • ui.timeupdated

      Description: Fires continuously during audio playback.. The this keyword refers to the player’s container element.

    • ui.volumechanged

      Description: Fires when the user changes the volume.