MicrosoftNSJS.Advertising.AdScheduler object
Retrieves video and audio ads from the Microsoft ad server or an alternative ad server and schedules them into the timeline for existing video content.
Syntax
var adScheduler = new MicrosoftNSJS.Advertising.AdScheduler(myMediaPlayer);
Members
The AdScheduler object has these types of members:
Constructors
The AdScheduler object has these constructors.
| Constructor | Description |
|---|---|
| AdScheduler |
Initializes a new instance of the AdScheduler class. |
Events
The AdScheduler object has these events.
| Event | Description |
|---|---|
| onAdProgress |
Raised when ad playback reaches quartile checkpoints. |
| onAllComplete |
Raised when the main content reaches the end and any scheduled post-roll ads are also ended. |
| onErrorOccurred |
Raised when the AdScheduler encounters an error. |
| onPodCountdown |
Raised when an ad is playing and indicates how much time remains in the current pod. |
| onPodEnd |
Raised when an ad pod ends. |
| onPodStart |
Raised when an ad pod starts. |
Methods
The AdScheduler object has these methods.
| Method | Description |
|---|---|
| dispose |
Releases resources and unregisters listeners used by the AdScheduler. |
| requestSchedule |
Requests an ad schedule from the Microsoft ad server and inserts it into the timeline of the MediaPlayer that was passed to the AdScheduler constructor. |
| requestScheduleByUri |
Requests an ad schedule from the server specified in the URI and insert it into the timeline of the MediaPlayer that was passed to the AdScheduler constructor. |
Properties
The AdScheduler object has these properties.
| Property | Access type | Description |
|---|---|---|
|
Read/write |
Gets or sets the number of milliseconds that the media must be playable. | |
|
Read/write |
Gets or sets a value that indicates whether scheduled media will play if user skips ahead to a point past a scheduled start time. | |
|
Read/write |
Gets or sets the number of milliseconds to wait for an ad request response before timing out. | |
|
Read-only |
Gets the schedule data that was retrieved from the ad server. |
Remarks
This object is provided by the Microsoft.StoreServices.VideoAdScheduler NuGet package. For more information about using this object, see Add advertisements to video content in HTML 5 and JavaScript.
Requirements
|
Client |
Windows 10 |
|---|---|
|
Namespace |
MicrosoftNSJS.Advertising |
|
Library |
|
See also