FAPI.invokeUIMethod("showMidroll")

Method signature

For FLASH games attribute’s wmode value must be set to opaque to display video ads properly

FAPI.invokeUIMethod("showMidroll");

Example usage

/*
* Starts to play a video ad previously prepared
*/
function showMidroll() {
    FAPI.invokeUIMethod("showMidroll");
}

Callback example

Following arguments can be passed to API_callback function as a result:

Callback if video was successfully shown

method: “showMidroll”

result: “ok”

data: “complete”

Callback if video was not found

method: “showMidroll”

result: “error”

data: “not_prepared”

Callback if video ads are not available for current user

method: “showMidroll”

result: “error”

data: “mp4_not_supported”

How it works

Requires a video prepared by method FAPI.invokeUIMethod(“prepareMidroll”) before method’s invoking.
Function should be called only when a video ad was found. 10-15 seconds await between methods’ invocations is a must.

How it looks

Web

Mobile