Type Function Return value Boolean Revision Release 2024.3703 Keywords ads, advertising, Vungle See also vungle.init() vungle.load() vungle.*
vungle.show()
begins playing a placement
This API returns a boolean true
or false
depending on the availability of a cached video ad.
vungle.show( params )
Table. A table that specifies properties for the ad request — see the next section for details.
The params
table includes properties for the ad request.
String. The placement ID of the ad to show.
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, it looks into the orientations
key.
Number. For iOS only, the bitmask 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
String. You can customize a message to display to users when they attempt to close the incentivized video before completion. Note that this setting only applies to standard Vungle ads. For “Dynamic Template” ads, the same customization is available on the Vungle Dashboard.
String. For Android only, enables or disables immersive mode on KitKat+ devices.
String. For iOS only, draws larger buttons that control ad functions such as mute or close.
local vungle = require( "plugin.vungle" ) local appID, placementID1, placementID2 if ( system.getInfo("platform") == "android" ) then appID = "YOUR_ANDROID_APP_ID" placementID1 = "YOUR_ANDROID_PLACEMENT_ID_1" placementID2 = "YOUR_ANDROID_PLACEMENT_ID_2" else appID = "YOUR_IOS_APP_ID" placementID1 = "YOUR_IOS_PLACEMENT_ID_1" placementID2 = "YOUR_IOS_PLACEMENT_ID_2" end -- Vungle listener function local function adListener( event ) if ( event.type == "adInitialize" ) then -- Successful initialization print( event.provider ) end end -- Initialize the Vungle plugin local initParams = appID .. "," .. placementID1 .. "," .. placementID2 vungle.init( "vungle", initParams, adListener ) local adShown = vungle.show( { placementId=placementID1, isSoundEnabled=true } )