Class TLocalMedia
The TLocalMedia object is responsible for delivering 1-to-1 targeted content, replacing the audio in the main player with the targeted media.
This is mostly used for advertisements, but can be used for news, weather, sports, etc.
Defined in: <class.localmedia.js>.
| Constructor Attributes | Constructor Name and Description |
|---|---|
| Field Attributes | Field Name and Description |
|---|---|
|
A flag to indicate that the LocalMedia system is in the process of shutting down
|
|
|
Maximum over run for overlay content (milliseconds)
|
|
|
Maximum under run for overlay content (milliseconds)
|
|
|
Minimum time interval between repeated playback of local media content (minutes)
|
|
|
Subscribe to the onDelayedData to re-process delayed data.
|
|
|
Subscribe to the onMediaEnd event to be notified as soon as overlay content ended.
|
|
|
Subscribe to the onMediaStart event to be notified as soon as overlay content is ABOUT to start.
|
|
|
Ad lengths to prebuffer
|
|
|
StreamAds PublisherID
|
|
|
If TRUE, allow video content.
|
| Method Attributes | Method Name and Description |
|---|---|
|
CheckTriggerLocalMedia(data)
Checks real-time data events to see if we can trigger a LocalMedia event.
|
|
|
Read the current started status.
|
|
|
Return registered video area DOM object.
|
|
|
PreQueueSpace(duration, mediatype, lagtime)
Signal to LocalMedia that content space will soon become available.
|
|
|
RegisterVideoArea(idVideo)
Register DIV or SPAN area where video advertisements can be displayed.
|
|
|
setVolume(volume)
Set the advertisement volume level
|
|
|
Start()
Call this method to start LocalMedia system.
|
|
|
Stop()
Stops the LocalMedia system.
|
|
|
TriggerOverlaySpace(duration, mediatype)
Signal to LocalMedia that advertisement space is available to be replaces with a local ad.
|
Field Detail
isShuttingDown
A flag to indicate that the LocalMedia system is in the process of shutting down
maxOverRun
Maximum over run for overlay content (milliseconds)
- Default Value:
- 1000
maxUnderRun
Maximum under run for overlay content (milliseconds)
- Default Value:
- 3000
minimumRepeatInterval
Minimum time interval between repeated playback of local media content (minutes)
- Default Value:
- 15
{YUI_EVENT}
onDelayedData
Subscribe to the onDelayedData to re-process delayed data. Data is usually delayed because overlay is still busy when data arrives.
Arguments passed back to the event handler function are:
Arguments passed back to the event handler function are:
- metadata - Media metadata array, containing information about delayed media.
{YUI_EVENT}
onMediaEnd
Subscribe to the onMediaEnd event to be notified as soon as overlay content ended. You usually need to unmute/show the player in this event.
No arguments passed back to the event handler.
No arguments passed back to the event handler.
{YUI_EVENT}
onMediaStart
Subscribe to the onMediaStart event to be notified as soon as overlay content is ABOUT to start. You usually need to mute/hide the player in this event.
Arguments passed back to the event handler function are:
Arguments passed back to the event handler function are:
- metadata - Media metadata array, containing information about overlay media (Usually Ad-information).
prebufferBuckets
Ad lengths to prebuffer
- Default Value:
- [15, 30]
publisherID
StreamAds PublisherID
- Default Value:
- null
videoMode
If TRUE, allow video content. False if we only use audio content. Set to 'onlyvideo' if you wish to only receive video content, no audio content.
- Default Value:
- auto
Method Detail
{bool}
CheckTriggerLocalMedia(data)
Checks real-time data events to see if we can trigger a LocalMedia event.
- Parameters:
- {array} data
- Mediadata array, raw data directly from player.
- Returns:
- {bool} Return true if a local media event was fired or if data event should be delayed.
{bool}
getStarted()
Read the current started status.
- Returns:
- {bool} Return True if LocalMedia system was started, False otherwise.
{DOM_Object}
getVideoArea()
Return registered video area DOM object.
- Returns:
- {DOM_Object} Returns the DOM object pointing to the registered video area (DIV or SPAN). Null if none registered.
PreQueueSpace(duration, mediatype, lagtime)
Signal to LocalMedia that content space will soon become available.
This allows LocalMedia to pre-buffer content for the available space.
- Parameters:
- {int} duration
- Duration of ad-space, in milliseconds
- {char} mediatype
- Type of content, i.e. A=Ads, N=News
- {int} lagtime
- Duration until ad-space will arrive, in milliseconds (i.e. how many milliseconds BEFORE the event is this fired).
RegisterVideoArea(idVideo)
Register DIV or SPAN area where video advertisements can be displayed.
- Parameters:
- {string} idVideo
- The DIV/SPAN DOM object ID where videos may be displayed.
setVolume(volume)
Set the advertisement volume level
- Parameters:
- {int} volume
- Volume level (0..100)
Start()
Call this method to start LocalMedia system.
When this is called, LocalMedia will start to pre-queue local content.
Stop()
Stops the LocalMedia system.
When this is called, LocalMedia will stop the pre-queue of local content, as well as
gracefully ignore requests to replace content.
TriggerOverlaySpace(duration, mediatype)
Signal to LocalMedia that advertisement space is available to be replaces with a local ad.
Note: The LocalMedia system may or may not replace the content in such a space. It should never be assumed that LocalMedia will ALWAYS replace content.
- Parameters:
- {int} duration
- Duration of ad-space, in milliseconds
- {char} mediatype
- Type of content, i.e. A=Ads, N=News