Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

taro 3.0.13 h5 createVideoContext报错 #7753

Closed
xujiandream opened this issue Sep 27, 2020 · 4 comments
Closed

taro 3.0.13 h5 createVideoContext报错 #7753

xujiandream opened this issue Sep 27, 2020 · 4 comments
Labels
F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x

Comments

@xujiandream
Copy link

相关平台

H5

浏览器版本: 85.0.4183.121
使用框架: React

复现步骤

调用createVideoContext api报错

期望结果

正确调用

实际结果

报错

环境信息

  Taro CLI 3.0.13 environment info:
    System:
      OS: macOS 10.14.5
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 12.13.0 - ~/.nvm/versions/node/v12.13.0/bin/node
      Yarn: 1.22.5 - ~/.yarn/bin/yarn
      npm: 6.12.0 - ~/.nvm/versions/node/v12.13.0/bin/npm
    npmPackages:
      babel-preset-taro: 3.0.13 => 3.0.13 
      eslint-config-taro: 3.0.13 => 3.0.13 
@taro-bot2 taro-bot2 bot added F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x labels Sep 27, 2020
@xujiandream xujiandream changed the title createVideoContext报错 taro 3.0.13 createVideoContext报错 Sep 27, 2020
@xujiandream xujiandream changed the title taro 3.0.13 createVideoContext报错 taro 3.0.13 h5 createVideoContext报错 Sep 27, 2020
@luckyadam
Copy link
Member

请给一下示例代码

@soulcm
Copy link

soulcm commented Oct 14, 2020

同报错,调试发现需要传入component实例,可是用的纯函数组件啊
换成class component后,传入this也报错
image

@zhaoguoweiLLHC
Copy link
Contributor

此问题已在3.0.15 中修复。但是先不建议升级,此版本视频又有了新的问题 在PR里 #8094 。未来版本会很快修复。
在问题修复之前可以先使用临时方案:

function getVideoObj(){
  if(process.env.TARO_ENV === 'h5'){
    return document.querySelector("#videoId")
  }else {
    return Taro.createVideoContext("videoId")
  }
}

@helsonxiao
Copy link
Contributor

这个我已经修复了,还没发布的样子

@ZakaryCode ZakaryCode moved this to Done in H5 Apr 10, 2023
@ZakaryCode ZakaryCode added this to H5 Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x
Projects
Archived in project
Development

No branches or pull requests

6 participants