appnext.getMute()

Type Function
Return value Boolean
Revision Release 2024.3703
Keywords ads, advertising, Appnext, getMute
See also appnext.setMute()
appnext.*

Overview

Gets whether the video which is played in the ad is muted.

Syntax

appnext.getMute( adKey )
adKey (required)

String. The ad key returned for a previously created ad.

Example

local appnext = require( "plugin.appnext" )

local function adListener( event )
    print( "Received " .. event.event .. " for " .. event.adKey .. " with message: " .. event.message )
end

-- Initialize the Appnext plugin
appnext.init( adListener )

-- Create your ads
local fullscreenPlacementID

local platform = system.getInfo( "platformName" )
if ( platform == "iPhone OS" ) then
    fullscreenPlacementID = "YOUR_IOS_FULLSCREEN_PLACEMENT_ID"
elseif ( platform == "Android" ) then
    fullscreenPlacementID = "YOUR_ANDROID_FULLSCREEN_PLACEMENT_ID"
end

local fullscreenAdKey = appnext.createAd( "fullscreen", fullscreenPlacementID )

appnext.setMute( fullscreenAdKey, true )

if ( appnext.getMute( fullscreenAdKey ) ) then
    print( "Video is muted" )
else
    print( "Video is not muted" )
end