@@ -58,7 +58,15 @@ Rewarded breaks allow for a user to choose to watch a rewarded video ad in excha
58
58
59
59
``` lua
60
60
-- gameplay stops
61
- poki_sdk .rewarded_break (function (self , success )end )
61
+ poki_sdk .rewarded_break (function (self , status )
62
+ if status == poki_sdk .REWARDED_BREAK_ERROR then
63
+ print (" Rewarded break error!" )
64
+ elseif status == poki_sdk .REWARDED_BREAK_START then
65
+ print (" Rewarded break start" )
66
+ elseif status == poki_sdk .REWARDED_BREAK_SUCCESS then
67
+ print (" Rewarded break success" )
68
+ end
69
+ end )
62
70
```
63
71
64
72
### About the rewarded break timer
@@ -74,9 +82,14 @@ Make sure that audio and keyboard input are disabled during commercialBreaks, so
74
82
75
83
``` lua
76
84
-- gameplay stops
77
- -- fire your mute audio function
85
+ -- fire your mute audio function, for example:
86
+ sound .pause (" #music" , true )
78
87
poki_sdk .commercial_break (function (self )
79
- -- fire your unmute audio function
88
+ -- fire your unmute audio function, for example:
89
+ if status == poki_sdk .REWARDED_BREAK_ERROR or
90
+ status == poki_sdk .REWARDED_BREAK_SUCCESS then
91
+ sound .pause (" #music" , false )
92
+ end
80
93
-- fire your function to continue to game
81
94
end )
82
95
```
0 commit comments