提交 8a3f9fef 编写于 作者: D DCloud_LXH

chore(App): getBackgroundAudioManager

上级 f8ff71d8
import { extend } from '@vue/shared'
import { extend, capitalize } from '@vue/shared'
import {
defineSyncApi,
API_GET_BACKGROUND_AUDIO_MANAGER,
......@@ -301,12 +301,10 @@ function onBackgroundAudioStateChange({
const onInitBackgroundAudioManager = /*#__PURE__*/ once(() => {
eventNames.forEach((item) => {
const name = item[0].toUpperCase() + item.substr(1)
BackgroundAudioManager.prototype[`on${name}` as onEventNames] = function (
callback: Function
) {
callbacks[item].push(callback)
}
BackgroundAudioManager.prototype[`on${capitalize(item)}` as onEventNames] =
function (callback: Function) {
callbacks[item].push(callback)
}
})
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册