FAPI.invokeUIMethod("showMidroll")

Example

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

Result

As a result video ad is shown to user. If an error has been occurred during this process, an error reason is passed in data parameter.

data: "showMidroll$error$not_prepared"

Possible errors:

  • not_prepared - not video was found to display;
  • mp4_not_supported - video can not be played in user’s browser.

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.

Video ads for mobile apps

To display a video ad in mobile HTML game special widget should be used.

To do so you should open browser window (or iframe) with a specially crafted URL:

https://connect.ok.ru/dk?st.cmd=WidgetVideoAdv&st.app={application_id}&st.sig={signature}&st.call_id=1&st.session_key={session_key}

ParameterRequiredDescription
st.appYesApplication id
st.signatureYesRequest signature
st.session_keyYesUser’s session key