Type function Return value Boolean Revision 2017.3060 Keywords ads, advertising, vungle See also ads.init() vungle.*
ads.show()
begins playing a full-screen video ad if one is cached and available for display.
For Vungle, this API returns a boolean true
or false
depending on the availability of a cached video ad.
ads.show( adUnitType [, params] )
String. Vungle supports the following types:
"interstitial"
— default video ad unit"incentivized"
— video ad unit with optional server-to-server callback for in-app rewardsTable. A table that specifies properties for the ad request — see the next section for details.
The params
table can include properties for the ad request.
Boolean. This parameter only applies to iOS. If true
(default), the video ad will transition in with a slide effect. If false
, it will appear instantaneously.
Boolean. If true
(default), the video ad will rotate automatically with the device's orientation. If false
, it will use the ad's preferred orientation. This is required for Android only. For iOS, look into the orientations
key.
[Boolean][api.type.Integer]. Bitmaks with the possible orientation values. Default is UIInterfaceOrientationMaskAll
.
Boolean. If true
(default), sound will be enabled during video ad playback, subject to the device's sound settings. If false
, video playback will begin muted. Note that the user can mute or
String. This parameter only applies to the "incentivized"
ad unit type. When specified, it represents the user identifier that you wish to receive in a
local ads = require( "ads" ) local function adListener( event ) if ( event.type == "adStart" and event.isError ) then --Cached video ad not available for display end end ads.init( "vungle", "myAppId", adListener ) local adShown = ads.show( "interstitial", { isAnimated=false, isBackButtonEnabled=true } )