目录

Audio

Starting from version 1078, the API prefix has been changed from hbs to qg. The original prefix hbs is still supported.

Definition

API

Description

qg.createInnerAudioContext()

Obtains an audio object for audio playback. During the playback, an audioID is returned, which can be used to operate the corresponding audio object. Each time create is called, a new object is created. Currently, up to five audio playback objects are supported at the same time.

InnerAudioContext.play()

Plays an audio file.

InnerAudioContext.pause()

Pauses the audio playback.

InnerAudioContext.stop()

Stops the audio playback.

InnerAudioContext.seek(number position)

Goes to a specified position.

InnerAudioContext.destroy()

Destroys the current instance.

InnerAudioContext.onTimeUpdate(function callback)

Listens for audio playback progress update events.

InnerAudioContext.offTimeUpdate(function callback)

Stops listening for audio playback progress update events.

InnerAudioContext.onEnded(function callback)

Listens for the event that the audio finishes playing.

InnerAudioContext.offEnded(function callback)

Stops listening for the event that the audio finishes playing.

InnerAudioContext.onPlay(function callback)

Listens for audio playback events.

InnerAudioContext.offPlay(function callback)

Stops listening for audio playback events.

InnerAudioContext.onPause(function callback)

Listens for audio pause events.

InnerAudioContext.offPause(function callback)

Stops listening for audio pause events.

InnerAudioContext.onStop(function callback)

Listens for audio stop events.

InnerAudioContext.offStop(function callback)

Stops listening for audio stop events.

InnerAudioContext.onError(function callback)

Listens for audio playback error events.

InnerAudioContext.offError(function callback)

Stops listening for audio playback error events.

InnerAudioContext.onCanplay(function callback)

Listens for the event that the audio becomes ready to play. This event does not guarantee smooth playback.

InnerAudioContext.offCanplay(function callback)

Stops listening for the event that the audio becomes ready to play.

InnerAudioContext.onWaiting(function callback)

Listens for audio loading events. This event occurs when audio playback is interrupted due to insufficient data and buffering is required.

InnerAudioContext.offWaiting(function callback)

Stops listening for audio loading events.

InnerAudioContext.onSeeking(function callback)

Listens for audio seek events.

InnerAudioContext.offSeeking(function callback)

Stops listening for audio seek events.

InnerAudioContext.onSeeked(function callback)

Listens for audio seek completion events.

InnerAudioContext.offSeeked(function callback)

Stops listening for audio seek completion events.

[h2]qg.createInnerAudioContext()

[h2]InnerAudioContext.play()

[h2]InnerAudioContext.pause()

[h2]InnerAudioContext.stop()

[h2]InnerAudioContext.seek(number position)

[h2]InnerAudioContext.destroy()

[h2]InnerAudioContext.onTimeUpdate(function callback)

[h2]InnerAudioContext.offTimeUpdate(function callback)

[h2]InnerAudioContext.onEnded(function callback)

[h2]InnerAudioContext.offEnded(function callback)

[h2]InnerAudioContext.onPlay(function callback)

[h2]InnerAudioContext.offPlay(function callback)

[h2]InnerAudioContext.onPause(function callback)

[h2]InnerAudioContext.offPause(function callback)

[h2]InnerAudioContext.onStop(function callback)

[h2]InnerAudioContext.offStop(function callback)

[h2]InnerAudioContext.onError(function callback)

[h2]InnerAudioContext.offError(function callback)

[h2]InnerAudioContext.onCanplay(function callback)

[h2]InnerAudioContext.offCanplay(function callback)

[h2]InnerAudioContext.onWaiting(function callback)

[h2]InnerAudioContext.offWaiting(function callback)

[h2]InnerAudioContext.onSeeking(function callback)

[h2]InnerAudioContext.offSeeking(function callback)

[h2]InnerAudioContext.onSeeked(function callback)

[h2]InnerAudioContext.offSeeked(function callback)