admob.setVideoAdVolume()

类型 函数
返回值
修订版 发行版 2024.3703
关键字 广告、营销、AdMob、setVideoAdVolume
另请参阅 admob.show()
admob.*

概述

设置视频广告所需的音量。有效值范围为 0.0 - 1.00.0 表示完全静音广告。默认值为 1.0

重要

当报告应用音量为静音或设为 0 时,禁止播放静音音频的视频广告不会返回广告请求。这可能会限制更广泛的视频广告池中可投放的部分广告。

语法

admob.setVideoAdVolume( videoAdVolume )
videoAdVolume (必需)

数字。视频广告所需的音量。有效值范围为 0.0 - 1.00.0 表示完全静音广告。

示例

local admob = require( "plugin.admob" )

-- AdMob listener function
local function adListener( event )

    if ( event.phase == "init" ) then  -- Successful initialization
        print( event.provider )
    end
end

-- Initialize the AdMob plugin
admob.init( adListener, { appId="YOUR_ADMOB_APP_ID" } )

-- Sometime later, mute video ads
admob.setVideoAdVolume( 0.0 )