Closed ir193 closed 6 years ago
不知是不是使用姿势错了
const fs = require('fs') const util = require('util') const readFile = util.promisify(fs.readFile) const FlashEmu = require('./flashemu2') FlashEmu.PLAYERGLOBAL = './playerglobal.abc' FlashEmu.BUILTIN = './builtin.abc' const emu = new FlashEmu({ async readFile (filename) { const buf = await readFile(filename) return new Uint8Array(buf).buffer } }) const vm = emu.getVM() emu.runSWF('./douyu.swf', false).then(() => { let roomId = '24422' let time = Math.round(new Date().getTime() / 60 / 1000) let did = "202CB962AC59075B964B07152D234B70" const CModule = vm.getProxy(emu.getProperty('sample.mp', 'CModule')) const xx = vm.getProxy(emu.getPublicClass('mp')) console.log('getProxy') CModule.callProperty('startAsync') // <= 这里会报错,TypeError: Cannot read property 'call' of undefined console.log('after') let StreamSignDataPtr = CModule.callProperty('malloc', 4) let outptr1 = CModule.callProperty('malloc', 4) let datalen = xx.callProperty('sub_2', parseInt(roomId), parseInt(time), did.toString(), outptr1, StreamSignDataPtr) /* omit */
能把你的这些文件发我一份吗? 包括abc和swf
我使用的就是DouyuHTML5Player里的abc和swf文件,node v10.4.1 dist.zip
旧的abc应该不能在新版用, 试着用2.0编译abc
顺便一提 npm 里安装的话应该是自带 abc 的
明白了,是我理解错了。 我以为abc是要自己提供的。使用 npm 里安装的没有问题
不知是不是使用姿势错了