收藏
回答

小游戏中视频播放出现js错误

问题模块 框架类型 问题类型 操作系统 工具版本
开发者工具 小游戏 Bug macOS 1.02.1805181

this.videoplayer = wx.createVideo({

x: 0,

y: 0,

width: 500,

height: 500,

src: 'http://res.xxx.com/video/ba/87/ba8795747d96fee9d3e39e70d57a92fb.mp4',

autoplay: true

})

按照文档调用视频播放器,在微信开发者工具中,视频播放正常,只是会有JS错误出现:

VM132:1 appServiceSDKScriptError

Cannot read property 'emitter' of undefined;at api onVideoPause callback function

TypeError: Cannot read property 'emitter' of undefined

    at Function.<anonymous> (http://127.0.0.1:53293/game/__dev__/WAGame.js:13:4967)

    at http://127.0.0.1:53293/game/__dev__/WAGame.js:4:10697

    at a (http://127.0.0.1:53293/game/gamePage.html:1:38633)

    at d.registerCallback (http://127.0.0.1:53293/game/gamePage.html:1:38902)

    at m.forEach (http://127.0.0.1:53293/game/gamePage.html:1:36843)

    at Array.forEach (<anonymous>)

    at d (http://127.0.0.1:53293/game/gamePage.html:1:36823)

    at WebSocket.j.onmessage (http://127.0.0.1:53293/game/gamePage.html:1:36716)

console.error @ VM132:1

errorReport @ WAGame.js:3

(anonymous) @ WAGame.js:3

(anonymous) @ WAGame.js:4

a @ gamePage.html:1

d.registerCallback @ gamePage.html:1

m.forEach @ gamePage.html:1

d @ gamePage.html:1

j.onmessage @ gamePage.html:1



VM132:1 appServiceSDKScriptError

Cannot read property 'emitter' of undefined;at api onVideoEnded callback function

TypeError: Cannot read property 'emitter' of undefined

    at Function.<anonymous> (http://127.0.0.1:53293/game/__dev__/WAGame.js:13:4967)

    at http://127.0.0.1:53293/game/__dev__/WAGame.js:4:10697

    at a (http://127.0.0.1:53293/game/gamePage.html:1:38633)

    at d.registerCallback (http://127.0.0.1:53293/game/gamePage.html:1:38902)

    at m.forEach (http://127.0.0.1:53293/game/gamePage.html:1:36843)

    at Array.forEach (<anonymous>)

    at d (http://127.0.0.1:53293/game/gamePage.html:1:36823)

    at WebSocket.j.onmessage (http://127.0.0.1:53293/game/gamePage.html:1:36716)


请问是什么原因引起的这个问题,谢谢

最后一次编辑于  2018-05-21  (未经腾讯允许,不得转载)
邀请回答
复制链接收藏投诉关注问题回答

3 个回答

  • 娇华
    娇华
    2018-05-21

    这里不是已经提示TypeError: Cannot read property 'emitter' of undefined?

    2018-05-21
    赞同
    回复
  • 强泉
    强泉
    2018-05-21

    您好,谢谢回复,小游戏视频播放的API没看到有emitter的定义资料,请问哪里有这方面的资料吗?


    2018-05-21
    赞同
    回复
  • 清泉
    清泉
    2018-05-21

    video标签 controls = false 之后就会出现此错误

    2018-05-21
    赞同
    回复