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


* Starts to play a video ad previously prepared
function showMidroll() {


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.

If an ad was shown and watched by a player the following result will be passed:

data: "showMidroll$ok$complete"

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:


st.appYesApplication id
st.sigYesmd5(“call_id=1” + sessionSecretKey)
st.session_keyYesUser’s session key
st.call_idYesMandatory value = 1