tvfe / txv-miniprogram-plugin

这是腾讯视频小程序播放插件。 打广告:腾讯视频小程序开发框架=>
https://github.com/tvfe/wxpage
461 stars 76 forks source link

找不到playerid为txv1的txv-video组件 #8

Closed xiaopengcn closed 2 years ago

xiaopengcn commented 6 years ago

一直报如下错误,改为用demo后也是,求答疑。 小程序:瓜果说 qq/微信:312140976

VM5975:1 thirdScriptError 找不到playerid为txv1的txv-video组件;at pages/qqVideo/qqVideo page lifeCycleMethod onLoad function Error: 找不到playerid为txv1的txv-video组件 at Object.getTxvContext (http://127.0.0.1:28293/appservice/__onlineplugin__/wxa75efa648b60994b/1.0.3/appservice.js:979:80) at e.onLoad (http://127.0.0.1:28293/appservice/pages/qqVideo/qqVideo.js:11:32) at e. (http://127.0.0.1:28293/appservice/__dev__/WAService.js:18:16345) at D (http://127.0.0.1:28293/appservice/__dev__/WAService.js:18:1254) at F (http://127.0.0.1:28293/appservice/__dev__/WAService.js:18:2027) at K (http://127.0.0.1:28293/appservice/__dev__/WAService.js:18:3339) at Function. (http://127.0.0.1:28293/appservice/__dev__/WAService.js:18:6274) at http://127.0.0.1:28293/appservice/__dev__/WAService.js:18:12486 at http://127.0.0.1:28293/appservice/__dev__/WAService.js:5:22695 at Array.forEach ()

zhuanghongji commented 6 years ago

使用了 1.0.5 版本也出现同样的问题。

代码逻辑描述如下:

使用vid="{{vid}}"的方式应用data变量,
如果一开始vid 为空串的话就会报错,
然后就无法获取到 txv-video 组件了

报错日志如下:

VM15267:1 thirdScriptError
需要为txv-video组件传入一个vid,否则怎么播放视频呢; [Component] Lifetime Method Error @ plugin-private://wxa75efa648b60994b/component/video/video#attached
Error: 需要为txv-video组件传入一个vid,否则怎么播放视频呢
    at r.attached (http://127.0.0.1:11242/appservice/__onlineplugin__/wxa75efa648b60994b/1.0.5/appservice.js:1084:961)
    at r.safeCallback (http://127.0.0.1:11242/appservice/__dev__/WAService.js:14:10521)
    at r.call (http://127.0.0.1:11242/appservice/__dev__/WAService.js:14:10285)
    at t (http://127.0.0.1:11242/appservice/__dev__/WAService.js:14:23150)
    at t (http://127.0.0.1:11242/appservice/__dev__/WAService.js:14:23463)
    at t (http://127.0.0.1:11242/appservice/__dev__/WAService.js:14:23405)
    at c (http://127.0.0.1:11242/appservice/__dev__/WAService.js:14:23473)
    at Function.u.pretendAttached (http://127.0.0.1:11242/appservice/__dev__/WAService.js:15:1227)
    at Object.t.attachView (http://127.0.0.1:11242/appservice/__dev__/WAService.js:16:20286)
    at D (http://127.0.0.1:11242/appservice/__dev__/WAService.js:18:1088)
thirdScriptError
找不到playerid为txv1的txv-video组件;at "pages/detail/detail" page lifeCycleMethod onLoad function
Error: 找不到playerid为txv1的txv-video组件
    at Object.getTxvContext (http://127.0.0.1:11242/appservice/__onlineplugin__/wxa75efa648b60994b/1.0.5/appservice.js:988:80)
    at r.onLoad (http://127.0.0.1:11242/appservice/pages/detail/detail.js:35:33)
    at r.<anonymous> (http://127.0.0.1:11242/appservice/__dev__/WAService.js:18:24831)
    at D (http://127.0.0.1:11242/appservice/__dev__/WAService.js:18:1254)
    at F (http://127.0.0.1:11242/appservice/__dev__/WAService.js:18:2027)
    at K (http://127.0.0.1:11242/appservice/__dev__/WAService.js:18:3339)
    at Function.<anonymous> (http://127.0.0.1:11242/appservice/__dev__/WAService.js:18:6274)
    at http://127.0.0.1:11242/appservice/__dev__/WAService.js:18:12486
    at http://127.0.0.1:11242/appservice/__dev__/WAService.js:5:22695
    at Array.forEach (<anonymous>)

但是如果我一开始指定的 {{vid}} 有个固定有效值而不是空串的话,就不会出现上述报错。
但 vid 是从上个页面传过来的,不是固定的。

所以,有木有解决该问题的办法?

dufemeng commented 6 years ago

使用了 1.0.5 版本也出现同样的问题。

代码逻辑描述如下:

使用vid="{{vid}}"的方式应用data变量,
如果一开始vid 为空串的话就会报错,
然后就无法获取到 txv-video 组件了

报错日志如下:

VM15267:1 thirdScriptError
需要为txv-video组件传入一个vid,否则怎么播放视频呢; [Component] Lifetime Method Error @ plugin-private://wxa75efa648b60994b/component/video/video#attached
Error: 需要为txv-video组件传入一个vid,否则怎么播放视频呢
    at r.attached (http://127.0.0.1:11242/appservice/__onlineplugin__/wxa75efa648b60994b/1.0.5/appservice.js:1084:961)
    at r.safeCallback (http://127.0.0.1:11242/appservice/__dev__/WAService.js:14:10521)
    at r.call (http://127.0.0.1:11242/appservice/__dev__/WAService.js:14:10285)
    at t (http://127.0.0.1:11242/appservice/__dev__/WAService.js:14:23150)
    at t (http://127.0.0.1:11242/appservice/__dev__/WAService.js:14:23463)
    at t (http://127.0.0.1:11242/appservice/__dev__/WAService.js:14:23405)
    at c (http://127.0.0.1:11242/appservice/__dev__/WAService.js:14:23473)
    at Function.u.pretendAttached (http://127.0.0.1:11242/appservice/__dev__/WAService.js:15:1227)
    at Object.t.attachView (http://127.0.0.1:11242/appservice/__dev__/WAService.js:16:20286)
    at D (http://127.0.0.1:11242/appservice/__dev__/WAService.js:18:1088)
thirdScriptError
找不到playerid为txv1的txv-video组件;at "pages/detail/detail" page lifeCycleMethod onLoad function
Error: 找不到playerid为txv1的txv-video组件
    at Object.getTxvContext (http://127.0.0.1:11242/appservice/__onlineplugin__/wxa75efa648b60994b/1.0.5/appservice.js:988:80)
    at r.onLoad (http://127.0.0.1:11242/appservice/pages/detail/detail.js:35:33)
    at r.<anonymous> (http://127.0.0.1:11242/appservice/__dev__/WAService.js:18:24831)
    at D (http://127.0.0.1:11242/appservice/__dev__/WAService.js:18:1254)
    at F (http://127.0.0.1:11242/appservice/__dev__/WAService.js:18:2027)
    at K (http://127.0.0.1:11242/appservice/__dev__/WAService.js:18:3339)
    at Function.<anonymous> (http://127.0.0.1:11242/appservice/__dev__/WAService.js:18:6274)
    at http://127.0.0.1:11242/appservice/__dev__/WAService.js:18:12486
    at http://127.0.0.1:11242/appservice/__dev__/WAService.js:5:22695
    at Array.forEach (<anonymous>)

但是如果我一开始指定的 {{vid}} 有个固定有效值而不是空串的话,就不会出现上述报错。 但 vid 是从上个页面传过来的,不是固定的。

所以,有木有解决该问题的办法?

请问这个问题你找到解决办法了吗