@@ -55,7 +55,15 @@ Rewarded breaks allow for a user to choose to watch a rewarded video ad in excha
5555
5656``` lua
5757-- gameplay stops
58- poki_sdk .rewarded_break (function (self , success )end )
58+ poki_sdk .rewarded_break (function (self , status )
59+ if status == poki_sdk .REWARDED_BREAK_ERROR then
60+ print (" Rewarded break error!" )
61+ elseif status == poki_sdk .REWARDED_BREAK_START then
62+ print (" Rewarded break start" )
63+ elseif status == poki_sdk .REWARDED_BREAK_SUCCESS then
64+ print (" Rewarded break success" )
65+ end
66+ end )
5967```
6068
6169### About the rewarded break timer
@@ -71,9 +79,14 @@ Make sure that audio and keyboard input are disabled during commercialBreaks, so
7179
7280``` lua
7381-- gameplay stops
74- -- fire your mute audio function
82+ -- fire your mute audio function, for example:
83+ sound .pause (" #music" , true )
7584poki_sdk .commercial_break (function (self )
76- -- fire your unmute audio function
85+ -- fire your unmute audio function, for example:
86+ if status == poki_sdk .REWARDED_BREAK_ERROR or
87+ status == poki_sdk .REWARDED_BREAK_SUCCESS then
88+ sound .pause (" #music" , false )
89+ end
7790 -- fire your function to continue to game
7891end )
7992```
0 commit comments