Class TDataPoller
Class to regularly check URL for changes in data
Used to synchronize both song and advertisement data when no in-stream metadata ability is available, when in-stream scripting is not available , i.e. for MP3 streams.
Defined in: <class.datapoller.js>.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
Construct a new TDataPoller object.
|
| Field Attributes | Field Name and Description |
|---|---|
|
The URL to check for new data.
|
|
|
Subscribe to the onDataChanged event to be notified as soon as data changes.
|
|
|
The polling interval in milliseconds, i.e.
|
|
|
If TRUE, a random string (&buster=
|
| Method Attributes | Method Name and Description |
|---|---|
|
Returns the current status of the object's data checking.
|
|
|
Start(doNow)
Start checking for new data.
|
|
|
Stop()
Stop checking for new data.
|
Field Detail
{string}
dataurl
The URL to check for new data. The URL must link to a javascript file with the appropriate callback method.
{YUI_EVENT}
onDataChanged
Subscribe to the onDataChanged event to be notified as soon as data changes.
Arguments passed back to the event handler function are:
Arguments passed back to the event handler function are:
- metadata - Media metadata array.
{int}
poll_interval
The polling interval in milliseconds, i.e. how long to wait between checks for new data.
- Default Value:
- 20000
{bool}
useCacheBuster
If TRUE, a random string (&buster=) will be appended to back of #dataurl to avoid browser cache issues.
- Default Value:
- true
Method Detail
{bool}
getStarted()
Returns the current status of the object's data checking.
- Returns:
- {bool} TRUE if actively checking for new data, FALSE of data checking is stopped.
Start(doNow)
Start checking for new data.
- Parameters:
- {bool} doNow
- If TRUE, immediately check for data. Otherwise first check will happen after #poll_interval.
Stop()
Stop checking for new data.