收藏
回答

小游戏中视频播放出现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)


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

回答关注问题邀请回答
收藏

3 个回答

  • 清泉
    清泉
    2018-05-21

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

    2018-05-21
    有用
    回复
  • 强(2022)
    强(2022)
    2018-05-21

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


    2018-05-21
    有用
    回复
  • 疯狂的小辣椒
    疯狂的小辣椒
    2018-05-21

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

    2018-05-21
    有用
    回复
登录 后发表内容