This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default class AudioGroup { | |
_imgUrl = null; | |
_mp3Url = null; | |
_autoPlay = false; | |
/**@type {Function} */ | |
_onPlayCompleteCallback = null; | |
/**@type {boolean} */ | |
_isUseDomAudio; | |
spriteFrame; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class WxgamePlatform { | |
name = 'Cat'; | |
_bgmAudio = null; | |
login() { | |
return new Promise((resolve, reject) => { | |
wx.login({ | |
success:res=> { | |
resolve(res) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import WeixinAudio from "../weixin/WeixinAudio"; | |
import WeixinUtils from "../weixin/WeixinUtils"; | |
export default class DomAudioGroup { | |
_audioUrl = null; | |
_endCallback = null; | |
_domAudio = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 返回 image base64 | |
getImgBase64() { | |
let sp = cc.find('Canvas/New Sprite(Splash)').getComponent(cc.Sprite); | |
let target = cc.find('Canvas'); | |
let width = 960, | |
height = 640; | |
let renderTexture = new cc.RenderTexture(width, height); | |
renderTexture.begin(); | |
target._sgNode.visit(); | |
renderTexture.end(); |