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

LivePusher的属性enableCamera不起作用 #7427

Closed
cuiyajie opened this issue Aug 24, 2020 · 2 comments
Closed

LivePusher的属性enableCamera不起作用 #7427

cuiyajie opened this issue Aug 24, 2020 · 2 comments
Assignees
Labels
T-weapp Target - 编译到微信小程序 V-3 Version - 3.x walk-around 绕过问题

Comments

@cuiyajie
Copy link

相关平台

微信小程序

复现仓库

https://github.com/cuiyajie/LivePusherEnableCamera
小程序基础库: 2.12.2
使用框架: Nerv

复现步骤

在微信小程序开发工具下运行github项目

期望结果

enableCamera设置为false,期望只能够推流音频,看不到摄像头预览

实际结果

摄像头打开,能够看到摄像头预览

环境信息

👽 Taro v3.0.8


  Taro CLI 3.0.8 environment info:
    System:
      OS: macOS 10.15.6
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 10.14.2 - /usr/local/bin/node
      Yarn: 1.19.1 - /usr/local/bin/yarn
      npm: 6.14.7 - /usr/local/bin/npm
    npmPackages:
      @tarojs/components: 3.0.8 => 3.0.8 
      @tarojs/mini-runner: 3.0.8 => 3.0.8 
      @tarojs/runtime: 3.0.8 => 3.0.8 
      @tarojs/taro: 3.0.8 => 3.0.8 
      @tarojs/webpack-runner: 3.0.8 => 3.0.8 
      babel-preset-taro: 3.0.8 => 3.0.8 
      eslint-config-taro: 3.0.8 => 3.0.8 
      nervjs: ^1.5.0 => 1.5.7 
    npmGlobalPackages:
      typescript: 2.9.2


补充信息

在最终运行的wxml文件中,没有看到enable-camera被渲染出来,但是在base.wxml中看到了enable-camera有被设置。因此怀疑是taro运行时没有把enableCamera渲染出来

@taro-bot2 taro-bot2 bot added F-nerv T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Aug 24, 2020
@cuiyajie
Copy link
Author

翻看之前的Issue,发现可能是Nerv/taro下bool类型属性不起作用,类似Issue #5988#5990 显示bug已解决,但还是能够在最新版本3.0.8中复现。

@luckyadam
Copy link
Member

https://github.com/NervJS/nerv/blob/master/packages/nerv/src/vdom/patch.ts#L621
Nerv 对 DOM 属性的处理默认是把值为 false 的属性给忽略了,所以 enableCamera 为 false 会设置不上,暂时可以用如下写法来绕过,后续需要等待 Nerv 发版处理。

<LivePusher style={{width: '100vw', height: '100vh'}} enableCamera='false'></LivePusher>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-weapp Target - 编译到微信小程序 V-3 Version - 3.x walk-around 绕过问题
Projects
None yet
Development

No branches or pull requests

3 participants