Freewheel()
Initialize an instance of the current class using the new keyword along with this constructor.
Methods
-
initialize(amcIn)
-
Initializes the class by registering the ad manager controller. Adds listeners to Ooyala player events.
Parameters:
Name Type Description amcIn
object A reference to the ad manager controller instance -
loadMetadata(metadata, baseMetadata, movieMetadata)
-
This is called by the ad manager controller when the metadata has been loaded. Ingests metadata. Loads the remote ad module. Checks if the module is ready to send the request to Freewheel which would return the list of ads.
Parameters:
Name Type Description metadata
object Ad manager metadata from Backlot and from the page level baseMetadata
object Base level metadata from Backlot movieMetadata
object Metadata pertaining specifically to the movie being played -
registerUi()
-
Called when the UI has been setup. Sets up the native element listeners and style for the overlay. Checks if the module is ready to send the request to Freewheel which would return the list of ads.
-
buildTimeline() → {Array.<OO.AdManagerController#Ad>}
-
Called by the ad manager controller. Creates OO.AdManagerController#Ad objects, places them in an array, and returns them to the ad manager controller. Since the list of ads won't be ready when this function is called, this returns a placeholder preroll ad during which the list of ads will be fetched. This prevents the video from starting before the list has been retrieved.
Returns:
timeline A list of the ads to play for the current video- Type
- Array.<OO.AdManagerController#Ad>
-
playAd(ad)
-
Called by the ad manager controller. Plays an ad or triggers a the freewheel request for the list of ads.
Parameters:
Name Type Description ad
object The ad to play -
pauseAd(ad)
-
Called by the ad manager controller. Pauses the current ad. Not implemented because the ooyala player handles pause for freewheel.
Parameters:
Name Type Description ad
object The ad to pause -
resumeAd(ad)
-
Called by the ad manager controller. Resumes the current ad. Not implemented because the ooyala player handles resume for freewheel.
Parameters:
Name Type Description ad
object The ad to resume -
cancelAd(ad)
-
Called by the ad manager controller. Cancels an ad if the ad passed in is the currently playing ad.
Parameters:
Name Type Description ad
object The ad to cancel -
playerClicked()
-
Triggers a "click" on the currently playing ad. This is currently used for testing purposes.
-
cancelOverlay(currentAd)
-
When the Ad Manager Controller needs to cancel the overlay it will call this function.
Parameters:
Name Type Description currentAd
object The overlay ad object that is to be cancelled and removed -
showOverlay()
-
This function gets called by the ad Manager Controller when an ad has completed playing. If the main video is finished playing and there was an overlay displayed before the post-roll then it needs to be removed. If the main video hasn't finished playing and there was an overlay displayed before the ad video played, then it could show the overlay again. In freewheel we do not currently support resuming the overlay after a linear ad.
-
getHandlingClick() → {boolean}
-
Returns whether player is handling click.
Returns:
true if player is handling click. Returns false, if otherwise.- Type
- boolean
-
destroy()
-
Cancel the current ad, reset the state variables, dispose the remote Freewheel class.