FreeWheel HTML 5 AdManager

FreeWheel JavaScript AdManager requires Android 2.3+, iOS 6+, IE 9+ (DOCTYPE set to HTML5) or latest desktop version of Firefox/Safari/Chrome For detailed information on compatibility, please refer to the page: http://techhub.freewheel.tv/display/techdocs/JSAM+Compatibility+Status This file is the documentation of FreeWheel HTML 5 AdManager SDK.

Summary
FreeWheel HTML 5 AdManagerFreeWheel JavaScript AdManager requires Android 2.3+, iOS 6+, IE 9+ (DOCTYPE set to HTML5) or latest desktop version of Firefox/Safari/Chrome For detailed information on compatibility, please refer to the page: http://techhub.freewheel.tv/display/techdocs/JSAM+Compatibility+Status This file is the documentation of FreeWheel HTML 5 AdManager SDK.
Functions
setLogLevelSet the logLevel of a FreeWheel HTML5 SDK.
AdManagertv.freewheel.SDK
Functions
AdManagerConstruct a new tv.freewheel.SDK.AdManager instance.
setNetworkSet the network ID of the distributor.
setServerSet the ad server URL provided by FreeWheel.
setLocationSet the current geographic location of the device.
newContextConstruct a new tv.freewheel.SDK.Context instance.
newContextWithContextConstruct a new tv.freewheel.SDK.Context instance from the given Context instance.
ContextAn Context instance represents context of an ad request, which is capable of making ad request, parsing response and rendering ads.
Functions
addRendererAdd a renderer with loading URL and match conditions.
setCapabilitySet the capabilities supported by the player.
addKeyValueSet the key-value pair.
setParameterSet the parameters for a special level.
getParameterGet the parameter for a special level.
setVideoStateSet the video state.
getAdVolumeGets the volume of video/audio ads.
setAdVolumeSets the volume of video/audio ads.
registerVideoDisplayBaseRegister the display area for temporal ads display, the area, typically is a div or span, could be any other HTML element, must contains the video element of the content video.
setContentVideoElementSet the content video element.
resizeNotify AdManager that the player size changes so ad sizes can adjust accordingly
setVideoDisplayCompatibleSizesSet a list of acceptable alternative dimensions.
setProfileSet the profiles which describes the player.
setVideoAssetSet the video asset info for the ad request.
setVideoAssetCurrentTimePositionSet the current logical time position of the content asset.
setSiteSectionSet the site section info for the ad request.
setVisitorSet the visitor info for the ad request.
startSubsessionStart a subsession with the given token.
setRequestModeSet request mode of AdManager.
setRequestDurationSet the duration for which the player is requesting ads.
addCandidateAdAdd candidate ads for the request to FreeWheel Ad Server.
addTemporalSlotAdd a temporal slot.
getTemporalSlotsGet all the temporal slots from the response.
getSlotByCustomIdGet the slot specified by the custom ID.
getSlotsByTimePositionClassGet all slots in specified time position class.
submitRequestSubmit the ad request to the FreeWheel server which is set by tv.freewheel.SDK.AdManager.setServer.
addEventListenerAdd listener for a Context event.
removeEventListenerremove listener from a Context event.
disposeDispose this context instance.
loadExtensionLoad the extension from the given URL
Slottv.freewheel.SDK
Functions
getCustomIdGet the custom id of the slot.
getAdCountGet the count of the ads in the slot.
getTimePositionGet the time position of the slot.
getTimePositionClassGet the time position class of the slot.
getWidthGet the width of the slot.
getHeightGet the height of the slot.
getBaseGet the slot base of this slot.
getSignalIdGet the signal Id of the break.
playPlay the slot.
stopStop the slot.
pausePause the slot.
resumeResume the slot.
getParameterGet the parameter set on slot level.
setParameterSet the parameters in slot level.
getTotalDurationGet the duration in seconds of the slot.
getPlayheadTimeGet the playheadTime in seconds of the slot.
getAdInstancesGet all the playble ad instances in the slot.
setVisibleSet the visibility of a nontemporal slot.
skipCurrentAdSkip the currently playing ad and move to the next queued ad in the slot Fallback ads associated with the skipped ad will not be played
AdInstancetv.freewheel.SDK
Functions
getAdIdGet the FreeWheel ad ID of the ad instance.
getParameterGet the parameter set on AdInstance level.
getUniversalAdIdGet the universal ad ID of the ad instance.
getSoAdUnitGet the soAdUnit of the ad instance.
getActiveCreativeRenditionGet the active creative rendition.
addCreativeRenditionCreate a creative rendition clone for translation, and add it to current ad’s creative rendition array.
getAllCreativeRenditionsGet all the creative renditions of the ad instance.And the primary creative rendition is the first element in the returned array.
getRenderableCreativeRenditionsGet renderable creative renditions.
setActiveCreativeRenditionSet active creative rendition.
getEventCallbackUrlsGet the callback urls for a specific event.
addEventCallbackUrlAdd the callback url to a specific event.
setClickThroughUrlSet the click through url.
getSlotGet the slot of the ad.
getCompanionAdInstancesGet the playable companion ad instances.
isRequiredToShowWhether the ad is required to be shown by law, usually the ad is a companion ad.
getRendererControllerGet the rendererController object for this AdInstance.
getPlayheadTimeGet the ad instance playheadTime
CreativeRenditiontv.freewheel.SDK
Functions
getContentTypeGet the content type of the creative rendition.
setContentTypeSet the content type of the creative rendition.
getWrapperTypeGet the wrapper type of the creative rendition.
setWrapperTypeSet the wrapper type of the creative rendition.
getWrapperUrlGet the wrapper url of the creative rendition.
setWrapperUrlSet the wrapper url of the creative rendition.
getBaseUnitGet the base unit of the creative rendition.
getPreferenceGet the preference of the creative rendition.
setPreferenceSet the preference of the creative rendition.
getWidthGet the width of the creative rendition.
setWidthSet the width of the creative rendition.
getHeightGet the height of the creative rendition.
setHeightSet the height of the creative rendition.
getDurationGet the duration of the creative rendition.
setDurationSet the duration of the creative rendition.
getParameterGet the value of the specific parameter name.
setParameterSet the specific parameter of the creative rendition.
addCreativeRenditionAssetAdd a creative rendition asset to the this creative rendition.
getPrimaryCreativeRenditionAssetGet the primary asset of the creative rendition.
getOtherCreativeRenditionAssetsGet other creative rendition assets.
getCreativeApiGet the creativeApi name of the creative rendition.
CreativeRenditionAssettv.freewheel.SDK
Functions
getNameGet the name of the creative rendition asset.
setNameSet the name of the creative rendition asset.
getUrlGet the url of the creative rendition asset.
setUrlSet the url of the creative rendition asset.
getContentGet the content of the creative rendition asset.
setContentSet the content of the creative rendition asset.
getContentTypeGet the content type of the creative rendition asset.
setContentTypeSet the content type of the creative rendition asset.
getMimeTypeGet the mime type of the creative rendition asset.
setMimeTypeSet the mime type of the creative rendition asset.
getBytesGet the size of the creative rendition asset in bytes.
setBytesSet the size of the creative rendition asset in bytes.
RendererRenderer interface to be implemented.
Functions
startNotify the renderer to start ad playback.
stopNotify the renderer to stop ad playback.
pauseNotify the renderer to pause ad playback.
resumeNotify the renderer to resume ad playback.
infoGet the module info of renderer.
getPlayheadTimeGet the ad playheadTime
getDurationGet the duration of the ad.
resizeResize the ad
setVolumeSet the volume of the ad When called, the renderer is expected to update the volume for the current ad playback and dispatch `EVENT_AD_VOLUME_CHANGE` by calling RendererController.processEvent({name:EVENT_AD_VOLUME_CHANGE}) if the ad volume is changed.
RendererControllerRendererController acts as a bridge between AdManager and a renderer.
Functions
processEventProcess renderer event
handleStateTransitionHandle renderer state transition
setCapabilityDeclare capability of the renderer.
getVersionGet the version of AdManager.
getParameterGet the parameter with a specific name.
getAdInstanceGet the corresponding ad instance of this renderer controller.
getCompanionSlotsGet all placeholder companion slots of this ad.
scheduleAdInstancesSchedule ad instances for specified slots.
commitAdInstancesCommit scheduled ad instances.
logLog message via FreeWheel AdManager’s log with prefix of Slot, AdInstance info.
getContentVideoElementGet content video <video/> element
ExtensionExtension class provides methods to implement Extension Modules
Functions
initInitialize the extension Parameter: an AdContext instance
disposeDispose the extension when module unloads or AdManager disposes
TranslatorTranslator interface to be implemented.
Functions
TranslatorConstruct a new tv.freewheel.SDK.Translator instance.
startNotify the translator to start ad playback.
infoGet the module info of translator.
ConstantsConstants defined for SDK.
ADUNIT_*
ADUNIT_PREROLLType of ad unit: preroll.
ADUNIT_MIDROLLType of ad unit: midroll.
ADUNIT_POSTROLLType of ad unit: postroll.
ADUNIT_OVERLAYType of ad unit: overlay.
ADUNIT_STREAM_PREROLLType of ad unit: preroll of a live stream.
ADUNIT_STREAM_POSTROLLType of ad unit: postroll of a live stream.
TIME_POSITION_*
TIME_POSITION_CLASS_PREROLL
TIME_POSITION_CLASS_MIDROLL
TIME_POSITION_CLASS_POSTROLL
TIME_POSITION_CLASS_OVERLAY
TIME_POSITION_CLASS_DISPLAY
PARAMETER_*
PARAMETER_ENABLE_FORM_TRANSPORTWeather or not to send request and ping callback by submitting forms.
PARAMETER_DESIRED_BITRATEDesired bitrate (user bandwidth) set by player.
PARAMETER_PAGE_SLOT_CONTENT_TYPEThe parameter to configure primary content type of scaned page slot.
PARAMETER_EXTENSION_AD_CONTROL_CLICK_ELEMENTThe parameter to config which element AdManager would listen and process click event on.
PARAMETER_EXTENSION_CONTENT_VIDEO_ENABLEDThe boolean value to control whether the JSAM or player should listen and handle EVENT_CONTENT_VIDEO_* events.
PARAMETER_EXTENSION_CONTENT_VIDEO_AUTO_SEEK_BACKThe boolean value to control whether JSAM will auto seek back after midroll on iPad.
PARAMETER_RENDERER_VIDEO_START_DETECT_TIMEOUTThe timeout in milliseconds for VideoRenderer.
PARAMETER_VAST_TIMEOUT_IN_MILLISECONDSThe timeout in milliseconds for VAST Translator to load VAST url.
PARAMETER_RENDERER_VIDEO_PROGRESS_DETECT_TIMEOUTThe timeout in milliseconds for VideoRenderer to detect video ad progress timeout.
PARAMETER_RENDERER_VIDEO_DISPLAY_CONTROLS_WHEN_PAUSEThe boolean value to control whether ad video element’s default controls should be displayed when pause.
PARAMETER_EXTENSION_SURVEY_ENABLEDThe boolean value to control whether SurveyExtension should be enabled.
PARAMETER_RENDERER_DISPLAY_COAD_SCRIPT_NAMEThe js function name to render HTML content for display ad.
PARAMETER_LEVEL_*
PARAMETER_LEVEL_PROFILE
PARAMETER_LEVEL_GLOBAL
PARAMETER_LEVEL_OVERRIDE
CAPABILITY_STATUS_*
CAPABILITY_STATUS_OFF
CAPABILITY_STATUS_ON
CAPABILITY_*
CAPABILITY_SLOT_TEMPLATEPlayer expects template-based slots generated by ad server.
CAPABILITY_MULTIPLE_CREATIVE_RENDITIONSPlayer expects multiple creative renditions for an ad.
CAPABILITY_RECORD_VIDEO_VIEWPlayer allows video playback statistic report to FreeWheel.
CAPABILITY_CHECK_COMPANIONPlayer expects ad server to check companion for candidate ads.
CAPABILITY_CHECK_TARGETINGPlayer expects ad server to check targeting for candidate ads.
CAPABILITY_RESET_EXCLUSIVITYPlayer reset the exclusivity scope.
EVENT_*
EVENT_REQUEST_COMPLETEType of AdManager event: an ad request is complete, either success or failure.
EVENT_SLOT_STARTEDType of AdManager event: a slot starts.
EVENT_SLOT_ENDEDType of AdManager event: a slot ends.
EVENT_ERROREvent name: Ad error.
EVENT_RESELLER_NO_ADEvent name: reseller no ad.
EVENT_ADType of an IAB ad event.
EVENT_AD_*
EVENT_AD_IMPRESSIONType of AdManager event: an ad starts.
EVENT_AD_IMPRESSION_ENDType of AdManager event: an ad ends.
EVENT_AD_VOLUME_CHANGEAdManager Event: ad volume has changed.
EVENT_AD_FIRST_QUARTILEEvent name: Ad first quartile.
EVENT_AD_MIDPOINTEvent name: Ad midpoint.
EVENT_AD_THIRD_QUARTILEEvent name: Ad third quartile.
EVENT_AD_COMPLETEEvent name: Ad complete.
EVENT_AD_CLICKEvent name: Ad click.
EVENT_AD_MUTEEvent name: Ad mute.
EVENT_AD_UNMUTEEvent name: Ad unmute.
EVENT_AD_COLLAPSEEvent name: Ad collapse.
EVENT_AD_EXPANDEvent name: Ad expand.
EVENT_AD_PAUSEEvent name: Ad pause.
EVENT_AD_RESUMEEvent name: Ad resume.
EVENT_AD_REWINDEvent name: Ad rewind.
EVENT_AD_ACCEPT_INVITATIONEvent name: Ad accept invitation.
EVENT_AD_CLOSEEvent name: Ad close.
EVENT_AD_MINIMIZEEvent name: Ad minimize.
EVENT_AD_MEASUREMENTEvent name: Ad Concrete event.
EVENT_CONTENT_VIDEO_*
EVENT_CONTENT_VIDEO_PAUSE_REQUESTType of AdManager event: adManager is requesting to pause content video.
EVENT_CONTENT_VIDEO_RESUME_REQUESTType of AdManager event: adManager is requesting to resume content video playback.
ID_TYPE_*
ID_TYPE_FWType of id: a unique id provided by FreeWheel.
ID_TYPE_CUSTOMType of id: a custom id provided by non-FreeWheel parties.
ID_TYPE_GROUPType of id: a unique group id provided by FreeWheel.
VIDEO_STATE_*
VIDEO_STATE_PLAYINGCurrent video is playing.
VIDEO_STATE_PAUSEDCurrent video is paused.
VIDEO_STATE_STOPPEDCurrent video has stopped.
VIDEO_STATE_COMPLETEDCurrent video has completed playing.
VIDEO_ASSET_AUTO_PLAY_TYPE_*
VIDEO_ASSET_AUTO_PLAY_TYPE_ATTENDEDVideo asset auto play type: attended.
VIDEO_ASSET_AUTO_PLAY_TYPE_UNATTENDEDVideo asset auto play type: unattended.
VIDEO_ASSET_AUTO_PLAY_TYPE_NONEVideo asset auto play type: non auto play.
VIDEO_ASSET_DURATION_*
VIDEO_ASSET_DURATION_TYPE_EXACTVideo asset duration type: exact.
VIDEO_ASSET_DURATION_TYPE_VARIABLEVideo asset duration type: variable.
REQUEST_MODE_*
REQUEST_MODE_ON_DEMANDRequest mode: on-demand.
REQUEST_MODE_LIVERequest mode: live.
RENDERER_STATE_*tv.freewheel.SDK
RENDERER_STATE_STARTED
RENDERER_STATE_COMPLETED
RENDERER_STATE_FAILED
EVENT_TYPE_*tv.freewheel.SDK
EVENT_TYPE_CLICK_TRACKING
EVENT_TYPE_IMPRESSION
EVENT_TYPE_CLICK
EVENT_TYPE_STANDARD
EVENT_AD_*tv.freewheel.SDK
EVENT_AD_QUARTILE
EVENT_AD_FIRST_QUARTILE
EVENT_AD_MIDPOINT
EVENT_AD_THIRD_QUARTILE
EVENT_AD_COMPLETE
EVENT_AD_IMPRESSION
EVENT_AD_CLICK
EVENT_AD_MUTE
EVENT_AD_UNMUTE
EVENT_AD_COLLAPSE
EVENT_AD_EXPAND
EVENT_AD_PAUSE
EVENT_AD_RESUME
EVENT_AD_REWIND
EVENT_AD_ACCEPT_INVITATION
EVENT_AD_CLOSE
EVENT_AD_MINIMIZE
EVENT_AD_MEASUREMENT
INFO_KEY_*tv.freewheel.SDK
INFO_KEY_MODULE_TYPE
INFO_KEY_ERROR_CODE
INFO_KEY_ERROR_INFO
INFO_KEY_SHOW_BROWSER
INFO_KEY_CONCRETE_EVENT_ID
INFO_KEY_CUSTOM_EVENT_NAME
MODULE_TYPE_*tv.freewheel.SDK
MODULE_TYPE_EXTENSION
MODULE_TYPE_RENDERER
MODULE_TYPE_TRANSLATOR
ERROR_*tv.freewheel.SDK
ERROR_IO
ERROR_TIMEOUT
ERROR_NULL_ASSET
ERROR_UNKNOWN
ERROR_MISSING_PARAMETER
ERROR_NO_AD_AVAILABLE
ERROR_PARSE
ERROR_INVALID_VALUE
ERROR_INVALID_SLOT
ERROR_3P_COMPONENT
ERROR_UNSUPPORTED_3P_FEATURE
ERROR_DEVICE_LIMIT
ERROR_SECURITY
ERROR_UNMATCHED_SLOT_SIZE
TRANSLATOR_STATE_*
TRANSLATOR_STATE_STARTED
TRANSLATOR_STATE_COMPLETING
TRANSLATOR_STATE_COMPLETED
TRANSLATOR_STATE_FAILED

Functions

setLogLevel

tv.freewheel.SDK.setLogLevel = function(logLevel)

Set the logLevel of a FreeWheel HTML5 SDK.

logLevelmust be one of:
  • <tv.freewheel.SDK.LOG_LEVEL_QUIET>
  • <tv.freewheel.SDK.LOG_LEVEL_INFO>
  • <tv.freewheel.SDK.LOG_LEVEL_DEBUG> By default the logLevel is tv.freewheel.SDK.LOG_LEVEL_INFO

AdManager

Namespace

tv.freewheel.SDK

Summary
Functions
AdManagerConstruct a new tv.freewheel.SDK.AdManager instance.
setNetworkSet the network ID of the distributor.
setServerSet the ad server URL provided by FreeWheel.
setLocationSet the current geographic location of the device.
newContextConstruct a new tv.freewheel.SDK.Context instance.
newContextWithContextConstruct a new tv.freewheel.SDK.Context instance from the given Context instance.

Functions

AdManager

tv.freewheel.SDK.AdManager = function()

Construct a new tv.freewheel.SDK.AdManager instance.

Return

A new tv.freewheel.SDK.AdManager instance.

setNetwork

tv.freewheel.SDK.AdManager.prototype.setNetwork = function(networkId)

Set the network ID of the distributor.  REQUIRED.  Consult your FreeWheel sales engineer for the value.

Parameter

networkId{Number} The distributor’s network id.

setServer

tv.freewheel.SDK.AdManager.prototype.setServer = function(serverUrl)

Set the ad server URL provided by FreeWheel.  REQUIRED.  Consult your FreeWheel sales engineer for the value.

Parameter

serverUrl{String} Ad server url.  You can use a url to a .js file for testing purposes.

Example

var theAdManager = new tv.freewheel.SDK.AdManager();
theAdManager.setServer("response.js");
theAdManager.setServer("http://g1.v.fwmrm.net/ad/g/1");

setLocation

tv.freewheel.SDK.AdManager.prototype.setLocation = function(location)

Set the current geographic location of the device.  This value will only be used for geo targeting purposes.

Parameter

location{Position} Device’s current geographic location.  See: http://dev.w3.org/geo/api/spec-source.html#position_interface

newContext

tv.freewheel.SDK.AdManager.prototype.newContext = function()

Construct a new tv.freewheel.SDK.Context instance.  A Context instance is used to set ad request information for a particular ad or ad set.  Multiple contexts can be created throughout the lifecycle of the FreeWheel AdManager and may exist simultaneously without consequence.

Return

A new tv.freewheel.SDK.Context instance.

See also

Context

newContextWithContext

tv.freewheel.SDK.AdManager.prototype.newContextWithContext = function(context)

Construct a new tv.freewheel.SDK.Context instance from the given Context instance.  The new context copies internal state of the original one for submitting new ad request.  Following methods DO NOT NEED to call again on the new context:

  • addRenderer
  • setRequestMode
  • setCapability
  • setVisitor
  • setSiteSection
  • setVideoAsset
  • setVideoAssetCurrentTimePosition
  • setProfile
  • startSubsession
  • setContentVideoElement
  • setVideoDisplayCompatibleSizes
  • setVideoState
  • loadExtension

But the method below is REQUIRED to be called again on the new context

  • submitRequest

Parameter

contextOriginal context to be copied.

Return

A new tv.freewheel.SDK.Context instance.

See also

Context

Context

An Context instance represents context of an ad request, which is capable of making ad request, parsing response and rendering ads.

Namespace

tv.freewheel.SDK

Summary
Functions
addRendererAdd a renderer with loading URL and match conditions.
setCapabilitySet the capabilities supported by the player.
addKeyValueSet the key-value pair.
setParameterSet the parameters for a special level.
getParameterGet the parameter for a special level.
setVideoStateSet the video state.
getAdVolumeGets the volume of video/audio ads.
setAdVolumeSets the volume of video/audio ads.
registerVideoDisplayBaseRegister the display area for temporal ads display, the area, typically is a div or span, could be any other HTML element, must contains the video element of the content video.
setContentVideoElementSet the content video element.
resizeNotify AdManager that the player size changes so ad sizes can adjust accordingly
setVideoDisplayCompatibleSizesSet a list of acceptable alternative dimensions.
setProfileSet the profiles which describes the player.
setVideoAssetSet the video asset info for the ad request.
setVideoAssetCurrentTimePositionSet the current logical time position of the content asset.
setSiteSectionSet the site section info for the ad request.
setVisitorSet the visitor info for the ad request.
startSubsessionStart a subsession with the given token.
setRequestModeSet request mode of AdManager.
setRequestDurationSet the duration for which the player is requesting ads.
addCandidateAdAdd candidate ads for the request to FreeWheel Ad Server.
addTemporalSlotAdd a temporal slot.
getTemporalSlotsGet all the temporal slots from the response.
getSlotByCustomIdGet the slot specified by the custom ID.
getSlotsByTimePositionClassGet all slots in specified time position class.
submitRequestSubmit the ad request to the FreeWheel server which is set by tv.freewheel.SDK.AdManager.setServer.
addEventListenerAdd listener for a Context event.
removeEventListenerremove listener from a Context event.
disposeDispose this context instance.
loadExtensionLoad the extension from the given URL

Functions

addRenderer

tv.FreeWheel.SDK.Context.prototype.addRenderer = function(url,
baseUnit,
contentType,
slotType,
soAdUnit,
creativeApi,
parameters)

Add a renderer with loading URL and match conditions.

parameters

url{String} The URL to load renderer.
baseUnit{String} Base unit of ads that the renderer supports.  If not set, it should be null.
contentType{String} Content types or wrapper types of ads that the renderer supports.  If not set, it should be null.
slotType{String} Slot types that the renderer supports.  If not set, it should be null.
soAdUnit{String} Ad units that the renderer supports.  If not set, it should be null.
creativeApi{String} Creative APIs that the renderer supports.  If not set, it should be null.
parameters{Object} Key-value parameter dictionary to be passed to the renderer.  If not set, it should be null.

NOTE

For baseUnit, contentType, slotType, soAdUnit and creativeApi, if multiple values are to be set, use comma to separate values.  For example, set “image/png,image/gif” to contentType.

setCapability

tv.freewheel.SDK.Context.prototype.setCapability = function(capability,
status)

Set the capabilities supported by the player.

Parameters

capabilitymust be one of:
statusmust be one of:

addKeyValue

tv.freewheel.SDK.Context.prototype.addKeyValue = function(key,
value)

Set the key-value pair.

Parameters

key{String} Key name of the key-value pair to be set.
value{String} value Value of the key to be set.

setParameter

tv.freewheel.SDK.Context.prototype.setParameter = function(name,
value,
level)

Set the parameters for a special level.

Parameters

name{String} Name of the parameter to be set.
value{Object} Value for the parameter.
levellevel of the parameters, must be one of:

getParameter

tv.freewheel.SDK.Context.prototype.getParameter = function(name)

Get the parameter for a special level.

Parameters

name{String} name Name of the parameter

Return

An object, the value of the parameter.

setVideoState

tv.freewheel.SDK.Context.prototype.setVideoState = function(videoState)

Set the video state.  Player is expected to notify AdManager about its current playback state by calling this method.

Parameter

videoStatevideo play state, must be one of:

getAdVolume

tv.freewheel.SDK.Context.prototype.getAdVolume = function()

Gets the volume of video/audio ads.

Return

Current ad volume {number}.

Note

FreeWheel JavaScript SDK’s ad volume concept is slightly different from HTML5 video’s volume property’s definition. getAdVolume() returns 0 if the video’s `muted` property is set to true, otherwise it returns the value of the `volume` property of the content video element.

setAdVolume

tv.freewheel.SDK.Context.prototype.setAdVolume = function(adVolume)

Sets the volume of video/audio ads.  Must be called after invoking registerVideoDisplayBase() or setContentVideoElement() after which a video element is available to AdManager.

Parameter

adVolumeDesired volume of video/audio ads.  Must be a number between 0.0 and 1.0.

Example values

  • 1.0 is the highest volume (100%.  This is default)
  • 0.5 is half volume
  • 0 is silent (same as mute)

Note

Calling this method during a video / VPAID ad will result in a volume change and/or muted state change in the video element.  This is equivalent in effect to setting videoElement.volume or videoElement.muted(if you want to mute / unmute) directly.  For example, setAdVolume(0) will result in the video element’s `volume` being set to 0 as well as `muted` being set to true; setAdVolume(0.7) will result in the video element’s `volume` being set to 0.7 as well as `muted` being set to false.  On iOS devices, due to system restrictions, only 0 and 1 work, meaning you can only completely mute or unmute an ad.  See https://developer.apple.com/library/content/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html

registerVideoDisplayBase

tv.freewheel.SDK.Context.prototype.registerVideoDisplayBase = function(id)

Register the display area for temporal ads display, the area, typically is a div or span, could be any other HTML element, must contains the video element of the content video.  And if the video size changed, player can invoke this API again with the same parameter to notify AdManager.

Parameter

id{String} The id attribute of the HTML element which contains the content video’s video element.

setContentVideoElement

tv.freewheel.SDK.Context.prototype.setContentVideoElement = function(id)

Set the content video element.  And if the video size changed, player can invoke this API again with the same parameter to notify AdManager.

Parameter

id{Element} The content video <video/> element.

Note

The parent node of the video element will be used as temporal slot base.

resize

tv.freewheel.SDK.Context.prototype.resize = function(width,
height)

Notify AdManager that the player size changes so ad sizes can adjust accordingly

Parameter

width{Number} the width of the player in CSS pixel
height{Number} the height of the player in CSS pixel

setVideoDisplayCompatibleSizes

tv.freewheel.SDK.Context.prototype.setVideoDisplayCompatibleSizes = function(
   compatibleDimensions
)

Set a list of acceptable alternative dimensions.

Parameter

compatibleDimensions{Array} an array of compatible dimensions object.

Note

The dimension object must have property named width and height, the value is unsigned int.

Example

//create an array contains compatible dimensions which are n number of untyped objects
var dimensions = [{width:1920, height:1080}, {width:1280, height:720}];
// pass the array to Context
context.setVideoDisplayCompatibleSizes(dimensions);

setProfile

tv.freewheel.SDK.Context.prototype.setProfile = function(playerProfile)

Set the profiles which describes the player.

Parameter

playerProfile{String} Name of global profile.

setVideoAsset

tv.freewheel.SDK.Context.prototype.setVideoAsset = function(id,
duration,
networkId,
location,
autoPlayType,
videoViewRandom,
idType,
fallbackId,
durationType)

Set the video asset info for the ad request.

Parameters

id{String|Number} The id of the video asset which correspond to the ad request.
duration{Number} The total duration of the video asset in seconds.
networkId{Number} Optional.  The network id of the video asset.
location{String} Optional.  The location of the video asset
autoPlayType{Number} Optional, default is VIDEO_ASSET_AUTO_PLAY_TYPE_ATTENDED.  Whether the video will be played without user interactive, must be one of:
videoViewRandom{Number} Optional.  The view random number of the Video Asset.
idTypeOptional, default is ID_TYPE_CUSTOM.  Must be one of:
fallbackId{Number} Optional.  The fallback id of the video asset.
durationTypeOptional, default is VIDEO_ASSET_DURATION_TYPE_EXACT . Must be one of:

setVideoAssetCurrentTimePosition

tv.freewheel.SDK.Context.prototype.setVideoAssetCurrentTimePosition = function(
   timePosition
)

Set the current logical time position of the content asset.

Parameters

timePosition{Number} Time position value in seconds.

NOTE

If the stream is broken into multiple distinct files, this should be the time position within the asset as a whole.

setSiteSection

tv.freewheel.SDK.Context.prototype.setSiteSection = function(id,
networkId,
pageViewRandom,
idType,
fallbackId)

Set the site section info for the ad request.

Parameters

id{String|Number} The id of the site section which correspond to the ad request.
networkId{Number} Optional.  The networkId of the site section.
pageViewRandom{Number} Optional.  The view random number of the page.
idTypeOptional, default is ID_TYPE_CUSTOM . Must be one of:
fallbackId{Number} The fallback id of the site section.

setVisitor

tv.freewheel.SDK.Context.prototype.setVisitor = function(customId,
ipV4Address)

Set the visitor info for the ad request.

Parameters

customId{String} The custom id of the visitor.
ipV4Address{String} Optional.  IP address of the visitor.

startSubsession

tv.freewheel.SDK.Context.prototype.startSubsession = function(subsessionToken)

Start a subsession with the given token.  Subsequent requests will be in the same subsession, until this method is called again with a different token.

Parameters

subsessionToken{Number} The token to start the subsession with.  Positive integer.

setRequestMode

tv.freewheel.SDK.Context.prototype.setRequestMode = function (mode)

Set request mode of AdManager.

Parameters

modeDefault is REQUEST_MODE_ON_DEMAND.  Must be one of:

NOTE

AdManager runs in On-Demand mode(tv.freewheel.SDK.REQUEST_MODE_ON_DEMAND) by default, invoke this method to set a player to a different mode.

setRequestDuration

tv.freewheel.SDK.Context.prototype.setRequestDuration = function (duration)

Set the duration for which the player is requesting ads.

Parameters

mode{Number} The requesting duration value, in seconds

addCandidateAd

tv.freewheel.SDK.Context.prototype.addCandidateAd = function (id)

Add candidate ads for the request to FreeWheel Ad Server.

Parameters

id{Number} ID of the candidate ad.

addTemporalSlot

tv.freewheel.SDK.Context.prototype.addTemporalSlot = function(
   customId,
   adUnit,
   timePosition,
   slotProfile,
   cuepointSequence,
   maxDuration,
   minDuration,
   acceptContentType,
   signalId
)

Add a temporal slot.

Parameters

customId{String} Custom id of the slot, add a slot with an identical name as existing slot will fail.
adUnit{String} ad unit supported by the slot.  It can be one of ADUNIT_* or custom adUnit.
timePosition{Number} Time position of the slot in seconds.
slotProfile{String} Optional.  Profile name of the slot.
cuepointSequence{Number} Optional.  Cuepoint sequence override.
maxDuration{Number} Optional.  Maximum duration of the slot allowed.  Default value is (0) = unlimited.
minDuration{Number} Optional.  Minimum duration of the slot allowed.  Default value is (0) = no minimum duration requirement.
acceptContentType{String} Optional.  Accepted content types, use “,” as delimiter.
signalId{String} Optional.  Signal ID, only applicable in Linear TV Streams, of the break

getTemporalSlots

tv.freewheel.SDK.Context.prototype.getTemporalSlots = function()

Get all the temporal slots from the response.

Return

An array of tv.freewheel.SDK.Slot instances.

getSlotByCustomId

tv.freewheel.SDK.Context.prototype.getSlotByCustomId = function(customId)

Get the slot specified by the custom ID.

Parameter

customId{String} Custom ID of the slot.

Return

A tv.freewheel.SDK.Slot instance.

getSlotsByTimePositionClass

tv.freewheel.SDK.Context.prototype.getSlotsByTimePositionClass = function(
   timePositionClass
)

Get all slots in specified time position class.

Parameters

timePositionClass{String} Time position of the slot.  Must be one of the following:

Return

An array of tv.freewheel.SDK.Slot instances.

submitRequest

tv.freewheel.SDK.Context.prototype.submitRequest = function(timeoutSeconds)

Submit the ad request to the FreeWheel server which is set by tv.freewheel.SDK.AdManager.setServer.

Parameter

timeoutSeconds{Number} Optional, default value is 5.  The timeout time in seconds for request, positive value valid.

See also

AdManager.setServer

addEventListener

tv.freewheel.SDK.Context.prototype.addEventListener = function(event,
listener)

Add listener for a Context event.

Parameters

eventevent name, must be one of:
listener{function} callback function.

removeEventListener

tv.freewheel.SDK.Context.prototype.removeEventListener = function(event,
listener)

remove listener from a Context event.

Parameters

eventname, must be one of:
listener{function} callback function

dispose

tv.freewheel.SDK.Context.prototype.dispose = function()

Dispose this context instance.  If the player wants to submit request multiple times by using the same <video> object, the player must dispose Context firstly before submit request, then create a new one.  NOTE: This method should not be invoked synchronously in the handler of any AdManager posted event.

loadExtension

tv.freewheel.SDK.Context.prototype.loadExtension = function(ExtensionUrl)

Load the extension from the given URL

Slot

Namespace

tv.freewheel.SDK

Summary
Functions
getCustomIdGet the custom id of the slot.
getAdCountGet the count of the ads in the slot.
getTimePositionGet the time position of the slot.
getTimePositionClassGet the time position class of the slot.
getWidthGet the width of the slot.
getHeightGet the height of the slot.
getBaseGet the slot base of this slot.
getSignalIdGet the signal Id of the break.
playPlay the slot.
stopStop the slot.
pausePause the slot.
resumeResume the slot.
getParameterGet the parameter set on slot level.
setParameterSet the parameters in slot level.
getTotalDurationGet the duration in seconds of the slot.
getPlayheadTimeGet the playheadTime in seconds of the slot.
getAdInstancesGet all the playble ad instances in the slot.
setVisibleSet the visibility of a nontemporal slot.
skipCurrentAdSkip the currently playing ad and move to the next queued ad in the slot Fallback ads associated with the skipped ad will not be played

Functions

getCustomId

tv.freewheel.SDK.Slot.prototype.getCustomId = function()

Get the custom id of the slot.

Return

Custom id {String} of the slot.

getAdCount

tv.freewheel.SDK.Slot.prototype.getAdCount = function()

Get the count of the ads in the slot.

Return

Count of the ads in the slot.

getTimePosition

tv.freewheel.SDK.Slot.prototype.getTimePosition = function()

Get the time position of the slot.

Return

Time position {Number} of the slot in seconds.

getTimePositionClass

tv.freewheel.SDK.Slot.prototype.getTimePositionClass = function()

Get the time position class of the slot.

Return

One of the following:

getWidth

tv.freewheel.SDK.Slot.prototype.getWidth = function()

Get the width of the slot.

Return

The width {Number} of the slot in pixel.

getHeight

tv.freewheel.SDK.Slot.prototype.getHeight = function()

Get the height of the slot.

Return

The height {Number} of the slot in pixel.

getBase

tv.freewheel.SDK.Slot.prototype.getBase = function()

Get the slot base of this slot.

Return

The base document element which contains this slot’s element.

See also

Context.registerVideoDisplayBase

getSignalId

tv.freewheel.SDK.Slot.prototype.getSignalId = function()

Get the signal Id of the break.  Only applicable in TV streams

Return

The string representation of the signal Id (can be null/undefined)

play

tv.freewheel.SDK.Slot.prototype.play = function()

Play the slot.

stop

tv.freewheel.SDK.Slot.prototype.stop = function()

Stop the slot.  NOTE: This method should not be invoked synchronously in the handler of any AdManager posted event.

pause

tv.freewheel.SDK.Slot.prototype.pause = function()

Pause the slot.  Pausing the slot only works when the current ad has started playback.  This limitation will be addressed in later releases.  This method should not be invoked synchronously in the handler of any event posted by AdManager.

resume

tv.freewheel.SDK.Slot.prototype.resume = function()

Resume the slot.  Resuming the slot only works when the current ad has started playback.  This limitation will be addressed in later releases.  This method should not be invoked synchronously in the handler of any event posted by AdManager.

getParameter

tv.freewheel.SDK.Slot.prototype.getParameter = function(name)

Get the parameter set on slot level.

Return

The parameter value for the specified name.  Returns {undefined} if the parameter is not found on slot level.

setParameter

tv.freewheel.SDK.Slot.prototype.setParameter = function(name,
value)

Set the parameters in slot level.

Parameters

name{String} Name of the parameter to be set.
value{Object} Value for the parameter.

getTotalDuration

tv.freewheel.SDK.Slot.prototype.getTotalDuration = function()

Get the duration in seconds of the slot.

Return

The duration of the slot, or -1 if the actual duration is unknown.

getPlayheadTime

tv.freewheel.SDK.Slot.prototype.getPlayheadTime = function()

Get the playheadTime in seconds of the slot.

Return

The playheadTime of the slot, or -1 if the actual playheadTime is unknown.

getAdInstances

tv.freewheel.SDK.Slot.prototype.getAdInstances = function()

Get all the playble ad instances in the slot.

Return

An array of AdInstance

setVisible

tv.freewheel.SDK.Slot.prototype.setVisible = function(visible)

Set the visibility of a nontemporal slot.  By default the slot is visible.

skipCurrentAd

tv.freewheel.SDK.Slot.prototype.skipCurrentAd = function()

Skip the currently playing ad and move to the next queued ad in the slot Fallback ads associated with the skipped ad will not be played

AdInstance

Namespace

tv.freewheel.SDK

Summary
Functions
getAdIdGet the FreeWheel ad ID of the ad instance.
getParameterGet the parameter set on AdInstance level.
getUniversalAdIdGet the universal ad ID of the ad instance.
getSoAdUnitGet the soAdUnit of the ad instance.
getActiveCreativeRenditionGet the active creative rendition.
addCreativeRenditionCreate a creative rendition clone for translation, and add it to current ad’s creative rendition array.
getAllCreativeRenditionsGet all the creative renditions of the ad instance.And the primary creative rendition is the first element in the returned array.
getRenderableCreativeRenditionsGet renderable creative renditions.
setActiveCreativeRenditionSet active creative rendition.
getEventCallbackUrlsGet the callback urls for a specific event.
addEventCallbackUrlAdd the callback url to a specific event.
setClickThroughUrlSet the click through url.
getSlotGet the slot of the ad.
getCompanionAdInstancesGet the playable companion ad instances.
isRequiredToShowWhether the ad is required to be shown by law, usually the ad is a companion ad.
getRendererControllerGet the rendererController object for this AdInstance.
getPlayheadTimeGet the ad instance playheadTime

Functions

getAdId

tv.freewheel.SDK.AdInstance.prototype.getAdId = function()

Get the FreeWheel ad ID of the ad instance.

Return

The FreeWheel ad ID of the ad instance.

getParameter

tv.freewheel.SDK.AdInstance.prototype.getParameter = function(name)

Get the parameter set on AdInstance level.

The parameter value will be retrieved from levels in the following order

override, profile, global, creative rendition, creative, slot.

Return

The parameter value for the specified name.  Returns {undefined} if the parameter is not found on AdInstance level.

getUniversalAdId

tv.freewheel.SDK.AdInstance.prototype.getUniversalAdId = function()

Get the universal ad ID of the ad instance.  Note that this only applies to VAST ads after they have started playback.  For more information on the IAB Universal Ad ID, please refer to section 3.7.1 in the VAST 4.0 spec: https://www.iab.com/guidelines/digital-video-ad-serving-template-vast-4-0/.

Return

The universal ad ID of the ad instance.  If null, no universal ad ID is available.  If not null, the returning value is an object containing two properties: idRegistry and idValue.

getSoAdUnit

tv.freewheel.SDK.AdInstance.prototype.getSoAdUnit = function()

Get the soAdUnit of the ad instance.

Return

The soAdUnit of the ad instance.

getActiveCreativeRendition

tv.freewheel.SDK.AdInstance.prototype.getActiveCreativeRendition = function()

Get the active creative rendition.

addCreativeRendition

tv.freewheel.SDK.AdInstance.prototype.addCreativeRendition = function()

Create a creative rendition clone for translation, and add it to current ad’s creative rendition array.

Return

The CreativeRendition object created and added to the ad.

getAllCreativeRenditions

tv.freewheel.SDK.AdInstance.prototype.getAllCreativeRenditions = function()

Get all the creative renditions of the ad instance.And the primary creative rendition is the first element in the returned array.

Return

An array of CreativeRendition

getRenderableCreativeRenditions

tv.freewheel.SDK.AdInstance.prototype.getRenderableCreativeRenditions = function()

Get renderable creative renditions.  The primary creative rendition is the first element of the array.

setActiveCreativeRendition

tv.freewheel.SDK.AdInstance.prototype.setActiveCreativeRendition = function(
   creativeRendition
)

Set active creative rendition.

Parameter

creativeRendition: The CreativeRendition object to be set as active one.

getEventCallbackUrls

tv.freewheel.SDK.AdInstance.prototype.getEventCallbackUrls = function(name,
type)

Get the callback urls for a specific event.

Parameters

namename of the event.
typetype of the event.

Return

An array of specified event callback URLs.  If no event callback URL is found, the array is empty.

Usage

Available event types: corresponding event name(s)

EVENT_TYPE_CLICK: EVENT_AD_CLICK

EVENT_TYPE_CLICK_TRACKING: EVENT_AD_CLICK

EVENT_TYPE_IMPRESSION: EVENT_AD_IMPRESSION, EVENT_AD_FIRST_QUARTILE, EVENT_AD_MIDPOINT, EVENT_AD_THIRD_QUARTILE, EVENT_AD_COMPLETE

EVENT_TYPE_STANDARD: EVENT_AD_PAUSE, EVENT_AD_RESUME, EVENT_AD_REWIND, EVENT_AD_MUTE, EVENT_AD_UNMUTE, EVENT_AD_COLLAPSE, EVENT_AD_EXPAND, EVENT_AD_MINIMIZE, EVENT_AD_CLOSE, EVENT_AD_ACCEPT_INVITATION

addEventCallbackUrl

tv.freewheel.SDK.AdInstance.prototype.addEventCallbackUrls = function(name,
type,
urls)

Add the callback url to a specific event.

Parameters

namename of the event.
typetype of the event.
urls{Array} urls of the event callback.

Usage

Available event types: corresponding event name(s)

EVENT_TYPE_CLICK: EVENT_AD_CLICK

EVENT_TYPE_CLICK_TRACKING: EVENT_AD_CLICK

EVENT_TYPE_IMPRESSION: EVENT_AD_IMPRESSION, EVENT_AD_FIRST_QUARTILE, EVENT_AD_MIDPOINT, EVENT_AD_THIRD_QUARTILE, EVENT_AD_COMPLETE

EVENT_TYPE_STANDARD: EVENT_AD_PAUSE, EVENT_AD_RESUME, EVENT_AD_REWIND, EVENT_AD_MUTE, EVENT_AD_UNMUTE, EVENT_AD_COLLAPSE, EVENT_AD_EXPAND, EVENT_AD_MINIMIZE, EVENT_AD_CLOSE, EVENT_AD_ACCEPT_INVITATION

*EVENT_ERROR: EVENT_TYPE_ERROR

setClickThroughUrl

tv.freewheel.SDK.AdInstance.prototype.setClickThroughUrl = function(name,
url)

Set the click through url.

Parameters

namename of the event
urlname of the event.

getSlot

tv.freewheel.SDK.AdInstance.prototype.getSlot = function()

Get the slot of the ad.

Return

The Slot object that contains this ad.

getCompanionAdInstances

tv.freewheel.SDK.AdInstance.prototype.getCompanionAdInstances = function()

Get the playable companion ad instances.

Returns

{Array} Array of AdInstances.

isRequiredToShow

tv.freewheel.SDK.AdInstance.prototype.isRequiredToShow = function()

Whether the ad is required to be shown by law, usually the ad is a companion ad.

Returns

A Boolean true if this ad is required to be shown, otherwise false.

getRendererController

tv.freewheel.SDK.AdInstance.prototype.getRendererController = function()

Get the rendererController object for this AdInstance.

Return

The RendererController instance for this AdInstance.

getPlayheadTime

tv.freewheel.SDK.AdInstance.prototype.getPlayheadTime = function()

Get the ad instance playheadTime

Return

Playhead time in seconds, -1 if not available.

CreativeRendition

Namespace

tv.freewheel.SDK

Summary
Functions
getContentTypeGet the content type of the creative rendition.
setContentTypeSet the content type of the creative rendition.
getWrapperTypeGet the wrapper type of the creative rendition.
setWrapperTypeSet the wrapper type of the creative rendition.
getWrapperUrlGet the wrapper url of the creative rendition.
setWrapperUrlSet the wrapper url of the creative rendition.
getBaseUnitGet the base unit of the creative rendition.
getPreferenceGet the preference of the creative rendition.
setPreferenceSet the preference of the creative rendition.
getWidthGet the width of the creative rendition.
setWidthSet the width of the creative rendition.
getHeightGet the height of the creative rendition.
setHeightSet the height of the creative rendition.
getDurationGet the duration of the creative rendition.
setDurationSet the duration of the creative rendition.
getParameterGet the value of the specific parameter name.
setParameterSet the specific parameter of the creative rendition.
addCreativeRenditionAssetAdd a creative rendition asset to the this creative rendition.
getPrimaryCreativeRenditionAssetGet the primary asset of the creative rendition.
getOtherCreativeRenditionAssetsGet other creative rendition assets.
getCreativeApiGet the creativeApi name of the creative rendition.

Functions

getContentType

tv.freewheel.SDK.CreativeRendition.prototype.getContentType = function()

Get the content type of the creative rendition.

Return

Content type in {String}.

setContentType

tv.freewheel.SDK.CreativeRendition.prototype.setContentType = function(value)

Set the content type of the creative rendition.

Parameter

value{String} content type value to be set.

getWrapperType

tv.freewheel.SDK.CreativeRendition.prototype.getWrapperType = function()

Get the wrapper type of the creative rendition.

Return

Wrapper type in {String}.

Usage

This method is for translator development only.

setWrapperType

tv.freewheel.SDK.CreativeRendition.prototype.setWrapperType = function(value)

Set the wrapper type of the creative rendition.

Parameter

value{String} wrapper type value to be set.

Usage

This method is for translator development only.

getWrapperUrl

tv.freewheel.SDK.CreativeRendition.prototype.getWrapperUrl = function()

Get the wrapper url of the creative rendition.

Return

Wrapper url in {String}.

Usage

This method is for translator development only.

setWrapperUrl

tv.freewheel.SDK.CreativeRendition.prototype.setWrapperUrl = function(value)

Set the wrapper url of the creative rendition.

Parameter

value{String} wrapper url value to be set.

Usage

This method is for translator development only.

getBaseUnit

tv.freewheel.SDK.CreativeRendition.prototype.getBaseUnit = function()

Get the base unit of the creative rendition.

Return

Base unit in {String}.

getPreference

tv.freewheel.SDK.CreativeRendition.prototype.getPreference = function()

Get the preference of the creative rendition.

Return

Preference of this creative rendition in {Number}.  Preference is a number describes the priority among all renditions in the same creative.  Default preference value: 0

setPreference

tv.freewheel.SDK.CreativeRendition.prototype.setPreference = function(value)

Set the preference of the creative rendition.

Parameter

value{Number}.  The Preference to be set,which describes the priority among all renditions in the same creative.

getWidth

tv.freewheel.SDK.CreativeRendition.prototype.getWidth = function()

Get the width of the creative rendition.

Return

{Number} width in pixels.

setWidth

tv.freewheel.SDK.CreativeRendition.prototype.setWidth = function(value)

Set the width of the creative rendition.

Parameter

value{Number} width in pixels.

getHeight

tv.freewheel.SDK.CreativeRendition.prototype.getHeight = function()

Get the height of the creative rendition.

Return

{Number} height in pixels.

setHeight

tv.freewheel.SDK.CreativeRendition.prototype.setHeight = function(value)

Set the height of the creative rendition.

Parameter

value{Number} height in pixels.

getDuration

tv.freewheel.SDK.CreativeRendition.prototype.getDuration = function()

Get the duration of the creative rendition.

Return

Duration in seconds.

setDuration

tv.freewheel.SDK.CreativeRendition.prototype.setDuration = function(value)

Set the duration of the creative rendition.

Parameter

valueduration in seconds.

getParameter

tv.freewheel.SDK.CreativeRendition.prototype.getParameter = function(name)

Get the value of the specific parameter name.

Parameter

namethe name of the parameter.

Return

The value of the parameter.

setParameter

tv.freewheel.SDK.CreativeRendition.prototype.setParameter = function(name,
value)

Set the specific parameter of the creative rendition.

Parameters

namename of the parameter.
valuevalue of the parameter.

addCreativeRenditionAsset

tv.freewheel.SDK.CreativeRendition.prototype.addCreativeRenditionAsset = function(
   name,
   isPrimary
)

Add a creative rendition asset to the this creative rendition.

Parameters

namename of the asset.
isPrimary{Boolean} indicates that the asset should be set as primary or not.

Return

The added CreativeRenditionAsset object.

getPrimaryCreativeRenditionAsset

tv.freewheel.SDK.CreativeRendition.prototype.getPrimaryCreativeRenditionAsset = function()

Get the primary asset of the creative rendition.

Return

The primary asset of the creative rendition.

getOtherCreativeRenditionAssets

tv.freewheel.SDK.CreativeRendition.prototype.getOtherCreativeRenditionAssets = function ()

Get other creative rendition assets.

Return

An array of other creative rendition assets.  The array may be empty.

getCreativeApi

tv.freewheel.SDK.CreativeRendition.prototype.getCreativeApi = function()

Get the creativeApi name of the creative rendition.

Return

A string represent the creativeApi name.

CreativeRenditionAsset

Namespace

tv.freewheel.SDK

Summary
Functions
getNameGet the name of the creative rendition asset.
setNameSet the name of the creative rendition asset.
getUrlGet the url of the creative rendition asset.
setUrlSet the url of the creative rendition asset.
getContentGet the content of the creative rendition asset.
setContentSet the content of the creative rendition asset.
getContentTypeGet the content type of the creative rendition asset.
setContentTypeSet the content type of the creative rendition asset.
getMimeTypeGet the mime type of the creative rendition asset.
setMimeTypeSet the mime type of the creative rendition asset.
getBytesGet the size of the creative rendition asset in bytes.
setBytesSet the size of the creative rendition asset in bytes.

Functions

getName

tv.freewheel.SDK.CreativeRenditionAsset.prototype.getName = function()

Get the name of the creative rendition asset.

Return

Asset name in {String}.

setName

tv.freewheel.SDK.CreativeRenditionAsset.prototype.setName = function(value)

Set the name of the creative rendition asset.

Parameter

value{String} asset name.

getUrl

tv.freewheel.SDK.CreativeRenditionAsset.prototype.getUrl = function()

Get the url of the creative rendition asset.

Return

Url in {String}.

setUrl

tv.freewheel.SDK.CreativeRenditionAsset.prototype.setUrl = function(value)

Set the url of the creative rendition asset.

Parameter

value{String} asset url.

getContent

tv.freewheel.SDK.CreativeRenditionAsset.prototype.getContent = function()

Get the content of the creative rendition asset.

Return

Content is {String}.

setContent

tv.freewheel.SDK.CreativeRenditionAsset.prototype.setContent = function(value)

Set the content of the creative rendition asset.

Parameter

value{String} asset content.

getContentType

tv.freewheel.SDK.CreativeRenditionAsset.prototype.getContentType = function()

Get the content type of the creative rendition asset.

Return

Asset content type in {String}.

setContentType

tv.freewheel.SDK.CreativeRenditionAsset.prototype.setContentType = function(
   value
)

Set the content type of the creative rendition asset.

Parameter

value{String} asset content type.

getMimeType

tv.freewheel.SDK.CreativeRenditionAsset.prototype.getMimeType = function()

Get the mime type of the creative rendition asset.

Return

Asset mime type in {String}.

setMimeType

tv.freewheel.SDK.CreativeRenditionAsset.prototype.setMimeType = function(value)

Set the mime type of the creative rendition asset.

Parameter

value{String} asset mime type.

getBytes

tv.freewheel.SDK.CreativeRenditionAsset.prototype.getBytes = function()

Get the size of the creative rendition asset in bytes.

Return

Asset size in bytes.

setBytes

tv.freewheel.SDK.CreativeRenditionAsset.prototype.setBytes = function(value)

Set the size of the creative rendition asset in bytes.

Parameter

value{Number} asset size in bytes, or -1 if unknown.

Renderer

Renderer interface to be implemented.

Summary
Functions
startNotify the renderer to start ad playback.
stopNotify the renderer to stop ad playback.
pauseNotify the renderer to pause ad playback.
resumeNotify the renderer to resume ad playback.
infoGet the module info of renderer.
getPlayheadTimeGet the ad playheadTime
getDurationGet the duration of the ad.
resizeResize the ad
setVolumeSet the volume of the ad When called, the renderer is expected to update the volume for the current ad playback and dispatch `EVENT_AD_VOLUME_CHANGE` by calling RendererController.processEvent({name:EVENT_AD_VOLUME_CHANGE}) if the ad volume is changed.

Functions

start

tv.freewheel.SDK.Renderer.prototype.start = function(rendererController)

Notify the renderer to start ad playback.

Parameter

rendererControllerthe RendererController instance that initiates the renderer.

stop

tv.freewheel.SDK.Renderer.prototype.stop = function()

Notify the renderer to stop ad playback.  Resources created during the renderer lifetime should be disposed in this method.

pause

tv.freewheel.SDK.Renderer.prototype.pause = function()

Notify the renderer to pause ad playback.  The renderer is supposed to call RendererController.processEvent(EVENT_AD_PAUSE) to notify the FW SDK that the ad is paused.

resume

tv.freewheel.SDK.Renderer.prototype.resume = function()

Notify the renderer to resume ad playback.  The renderer is supposed to call RendererController.processEvent(EVENT_AD_RESUME) to notify the FW SDK that the ad is resumed.

info

tv.freewheel.SDK.Renderer.prototype.info = function()

Get the module info of renderer.

Return

An object of properties: moduleType, moduleVersion, requiredAPIVersion.

getPlayheadTime

tv.freewheel.SDK.Renderer.prototype.getPlayheadTime = function()

Get the ad playheadTime

Return

Playhead time in seconds, -1 if not available.

getDuration

tv.freewheel.SDK.Renderer.prototype.getDuration = function()

Get the duration of the ad.  It returns the most accurate value available to AdManager, which may come from the renderer or the ad response XML.  The value reported by the renderer is considered more accurate than the value from ad response, aka. the creative duration value booked in MRM UI.

Returns

Duration in seconds, -1 if not available.

resize

tv.freewheel.SDK.Renderer.prototype.resize = function()

Resize the ad

setVolume

tv.freewheel.SDK.Renderer.prototype.setVolume = function(volume)

Set the volume of the ad When called, the renderer is expected to update the volume for the current ad playback and dispatch `EVENT_AD_VOLUME_CHANGE` by calling RendererController.processEvent({name:EVENT_AD_VOLUME_CHANGE}) if the ad volume is changed.

Parameter

volumethe desired volume of the ad playback.  Note: volume is expected to be in the range of [0,1]

RendererController

RendererController acts as a bridge between AdManager and a renderer.

Namespace

tv.freewheel.SDK

Summary
Functions
processEventProcess renderer event
handleStateTransitionHandle renderer state transition
setCapabilityDeclare capability of the renderer.
getVersionGet the version of AdManager.
getParameterGet the parameter with a specific name.
getAdInstanceGet the corresponding ad instance of this renderer controller.
getCompanionSlotsGet all placeholder companion slots of this ad.
scheduleAdInstancesSchedule ad instances for specified slots.
commitAdInstancesCommit scheduled ad instances.
logLog message via FreeWheel AdManager’s log with prefix of Slot, AdInstance info.
getContentVideoElementGet content video <video/> element

Functions

processEvent

tv.freewheel.SDK.RendererController.prototype.processEvent = function(event)

Process renderer event

Parameter

event{Object} hash object to be processed.  Available keys:
  • ’name’ The name of the event, value is one of EVENT_AD_*.
  • ’info’ Additional info of event, an object with following keys:

INFO_KEY_CUSTOM_EVENT_NAME When name is EVENT_AD_CLICK, renderer tells the custom click event to be processed via this key.

INFO_KEY_SHOW_BROWSER Optional.  Force opening/not opening the event callback url in new window.

INFO_KEY_URL Optional.  Override the url to open or redirect on EVENT_AD_CLICK.

INFO_KEY_CONCRETE_EVENT_ID Optional.  When name is EVENT_AD_MEASUREMENT, renderer tells the concrete event ID via this key.  The concrete event ID should be a string.

NOTE

This method should not be used to process EVENT_AD_IMPRESSION or EVENT_AD_IMPRESSION_END event.  Please use handleStateTransition() for these events.

Example

var event = {"name": tv.freewheel.SDK.EVENT_AD_CLICK, "info": {}};
event["info"][tv.freewheel.SDK.INFO_KEY_CUSTOM_EVENT_NAME] = "CustomClick_1";
event["info"][tv.freewheel.SDK.INFO_KEY_SHOW_BROWSER] = true;
event["info"][tv.freewheel.SDK.INFO_KEY_URL] = "http://www.foo.com";
theFWRendererController.processEvent(event);

handleStateTransition

tv.freewheel.SDK.RendererController.prototype.handleStateTransition = function(
   rendererStateEvent,
   additionalInfo
)

Handle renderer state transition

Parameter

rendererStateEventname of the renderer state event.
additionalInfoOptional.  The additional info to be passed, used for failing condition.

Example

var info = {"errorCode": tv.freewheel.SDK.ERROR_DEVICE_LIMIT, "errorInfo": "Unable to play the ad on this device."};
theFWRendererController.handleStateTransition(tv.freewheel.SDK.RENDERER_STATE_FAILED, info);

setCapability

tv.freewheel.SDK.RendererController.prototype.setCapability = function(
   eventCapability,
   status
)

Declare capability of the renderer.

Parameters

eventCapabilityOne of tv.freewheel.SDK.EVENT_AD_*.
statusTrue if renderer has specified capability or is able to send specified event.

getVersion

tv.freewheel.SDK.RendererController.prototype.getVersion = function()

Get the version of AdManager.

Return

Major version of AdManager, e.g.  0x02060000 for v2.6 .

getParameter

tv.freewheel.SDK.RendererController.prototype.getParameter = function(name)

Get the parameter with a specific name.  The parameter value will be retrieved from levels in the following order: override, creative rendition, creative, slot, profile, global.

Parameter

namethe name of the parameter.

Return

The value of the parameter.

getAdInstance

tv.freewheel.SDK.RendererController.prototype.getAdInstance = function()

Get the corresponding ad instance of this renderer controller.

Return

The AdInstance object.

getCompanionSlots

tv.freewheel.SDK.RendererController.prototype.getCompanionSlots = function()

Get all placeholder companion slots of this ad.

Return

{Array} Array of placeholder companion Slots.

scheduleAdInstances

tv.freewheel.SDK.RendererController.prototype.scheduleAdInstances = function(
   slots
)

Schedule ad instances for specified slots.

Parameter

slots{Array} An array of Slots that need schedule ad instances.

Return

{Array} Successfully scheduled AdInstances.

commitAdInstances

tv.freewheel.SDK.RendererController.prototype.commitAdInstances = function()

Commit scheduled ad instances.

log

tv.freewheel.SDK.RendererController.prototype.log = function(msg)

Log message via FreeWheel AdManager’s log with prefix of Slot, AdInstance info.

Parameter

msg: Message to be logged.

getContentVideoElement

tv.freewheel.SDK.RendererController.prototype.getContentVideoElement = function()

Get content video <video/> element

Return

The content video <video/> element {Element}

Extension

Extension class provides methods to implement Extension Modules

Namespace

tv.freewheel.SDK

Summary
Functions
initInitialize the extension Parameter: an AdContext instance
disposeDispose the extension when module unloads or AdManager disposes

Functions

init

tv.FreeWheel.SDK.Extension.prototype.init = function(AdContext)

Initialize the extension Parameter: an AdContext instance

dispose

tv.FreeWheel.SDK.Extension.prototype.dispose = function()

Dispose the extension when module unloads or AdManager disposes

Translator

Translator interface to be implemented.

Namespace

tv.freewheel.SDK

Summary
Functions
TranslatorConstruct a new tv.freewheel.SDK.Translator instance.
startNotify the translator to start ad playback.
infoGet the module info of translator.

Functions

Translator

tv.freewheel.SDK.Translator = function()

Construct a new tv.freewheel.SDK.Translator instance.

start

tv.freewheel.SDK.Translator.prototype.start = function(rendererController)

Notify the translator to start ad playback.

Parameter

rendererControllerthe specified RendererController instance.

info

tv.freewheel.SDK.Translator.prototype.info = function()

Get the module info of translator.

Constants

Constants defined for SDK.

Namespace

tv.freewheel.SDK

Summary
ADUNIT_*
ADUNIT_PREROLLType of ad unit: preroll.
ADUNIT_MIDROLLType of ad unit: midroll.
ADUNIT_POSTROLLType of ad unit: postroll.
ADUNIT_OVERLAYType of ad unit: overlay.
ADUNIT_STREAM_PREROLLType of ad unit: preroll of a live stream.
ADUNIT_STREAM_POSTROLLType of ad unit: postroll of a live stream.
TIME_POSITION_*
TIME_POSITION_CLASS_PREROLL
TIME_POSITION_CLASS_MIDROLL
TIME_POSITION_CLASS_POSTROLL
TIME_POSITION_CLASS_OVERLAY
TIME_POSITION_CLASS_DISPLAY
PARAMETER_*
PARAMETER_ENABLE_FORM_TRANSPORTWeather or not to send request and ping callback by submitting forms.
PARAMETER_DESIRED_BITRATEDesired bitrate (user bandwidth) set by player.
PARAMETER_PAGE_SLOT_CONTENT_TYPEThe parameter to configure primary content type of scaned page slot.
PARAMETER_EXTENSION_AD_CONTROL_CLICK_ELEMENTThe parameter to config which element AdManager would listen and process click event on.
PARAMETER_EXTENSION_CONTENT_VIDEO_ENABLEDThe boolean value to control whether the JSAM or player should listen and handle EVENT_CONTENT_VIDEO_* events.
PARAMETER_EXTENSION_CONTENT_VIDEO_AUTO_SEEK_BACKThe boolean value to control whether JSAM will auto seek back after midroll on iPad.
PARAMETER_RENDERER_VIDEO_START_DETECT_TIMEOUTThe timeout in milliseconds for VideoRenderer.
PARAMETER_VAST_TIMEOUT_IN_MILLISECONDSThe timeout in milliseconds for VAST Translator to load VAST url.
PARAMETER_RENDERER_VIDEO_PROGRESS_DETECT_TIMEOUTThe timeout in milliseconds for VideoRenderer to detect video ad progress timeout.
PARAMETER_RENDERER_VIDEO_DISPLAY_CONTROLS_WHEN_PAUSEThe boolean value to control whether ad video element’s default controls should be displayed when pause.
PARAMETER_EXTENSION_SURVEY_ENABLEDThe boolean value to control whether SurveyExtension should be enabled.
PARAMETER_RENDERER_DISPLAY_COAD_SCRIPT_NAMEThe js function name to render HTML content for display ad.
PARAMETER_LEVEL_*
PARAMETER_LEVEL_PROFILE
PARAMETER_LEVEL_GLOBAL
PARAMETER_LEVEL_OVERRIDE
CAPABILITY_STATUS_*
CAPABILITY_STATUS_OFF
CAPABILITY_STATUS_ON
CAPABILITY_*
CAPABILITY_SLOT_TEMPLATEPlayer expects template-based slots generated by ad server.
CAPABILITY_MULTIPLE_CREATIVE_RENDITIONSPlayer expects multiple creative renditions for an ad.
CAPABILITY_RECORD_VIDEO_VIEWPlayer allows video playback statistic report to FreeWheel.
CAPABILITY_CHECK_COMPANIONPlayer expects ad server to check companion for candidate ads.
CAPABILITY_CHECK_TARGETINGPlayer expects ad server to check targeting for candidate ads.
CAPABILITY_RESET_EXCLUSIVITYPlayer reset the exclusivity scope.
EVENT_*
EVENT_REQUEST_COMPLETEType of AdManager event: an ad request is complete, either success or failure.
EVENT_SLOT_STARTEDType of AdManager event: a slot starts.
EVENT_SLOT_ENDEDType of AdManager event: a slot ends.
EVENT_ERROREvent name: Ad error.
EVENT_RESELLER_NO_ADEvent name: reseller no ad.
EVENT_ADType of an IAB ad event.
EVENT_AD_*
EVENT_AD_IMPRESSIONType of AdManager event: an ad starts.
EVENT_AD_IMPRESSION_ENDType of AdManager event: an ad ends.
EVENT_AD_VOLUME_CHANGEAdManager Event: ad volume has changed.
EVENT_AD_FIRST_QUARTILEEvent name: Ad first quartile.
EVENT_AD_MIDPOINTEvent name: Ad midpoint.
EVENT_AD_THIRD_QUARTILEEvent name: Ad third quartile.
EVENT_AD_COMPLETEEvent name: Ad complete.
EVENT_AD_CLICKEvent name: Ad click.
EVENT_AD_MUTEEvent name: Ad mute.
EVENT_AD_UNMUTEEvent name: Ad unmute.
EVENT_AD_COLLAPSEEvent name: Ad collapse.
EVENT_AD_EXPANDEvent name: Ad expand.
EVENT_AD_PAUSEEvent name: Ad pause.
EVENT_AD_RESUMEEvent name: Ad resume.
EVENT_AD_REWINDEvent name: Ad rewind.
EVENT_AD_ACCEPT_INVITATIONEvent name: Ad accept invitation.
EVENT_AD_CLOSEEvent name: Ad close.
EVENT_AD_MINIMIZEEvent name: Ad minimize.
EVENT_AD_MEASUREMENTEvent name: Ad Concrete event.
EVENT_CONTENT_VIDEO_*
EVENT_CONTENT_VIDEO_PAUSE_REQUESTType of AdManager event: adManager is requesting to pause content video.
EVENT_CONTENT_VIDEO_RESUME_REQUESTType of AdManager event: adManager is requesting to resume content video playback.
ID_TYPE_*
ID_TYPE_FWType of id: a unique id provided by FreeWheel.
ID_TYPE_CUSTOMType of id: a custom id provided by non-FreeWheel parties.
ID_TYPE_GROUPType of id: a unique group id provided by FreeWheel.
VIDEO_STATE_*
VIDEO_STATE_PLAYINGCurrent video is playing.
VIDEO_STATE_PAUSEDCurrent video is paused.
VIDEO_STATE_STOPPEDCurrent video has stopped.
VIDEO_STATE_COMPLETEDCurrent video has completed playing.
VIDEO_ASSET_AUTO_PLAY_TYPE_*
VIDEO_ASSET_AUTO_PLAY_TYPE_ATTENDEDVideo asset auto play type: attended.
VIDEO_ASSET_AUTO_PLAY_TYPE_UNATTENDEDVideo asset auto play type: unattended.
VIDEO_ASSET_AUTO_PLAY_TYPE_NONEVideo asset auto play type: non auto play.
VIDEO_ASSET_DURATION_*
VIDEO_ASSET_DURATION_TYPE_EXACTVideo asset duration type: exact.
VIDEO_ASSET_DURATION_TYPE_VARIABLEVideo asset duration type: variable.
REQUEST_MODE_*
REQUEST_MODE_ON_DEMANDRequest mode: on-demand.
REQUEST_MODE_LIVERequest mode: live.
RENDERER_STATE_*tv.freewheel.SDK
RENDERER_STATE_STARTED
RENDERER_STATE_COMPLETED
RENDERER_STATE_FAILED
EVENT_TYPE_*tv.freewheel.SDK
EVENT_TYPE_CLICK_TRACKING
EVENT_TYPE_IMPRESSION
EVENT_TYPE_CLICK
EVENT_TYPE_STANDARD
EVENT_AD_*tv.freewheel.SDK
EVENT_AD_QUARTILE
EVENT_AD_FIRST_QUARTILE
EVENT_AD_MIDPOINT
EVENT_AD_THIRD_QUARTILE
EVENT_AD_COMPLETE
EVENT_AD_IMPRESSION
EVENT_AD_CLICK
EVENT_AD_MUTE
EVENT_AD_UNMUTE
EVENT_AD_COLLAPSE
EVENT_AD_EXPAND
EVENT_AD_PAUSE
EVENT_AD_RESUME
EVENT_AD_REWIND
EVENT_AD_ACCEPT_INVITATION
EVENT_AD_CLOSE
EVENT_AD_MINIMIZE
EVENT_AD_MEASUREMENT
INFO_KEY_*tv.freewheel.SDK
INFO_KEY_MODULE_TYPE
INFO_KEY_ERROR_CODE
INFO_KEY_ERROR_INFO
INFO_KEY_SHOW_BROWSER
INFO_KEY_CONCRETE_EVENT_ID
INFO_KEY_CUSTOM_EVENT_NAME
MODULE_TYPE_*tv.freewheel.SDK
MODULE_TYPE_EXTENSION
MODULE_TYPE_RENDERER
MODULE_TYPE_TRANSLATOR
ERROR_*tv.freewheel.SDK
ERROR_IO
ERROR_TIMEOUT
ERROR_NULL_ASSET
ERROR_UNKNOWN
ERROR_MISSING_PARAMETER
ERROR_NO_AD_AVAILABLE
ERROR_PARSE
ERROR_INVALID_VALUE
ERROR_INVALID_SLOT
ERROR_3P_COMPONENT
ERROR_UNSUPPORTED_3P_FEATURE
ERROR_DEVICE_LIMIT
ERROR_SECURITY
ERROR_UNMATCHED_SLOT_SIZE
TRANSLATOR_STATE_*
TRANSLATOR_STATE_STARTED
TRANSLATOR_STATE_COMPLETING
TRANSLATOR_STATE_COMPLETED
TRANSLATOR_STATE_FAILED

ADUNIT_*

ADUNIT_PREROLL

Type of ad unit: preroll.

ADUNIT_MIDROLL

Type of ad unit: midroll.

ADUNIT_POSTROLL

Type of ad unit: postroll.

ADUNIT_OVERLAY

Type of ad unit: overlay.

ADUNIT_STREAM_PREROLL

Type of ad unit: preroll of a live stream.

ADUNIT_STREAM_POSTROLL

Type of ad unit: postroll of a live stream.

TIME_POSITION_*

TIME_POSITION_CLASS_PREROLL

TIME_POSITION_CLASS_MIDROLL

TIME_POSITION_CLASS_POSTROLL

TIME_POSITION_CLASS_OVERLAY

TIME_POSITION_CLASS_DISPLAY

PARAMETER_*

PARAMETER_ENABLE_FORM_TRANSPORT

Weather or not to send request and ping callback by submitting forms.  This parameter need to be set before submitting request.  Default value: false.

Example

//Enable form submitting
theContext.setParameter(tv.freewheel.SDK.PARAMETER_ENABLE_FORM_TRANSPORT, true, tv.freewheel.SDK.PARAMETER_LEVEL_GLOBAL);

PARAMETER_DESIRED_BITRATE

Desired bitrate (user bandwidth) set by player.  Once set, the value will be used in video ad renderer for rendition selection.  The value should be in kbps.  This parameter should be set on level PARAMETER_LEVEL_OVERRIDE.

Example

// Suppose user bandwidth is 500kbps:
theContext.setParameter(tv.freewheel.SDK.PARAMETER_DESIRED_BITRATE, 500, tv.freewheel.SDK.PARAMETER_LEVEL_OVERRIDE);

PARAMETER_PAGE_SLOT_CONTENT_TYPE

The parameter to configure primary content type of scaned page slot.  Note that this parameter only can set in player side.  When using two or more content type, make sure they are separated by commas.  Default value is ‘text/html_doc_lit_mobile,text/html_doc_ref’.  Optional content type:

  • text/html_doc_lit_mobile
  • text/html_doc_ref
  • text/html_lit_js_wc_nw

Example

// Suppose use 'text/html_doc_lit_mobile' and 'text/html_doc_ref':
theContext.setParameter(tv.freewheel.SDK.PARAMETER_PAGE_SLOT_CONTENT_TYPE, 'text/html_doc_lit_mobile,text/html_doc_ref',tv.freewheel.SDK.PARAMETER_LEVEL_OVERRIDE);

PARAMETER_EXTENSION_AD_CONTROL_CLICK_ELEMENT

The parameter to config which element AdManager would listen and process click event on.

  • If the parameter is set, JSAM would process click event on the set element, and disable the click listening on the ad element.
  • If the parameter is not set or set to a undetectable element, JSAM will listen click event with the default way(listening on the ad element).

Example

//Config AdManager to process click event on an existing element with id 'Element_Click_Target'
theContext.setParameter(tv.freewheel.SDK.PARAMETER_EXTENSION_AD_CONTROL_CLICK_ELEMENT, 'Element_Click_Target', tv.freewheel.SDK.PARAMETER_LEVEL_GLOBAL);

PARAMETER_EXTENSION_CONTENT_VIDEO_ENABLED

The boolean value to control whether the JSAM or player should listen and handle EVENT_CONTENT_VIDEO_* events.

  • If this value is true, adManager will have one content video extension to listen and handle the EVENT_CONTENT_VIDEO_* events.
  • If this value is false, player will take the responsibility to listen and handle the <EVENT_CONTENT__VIDEO_*> events, i.e., relative events listening and handling logic are implemented on player side.

Default value is true.

Example

//Disable the content video extension, player will handle all the EVENT_CONTENT_VIDEO_* events.
theContext.setParameter(tv.freewheel.SDK.PARAMETER_EXTENSION_CONTENT_VIDEO_ENABLED, false, tv.freewheel.SDK.PARAMETER_LEVEL_GLOBAL);

PARAMETER_EXTENSION_CONTENT_VIDEO_AUTO_SEEK_BACK

The boolean value to control whether JSAM will auto seek back after midroll on iPad.

On iPad 3.2 and above, when user clickthroughs on midroll video ad and return, content video will lost all the playback state.  In this case, when midroll playback completes, content video will restart from the beginning, rather than resuming at the previous pause point.  To improve User Experience, JSAM implements this logic for iPad:

  • After midroll, automatically seeking back to the previous pause point if the content video starts over.

This parameter is the boolean value to control whether this auto seeking logic would be enabled.

Default value is true.

Example

//Disable the auto seeking back logic.
theContext.setParameter(tv.freewheel.SDK.PARAMETER_EXTENSION_CONTENT_VIDEO_AUTO_SEEK_BACK, false, tv.freewheel.SDK.PARAMETER_LEVEL_GLOBAL);

PARAMETER_RENDERER_VIDEO_START_DETECT_TIMEOUT

The timeout in milliseconds for VideoRenderer.  VideoRenderer will timeout if ad playback does not successfully start.  Default value is 3000 milliseconds.

Example

theContext.setParameter(tv.freewheel.SDK.PARAMETER_RENDERER_VIDEO_START_DETECT_TIMEOUT, 5000, tv.freewheel.SDK.PARAMETER_LEVEL_GLOBAL);

PARAMETER_VAST_TIMEOUT_IN_MILLISECONDS

The timeout in milliseconds for VAST Translator to load VAST url.  Translator will timeout if the target VAST url does not respond.  Default value is 5000 milliseconds.

Example

theContext.setParameter(tv.freewheel.SDK.PARAMETER_VAST_TIMEOUT_IN_MILLISECONDS , 10000, tv.freewheel.SDK.PARAMETER_LEVEL_GLOBAL);

PARAMETER_RENDERER_VIDEO_PROGRESS_DETECT_TIMEOUT

The timeout in milliseconds for VideoRenderer to detect video ad progress timeout.  VideoRenderer will timeout if ad playback progress stalls after playback starts.  Default value is 6000 milliseconds.

Example

theContext.setParameter(tv.freewheel.SDK.PARAMETER_RENDERER_VIDEO_PROGRESS_DETECT_TIMEOUT , 10000, tv.freewheel.SDK.PARAMETER_LEVEL_GLOBAL);

PARAMETER_RENDERER_VIDEO_DISPLAY_CONTROLS_WHEN_PAUSE

The boolean value to control whether ad video element’s default controls should be displayed when pause.

When playing video ad, pause event may be fired by click through or some other reason.  Then user should be granted the capability to resume ad playback after pause.

By setting this parameter to false, player is notifying VideoRenderer not to display default controls when pause.  So player should add some custom controls for user to resume in this case.

Default value is true.

Example

theContext.setParameter(tv.freewheel.SDK.PARAMETER_RENDERER_VIDEO_DISPLAY_CONTROLS_WHEN_PAUSE, false, tv.freewheel.SDK.PARAMETER_LEVEL_GLOBAL);

PARAMETER_EXTENSION_SURVEY_ENABLED

The boolean value to control whether SurveyExtension should be enabled.

When an ad starts play, SurveyExtension will check the ad’s creative to see if it has the survey url to pingback.  If yes, SurveyExtension will append the survey url as script link to the page’s head element.

By setting this parameter to false, SurveyExtension won’t pingback the survey url no matter it exists or not.

Default value is true.

Example

theContext.setParameter(tv.freewheel.SDK.PARAMETER_EXTENSION_SURVEY_ENABLED, false, tv.freewheel.SDK.PARAMETER_LEVEL_GLOBAL);

PARAMETER_RENDERER_DISPLAY_COAD_SCRIPT_NAME

The js function name to render HTML content for display ad.

The js function must exist on Client’s page.

PARAMETER_LEVEL_*

PARAMETER_LEVEL_PROFILE

PARAMETER_LEVEL_GLOBAL

PARAMETER_LEVEL_OVERRIDE

CAPABILITY_STATUS_*

CAPABILITY_STATUS_OFF

CAPABILITY_STATUS_ON

CAPABILITY_*

CAPABILITY_SLOT_TEMPLATE

Player expects template-based slots generated by ad server.

CAPABILITY_MULTIPLE_CREATIVE_RENDITIONS

Player expects multiple creative renditions for an ad.

CAPABILITY_RECORD_VIDEO_VIEW

Player allows video playback statistic report to FreeWheel.

CAPABILITY_CHECK_COMPANION

Player expects ad server to check companion for candidate ads.

CAPABILITY_CHECK_TARGETING

Player expects ad server to check targeting for candidate ads.

CAPABILITY_RESET_EXCLUSIVITY

Player reset the exclusivity scope.  Player can turn on/off this capability before making any request.

EVENT_*

EVENT_REQUEST_COMPLETE

Type of AdManager event: an ad request is complete, either success or failure.

A player MUST respond to this event.

Event Parameters

typeEVENT_REQUEST_COMPLETE
targetthe target context object.
successtrue if success, false otherwise.

EVENT_SLOT_STARTED

Type of AdManager event: a slot starts.

Event Parameters

typeEVENT_SLOT_STARTED
targetthe target context object.
slotthe target slot.

EVENT_SLOT_ENDED

Type of AdManager event: a slot ends.

Event Parameters

typeEVENT_SLOT_ENDED
targetthe target context object.
slotthe target slot.

EVENT_ERROR

Event name: Ad error.  Broadcasted with the type RENDERER_EVENT when there’s any error.

EVENT_RESELLER_NO_AD

Event name: reseller no ad.  Broadcasted with the type RENDERER_EVENT when FreeWheel fails to get any playable ad from a reseller.

EVENT_AD_*

EVENT_AD_IMPRESSION

Type of AdManager event: an ad starts.

Event Parameters

typeEVENT_AD_IMPRESSION
targetthe target context object.
adInstancethe target ad.

EVENT_AD_IMPRESSION_END

Type of AdManager event: an ad ends.

Event Parameters

typeEVENT_AD_IMPRESSION_END
targetthe target context object.
adInstancethe target ad.

EVENT_AD_VOLUME_CHANGE

AdManager Event: ad volume has changed.

Event Parameters

targetthe Context object that dispatched this event.
adInstancethe adInstance whose volume has been changed.
slotthe slot that contains the aforementioned adInstance.

EVENT_AD_FIRST_QUARTILE

Event name: Ad first quartile.

EVENT_AD_MIDPOINT

Event name: Ad midpoint.

EVENT_AD_THIRD_QUARTILE

Event name: Ad third quartile.

EVENT_AD_COMPLETE

Event name: Ad complete.

EVENT_AD_CLICK

Event name: Ad click.

EVENT_AD_MUTE

Event name: Ad mute.

EVENT_AD_UNMUTE

Event name: Ad unmute.

EVENT_AD_COLLAPSE

Event name: Ad collapse.

EVENT_AD_EXPAND

Event name: Ad expand.

EVENT_AD_PAUSE

Event name: Ad pause.

EVENT_AD_RESUME

Event name: Ad resume.

EVENT_AD_REWIND

Event name: Ad rewind.

EVENT_AD_ACCEPT_INVITATION

Event name: Ad accept invitation.

EVENT_AD_CLOSE

Event name: Ad close.

EVENT_AD_MINIMIZE

Event name: Ad minimize.

EVENT_AD_MEASUREMENT

Event name: Ad Concrete event.

EVENT_CONTENT_VIDEO_*

EVENT_CONTENT_VIDEO_PAUSE_REQUEST

Type of AdManager event: adManager is requesting to pause content video.

This event is added to facilitate the communication between adManager and player on the playback control of content video.

Defaultly(PARAMETER_EXTENSION_CONTENT_VIDEO_ENABLED is true), adManager will have one content video extension to listen on this event.  When extension receives this event, it will hide and pause the content video.

If player want to listen and handle this event by itself, player MUST set PARAMETER_EXTENSION_CONTENT_VIDEO_ENABLED to false and implements player-side event handler to pause and hide content video.

Event Parameters

typeEVENT_CONTENT_VIDEO_PAUSE_REQUEST

EVENT_CONTENT_VIDEO_RESUME_REQUEST

Type of AdManager event: adManager is requesting to resume content video playback.

This event is added to facilitate the communication between adManager and player on the playback control of content video.

Defaultly(PARAMETER_EXTENSION_CONTENT_VIDEO_ENABLED is true), adManager will have one content video extension to listen on this event.  When extension receives this event, it will resume and show the content video.

If player want to listen and handle this event by itself, player MUST set PARAMETER_EXTENSION_CONTENT_VIDEO_ENABLED to false and implements player-side event handler to resume and show content video.

Event Parameters

typeEVENT_CONTENT_VIDEO_RESUME_REQUEST

ID_TYPE_*

ID_TYPE_FW

Type of id: a unique id provided by FreeWheel.

ID_TYPE_CUSTOM

Type of id: a custom id provided by non-FreeWheel parties.

ID_TYPE_GROUP

Type of id: a unique group id provided by FreeWheel.

VIDEO_STATE_*

VIDEO_STATE_PLAYING

Current video is playing.

VIDEO_STATE_PAUSED

Current video is paused.

VIDEO_STATE_STOPPED

Current video has stopped.

VIDEO_STATE_COMPLETED

Current video has completed playing.

VIDEO_ASSET_AUTO_PLAY_TYPE_*

VIDEO_ASSET_AUTO_PLAY_TYPE_ATTENDED

Video asset auto play type: attended.

VIDEO_ASSET_AUTO_PLAY_TYPE_UNATTENDED

Video asset auto play type: unattended.

VIDEO_ASSET_AUTO_PLAY_TYPE_NONE

Video asset auto play type: non auto play.

VIDEO_ASSET_DURATION_*

VIDEO_ASSET_DURATION_TYPE_EXACT

Video asset duration type: exact.

VIDEO_ASSET_DURATION_TYPE_VARIABLE

Video asset duration type: variable.

REQUEST_MODE_*

REQUEST_MODE_ON_DEMAND

Request mode: on-demand.

REQUEST_MODE_LIVE

Request mode: live.

RENDERER_STATE_*

Namespace

tv.freewheel.SDK

RENDERER_STATE_STARTED

RENDERER_STATE_COMPLETED

RENDERER_STATE_FAILED

EVENT_TYPE_*

Namespace

tv.freewheel.SDK

EVENT_TYPE_CLICK_TRACKING

EVENT_TYPE_IMPRESSION

EVENT_TYPE_CLICK

EVENT_TYPE_STANDARD

EVENT_AD_*

Namespace

tv.freewheel.SDK

EVENT_AD_QUARTILE

EVENT_AD_FIRST_QUARTILE

EVENT_AD_MIDPOINT

EVENT_AD_THIRD_QUARTILE

EVENT_AD_COMPLETE

EVENT_AD_IMPRESSION

EVENT_AD_CLICK

EVENT_AD_MUTE

EVENT_AD_UNMUTE

EVENT_AD_COLLAPSE

EVENT_AD_EXPAND

EVENT_AD_PAUSE

EVENT_AD_RESUME

EVENT_AD_REWIND

EVENT_AD_ACCEPT_INVITATION

EVENT_AD_CLOSE

EVENT_AD_MINIMIZE

EVENT_AD_MEASUREMENT

INFO_KEY_*

Namespace

tv.freewheel.SDK

INFO_KEY_MODULE_TYPE

INFO_KEY_ERROR_CODE

INFO_KEY_ERROR_INFO

INFO_KEY_SHOW_BROWSER

INFO_KEY_CONCRETE_EVENT_ID

INFO_KEY_CUSTOM_EVENT_NAME

MODULE_TYPE_*

Namespace

tv.freewheel.SDK

MODULE_TYPE_EXTENSION

MODULE_TYPE_RENDERER

MODULE_TYPE_TRANSLATOR

ERROR_*

Namespace

tv.freewheel.SDK

ERROR_IO

ERROR_TIMEOUT

ERROR_NULL_ASSET

ERROR_UNKNOWN

ERROR_MISSING_PARAMETER

ERROR_NO_AD_AVAILABLE

ERROR_PARSE

ERROR_INVALID_VALUE

ERROR_INVALID_SLOT

ERROR_3P_COMPONENT

ERROR_UNSUPPORTED_3P_FEATURE

ERROR_DEVICE_LIMIT

ERROR_SECURITY

ERROR_UNMATCHED_SLOT_SIZE

TRANSLATOR_STATE_*

TRANSLATOR_STATE_STARTED

TRANSLATOR_STATE_COMPLETING

TRANSLATOR_STATE_COMPLETED

TRANSLATOR_STATE_FAILED

tv.freewheel.SDK.setLogLevel = function(logLevel)
Set the logLevel of a FreeWheel HTML5 SDK.
tv.freewheel.SDK.AdManager = function()
Construct a new tv.freewheel.SDK.AdManager instance.
tv.freewheel.SDK.AdManager.prototype.setNetwork = function(networkId)
Set the network ID of the distributor.
tv.freewheel.SDK.AdManager.prototype.setServer = function(serverUrl)
Set the ad server URL provided by FreeWheel.
tv.freewheel.SDK.AdManager.prototype.setLocation = function(location)
Set the current geographic location of the device.
tv.freewheel.SDK.AdManager.prototype.newContext = function()
Construct a new tv.freewheel.SDK.Context instance.
tv.freewheel.SDK.AdManager.prototype.newContextWithContext = function(context)
Construct a new tv.freewheel.SDK.Context instance from the given Context instance.
tv.FreeWheel.SDK.Context.prototype.addRenderer = function(url,
baseUnit,
contentType,
slotType,
soAdUnit,
creativeApi,
parameters)
Add a renderer with loading URL and match conditions.
tv.freewheel.SDK.Context.prototype.setCapability = function(capability,
status)
Set the capabilities supported by the player.
tv.freewheel.SDK.Context.prototype.addKeyValue = function(key,
value)
Set the key-value pair.
tv.freewheel.SDK.Context.prototype.setParameter = function(name,
value,
level)
Set the parameters for a special level.
tv.freewheel.SDK.Context.prototype.getParameter = function(name)
Get the parameter for a special level.
tv.freewheel.SDK.Context.prototype.setVideoState = function(videoState)
Set the video state.
tv.freewheel.SDK.Context.prototype.getAdVolume = function()
Gets the volume of video/audio ads.
tv.freewheel.SDK.Context.prototype.setAdVolume = function(adVolume)
Sets the volume of video/audio ads.
tv.freewheel.SDK.Context.prototype.registerVideoDisplayBase = function(id)
Register the display area for temporal ads display, the area, typically is a div or span, could be any other HTML element, must contains the video element of the content video.
tv.freewheel.SDK.Context.prototype.setContentVideoElement = function(id)
Set the content video element.
tv.freewheel.SDK.Context.prototype.resize = function(width,
height)
Notify AdManager that the player size changes so ad sizes can adjust accordingly
tv.freewheel.SDK.Context.prototype.setVideoDisplayCompatibleSizes = function(
   compatibleDimensions
)
Set a list of acceptable alternative dimensions.
tv.freewheel.SDK.Context.prototype.setProfile = function(playerProfile)
Set the profiles which describes the player.
tv.freewheel.SDK.Context.prototype.setVideoAsset = function(id,
duration,
networkId,
location,
autoPlayType,
videoViewRandom,
idType,
fallbackId,
durationType)
Set the video asset info for the ad request.
tv.freewheel.SDK.Context.prototype.setVideoAssetCurrentTimePosition = function(
   timePosition
)
Set the current logical time position of the content asset.
tv.freewheel.SDK.Context.prototype.setSiteSection = function(id,
networkId,
pageViewRandom,
idType,
fallbackId)
Set the site section info for the ad request.
tv.freewheel.SDK.Context.prototype.setVisitor = function(customId,
ipV4Address)
Set the visitor info for the ad request.
tv.freewheel.SDK.Context.prototype.startSubsession = function(subsessionToken)
Start a subsession with the given token.
tv.freewheel.SDK.Context.prototype.setRequestMode = function (mode)
Set request mode of AdManager.
tv.freewheel.SDK.Context.prototype.setRequestDuration = function (duration)
Set the duration for which the player is requesting ads.
tv.freewheel.SDK.Context.prototype.addCandidateAd = function (id)
Add candidate ads for the request to FreeWheel Ad Server.
tv.freewheel.SDK.Context.prototype.addTemporalSlot = function(
   customId,
   adUnit,
   timePosition,
   slotProfile,
   cuepointSequence,
   maxDuration,
   minDuration,
   acceptContentType,
   signalId
)
Add a temporal slot.
tv.freewheel.SDK.Context.prototype.getTemporalSlots = function()
Get all the temporal slots from the response.
tv.freewheel.SDK.Context.prototype.getSlotByCustomId = function(customId)
Get the slot specified by the custom ID.
tv.freewheel.SDK.Context.prototype.getSlotsByTimePositionClass = function(
   timePositionClass
)
Get all slots in specified time position class.
tv.freewheel.SDK.Context.prototype.submitRequest = function(timeoutSeconds)
Submit the ad request to the FreeWheel server which is set by tv.freewheel.SDK.AdManager.setServer.
tv.freewheel.SDK.Context.prototype.addEventListener = function(event,
listener)
Add listener for a Context event.
tv.freewheel.SDK.Context.prototype.removeEventListener = function(event,
listener)
remove listener from a Context event.
tv.freewheel.SDK.Context.prototype.dispose = function()
Dispose this context instance.
tv.freewheel.SDK.Context.prototype.loadExtension = function(ExtensionUrl)
Load the extension from the given URL
tv.freewheel.SDK.Slot.prototype.getCustomId = function()
Get the custom id of the slot.
tv.freewheel.SDK.Slot.prototype.getAdCount = function()
Get the count of the ads in the slot.
tv.freewheel.SDK.Slot.prototype.getTimePosition = function()
Get the time position of the slot.
tv.freewheel.SDK.Slot.prototype.getTimePositionClass = function()
Get the time position class of the slot.
tv.freewheel.SDK.Slot.prototype.getWidth = function()
Get the width of the slot.
tv.freewheel.SDK.Slot.prototype.getHeight = function()
Get the height of the slot.
tv.freewheel.SDK.Slot.prototype.getBase = function()
Get the slot base of this slot.
tv.freewheel.SDK.Slot.prototype.getSignalId = function()
Get the signal Id of the break.
tv.freewheel.SDK.Slot.prototype.play = function()
Play the slot.
tv.freewheel.SDK.Slot.prototype.stop = function()
Stop the slot.
tv.freewheel.SDK.Slot.prototype.pause = function()
Pause the slot.
tv.freewheel.SDK.Slot.prototype.resume = function()
Resume the slot.
tv.freewheel.SDK.Slot.prototype.getParameter = function(name)
Get the parameter set on slot level.
tv.freewheel.SDK.Slot.prototype.setParameter = function(name,
value)
Set the parameters in slot level.
tv.freewheel.SDK.Slot.prototype.getTotalDuration = function()
Get the duration in seconds of the slot.
tv.freewheel.SDK.Slot.prototype.getPlayheadTime = function()
Get the playheadTime in seconds of the slot.
tv.freewheel.SDK.Slot.prototype.getAdInstances = function()
Get all the playble ad instances in the slot.
tv.freewheel.SDK.Slot.prototype.setVisible = function(visible)
Set the visibility of a nontemporal slot.
tv.freewheel.SDK.Slot.prototype.skipCurrentAd = function()
Skip the currently playing ad and move to the next queued ad in the slot Fallback ads associated with the skipped ad will not be played
tv.freewheel.SDK.AdInstance.prototype.getAdId = function()
Get the FreeWheel ad ID of the ad instance.
tv.freewheel.SDK.AdInstance.prototype.getParameter = function(name)
Get the parameter set on AdInstance level.
tv.freewheel.SDK.AdInstance.prototype.getUniversalAdId = function()
Get the universal ad ID of the ad instance.
tv.freewheel.SDK.AdInstance.prototype.getSoAdUnit = function()
Get the soAdUnit of the ad instance.
tv.freewheel.SDK.AdInstance.prototype.getActiveCreativeRendition = function()
Get the active creative rendition.
tv.freewheel.SDK.AdInstance.prototype.addCreativeRendition = function()
Create a creative rendition clone for translation, and add it to current ad’s creative rendition array.
tv.freewheel.SDK.AdInstance.prototype.getAllCreativeRenditions = function()
Get all the creative renditions of the ad instance.And the primary creative rendition is the first element in the returned array.
tv.freewheel.SDK.AdInstance.prototype.getRenderableCreativeRenditions = function()
Get renderable creative renditions.
tv.freewheel.SDK.AdInstance.prototype.setActiveCreativeRendition = function(
   creativeRendition
)
Set active creative rendition.
tv.freewheel.SDK.AdInstance.prototype.getEventCallbackUrls = function(name,
type)
Get the callback urls for a specific event.
tv.freewheel.SDK.AdInstance.prototype.addEventCallbackUrls = function(name,
type,
urls)
Add the callback url to a specific event.
tv.freewheel.SDK.AdInstance.prototype.setClickThroughUrl = function(name,
url)
Set the click through url.
tv.freewheel.SDK.AdInstance.prototype.getSlot = function()
Get the slot of the ad.
tv.freewheel.SDK.AdInstance.prototype.getCompanionAdInstances = function()
Get the playable companion ad instances.
tv.freewheel.SDK.AdInstance.prototype.isRequiredToShow = function()
Whether the ad is required to be shown by law, usually the ad is a companion ad.
tv.freewheel.SDK.AdInstance.prototype.getRendererController = function()
Get the rendererController object for this AdInstance.
tv.freewheel.SDK.AdInstance.prototype.getPlayheadTime = function()
Get the ad instance playheadTime
tv.freewheel.SDK.CreativeRendition.prototype.getContentType = function()
Get the content type of the creative rendition.
tv.freewheel.SDK.CreativeRendition.prototype.setContentType = function(value)
Set the content type of the creative rendition.
tv.freewheel.SDK.CreativeRendition.prototype.getWrapperType = function()
Get the wrapper type of the creative rendition.
tv.freewheel.SDK.CreativeRendition.prototype.setWrapperType = function(value)
Set the wrapper type of the creative rendition.
tv.freewheel.SDK.CreativeRendition.prototype.getWrapperUrl = function()
Get the wrapper url of the creative rendition.
tv.freewheel.SDK.CreativeRendition.prototype.setWrapperUrl = function(value)
Set the wrapper url of the creative rendition.
tv.freewheel.SDK.CreativeRendition.prototype.getBaseUnit = function()
Get the base unit of the creative rendition.
tv.freewheel.SDK.CreativeRendition.prototype.getPreference = function()
Get the preference of the creative rendition.
tv.freewheel.SDK.CreativeRendition.prototype.setPreference = function(value)
Set the preference of the creative rendition.
tv.freewheel.SDK.CreativeRendition.prototype.getWidth = function()
Get the width of the creative rendition.
tv.freewheel.SDK.CreativeRendition.prototype.setWidth = function(value)
Set the width of the creative rendition.
tv.freewheel.SDK.CreativeRendition.prototype.getHeight = function()
Get the height of the creative rendition.
tv.freewheel.SDK.CreativeRendition.prototype.setHeight = function(value)
Set the height of the creative rendition.
tv.freewheel.SDK.CreativeRendition.prototype.getDuration = function()
Get the duration of the creative rendition.
tv.freewheel.SDK.CreativeRendition.prototype.setDuration = function(value)
Set the duration of the creative rendition.
tv.freewheel.SDK.CreativeRendition.prototype.getParameter = function(name)
Get the value of the specific parameter name.
tv.freewheel.SDK.CreativeRendition.prototype.setParameter = function(name,
value)
Set the specific parameter of the creative rendition.
tv.freewheel.SDK.CreativeRendition.prototype.addCreativeRenditionAsset = function(
   name,
   isPrimary
)
Add a creative rendition asset to the this creative rendition.
tv.freewheel.SDK.CreativeRendition.prototype.getPrimaryCreativeRenditionAsset = function()
Get the primary asset of the creative rendition.
tv.freewheel.SDK.CreativeRendition.prototype.getOtherCreativeRenditionAssets = function ()
Get other creative rendition assets.
tv.freewheel.SDK.CreativeRendition.prototype.getCreativeApi = function()
Get the creativeApi name of the creative rendition.
tv.freewheel.SDK.CreativeRenditionAsset.prototype.getName = function()
Get the name of the creative rendition asset.
tv.freewheel.SDK.CreativeRenditionAsset.prototype.setName = function(value)
Set the name of the creative rendition asset.
tv.freewheel.SDK.CreativeRenditionAsset.prototype.getUrl = function()
Get the url of the creative rendition asset.
tv.freewheel.SDK.CreativeRenditionAsset.prototype.setUrl = function(value)
Set the url of the creative rendition asset.
tv.freewheel.SDK.CreativeRenditionAsset.prototype.getContent = function()
Get the content of the creative rendition asset.
tv.freewheel.SDK.CreativeRenditionAsset.prototype.setContent = function(value)
Set the content of the creative rendition asset.
tv.freewheel.SDK.CreativeRenditionAsset.prototype.getContentType = function()
Get the content type of the creative rendition asset.
tv.freewheel.SDK.CreativeRenditionAsset.prototype.setContentType = function(
   value
)
Set the content type of the creative rendition asset.
tv.freewheel.SDK.CreativeRenditionAsset.prototype.getMimeType = function()
Get the mime type of the creative rendition asset.
tv.freewheel.SDK.CreativeRenditionAsset.prototype.setMimeType = function(value)
Set the mime type of the creative rendition asset.
tv.freewheel.SDK.CreativeRenditionAsset.prototype.getBytes = function()
Get the size of the creative rendition asset in bytes.
tv.freewheel.SDK.CreativeRenditionAsset.prototype.setBytes = function(value)
Set the size of the creative rendition asset in bytes.
tv.freewheel.SDK.Renderer.prototype.start = function(rendererController)
Notify the renderer to start ad playback.
tv.freewheel.SDK.Renderer.prototype.stop = function()
Notify the renderer to stop ad playback.
tv.freewheel.SDK.Renderer.prototype.pause = function()
Notify the renderer to pause ad playback.
tv.freewheel.SDK.Renderer.prototype.resume = function()
Notify the renderer to resume ad playback.
tv.freewheel.SDK.Renderer.prototype.info = function()
Get the module info of renderer.
tv.freewheel.SDK.Renderer.prototype.getPlayheadTime = function()
Get the ad playheadTime
tv.freewheel.SDK.Renderer.prototype.getDuration = function()
Get the duration of the ad.
tv.freewheel.SDK.Renderer.prototype.resize = function()
Resize the ad
tv.freewheel.SDK.Renderer.prototype.setVolume = function(volume)
Set the volume of the ad When called, the renderer is expected to update the volume for the current ad playback and dispatch `EVENT_AD_VOLUME_CHANGE` by calling RendererController.processEvent({name:EVENT_AD_VOLUME_CHANGE}) if the ad volume is changed.
tv.freewheel.SDK.RendererController.prototype.processEvent = function(event)
Process renderer event
tv.freewheel.SDK.RendererController.prototype.handleStateTransition = function(
   rendererStateEvent,
   additionalInfo
)
Handle renderer state transition
tv.freewheel.SDK.RendererController.prototype.setCapability = function(
   eventCapability,
   status
)
Declare capability of the renderer.
tv.freewheel.SDK.RendererController.prototype.getVersion = function()
Get the version of AdManager.
tv.freewheel.SDK.RendererController.prototype.getParameter = function(name)
Get the parameter with a specific name.
tv.freewheel.SDK.RendererController.prototype.getAdInstance = function()
Get the corresponding ad instance of this renderer controller.
tv.freewheel.SDK.RendererController.prototype.getCompanionSlots = function()
Get all placeholder companion slots of this ad.
tv.freewheel.SDK.RendererController.prototype.scheduleAdInstances = function(
   slots
)
Schedule ad instances for specified slots.
tv.freewheel.SDK.RendererController.prototype.commitAdInstances = function()
Commit scheduled ad instances.
tv.freewheel.SDK.RendererController.prototype.log = function(msg)
Log message via FreeWheel AdManager’s log with prefix of Slot, AdInstance info.
tv.freewheel.SDK
tv.freewheel.SDK
tv.freewheel.SDK.RendererController.prototype.getContentVideoElement = function()
Get content video video/ element
tv.FreeWheel.SDK.Extension.prototype.init = function(AdContext)
Initialize the extension Parameter: an AdContext instance
tv.FreeWheel.SDK.Extension.prototype.dispose = function()
Dispose the extension when module unloads or AdManager disposes
tv.freewheel.SDK.Translator = function()
Construct a new tv.freewheel.SDK.Translator instance.
tv.freewheel.SDK.Translator.prototype.start = function(rendererController)
Notify the translator to start ad playback.
tv.freewheel.SDK.Translator.prototype.info = function()
Get the module info of translator.
An Context instance represents context of an ad request, which is capable of making ad request, parsing response and rendering ads.
Player expects template-based slots generated by ad server.
Player expects multiple creative renditions for an ad.
Player allows video playback statistic report to FreeWheel.
Player expects ad server to check companion for candidate ads.
Player expects ad server to check targeting for candidate ads.
Player reset the exclusivity scope.
Current video is playing.
Current video is paused.
Current video has stopped.
Current video has completed playing.
Video asset auto play type: non auto play.
Video asset auto play type: attended.
Video asset auto play type: unattended.
Type of id: a unique id provided by FreeWheel.
Type of id: a custom id provided by non-FreeWheel parties.
Type of id: a unique group id provided by FreeWheel.
Video asset duration type: exact.
Video asset duration type: variable.
Request mode: on-demand.
Request mode: live.
Type of AdManager event: an ad request is complete, either success or failure.
Type of AdManager event: a slot starts.
Type of AdManager event: a slot ends.
Type of AdManager event: adManager is requesting to pause content video.
Type of AdManager event: adManager is requesting to resume content video playback.
Type of AdManager event: an ad starts.
Type of AdManager event: an ad ends.
Event name: Ad click.
tv.freewheel.SDK
RendererController acts as a bridge between AdManager and a renderer.
tv.freewheel.SDK
Event name: Ad first quartile.
Event name: Ad midpoint.
Event name: Ad third quartile.
Event name: Ad complete.
Event name: Ad mute.
Event name: Ad unmute.
Event name: Ad pause.
Event name: Ad resume.
Event name: Ad rewind.
Event name: Ad expand.
Event name: Ad collapse.
Event name: Ad minimize.
Event name: Ad accept invitation.
Event name: Ad close.
Event name: Ad error.
Event name: reseller no ad.
The boolean value to control whether the JSAM or player should listen and handle EVENT_CONTENT_VIDEO_* events.