Starting from version 1078, the API prefix has been changed from hbs to qg. The original prefix hbs is still supported.
API | Description |
|---|---|
Listens for the start of an audio interruption. This event occurs when the system takes over the audio channel, such as during an alarm, an incoming phone call, or a FaceTime call. When this event is triggered, game audios will be paused. | |
Stops listening for the start of an audio interruption. | |
Listens for the end of an audio interruption. A quick game pauses audio playback when receiving an onAudioInterruptionBegin event and resumes audio playback when receiving an audio interruption end event. | |
Stops listening for the end of an audio interruption. | |
Listens for a global error event. | |
Stops listening for a global error event. |
Listens for the start of an audio interruption. This event occurs when the system takes over the audio channel, such as during an alarm, an incoming phone call, or a FaceTime call. When this event is triggered, game audios will be paused.
Parameter | Type | Mandatory | Description |
|---|---|---|---|
callback | function | Yes | Callback function triggered when an audio interruption starts due to the system taking over the audio channel. |
qg.onAudioInterruptionBegin(
() => {console.log("onAudioInterruptionBegin");}
); Listens for the end of an audio interruption. A quick game pauses audio playback when receiving an onAudioInterruptionBegin event and resumes audio playback when receiving an audio interruption end event.
Parameter | Type | Mandatory | Description |
|---|---|---|---|
callback | function | Yes | Callback function triggered when an audio interruption ends. |
qg.onAudioInterruptionEnd(
() => {console.log("onAudioInterruptionEnd");}
); Parameter | Type | Mandatory | Description |
|---|---|---|---|
callback | function | Yes | Callback function to be removed from the audio-interruption-end event listener. |
qg.offAudioInterruptionEnd(
() => {console.log("offAudioInterruptionEnd");}
); Parameter | Type | Mandatory | Description |
|---|---|---|---|
callback | function | Yes | Callback function triggered when a global error event occurs. For details, please refer to Parameters in callback. |
qg.onError(
(res) => {console.log("onError message = " + res.message);}
);