uni-app Can not find livePusher

uni-app Can not find livePusher

操作步骤:

  • live-pusher示例操作

预期结果:

  • 功能正常使用

实际结果:

  • Can not find livePusher

bug描述:

  • nvue中使用的livePusher报错Can not find livePusher
  • manifest.json 已经设置了LivePusher选项
  • vue中功能正常

图片

Image 1 Image 2

项目信息

项目信息 详情
产品分类 uniapp/App
PC开发环境 Windows
PC开发环境版本 Windows11 最新
HBuilderX类型 正式
HBuilderX版本 4.15
手机系统 Android
手机系统版本 Android 13
手机厂商 小米
手机机型 MI10
页面类型 nvue
Vue版本 vue2
打包方式 云端
项目创建方式 HBuilderX

更多关于uni-app Can not find livePusher的实战教程也可以访问 https://www.itying.com/category-93-b0.html

1 回复

更多关于uni-app Can not find livePusher的实战教程也可以访问 https://www.itying.com/category-93-b0.html


The live-pusher component is a feature provided by the WeChat Mini Program platform, and it is used for live streaming. However, in uni-app, if you are trying to use the live-pusher component and encountering the error “Can not find livePusher,” it could be due to several reasons:

1. Platform Compatibility

  • uni-app: The live-pusher component is specific to the WeChat Mini Program platform. If you are developing a cross-platform app using uni-app, this component may not be available on all platforms.
  • Mini Program: Ensure you are testing on the WeChat Mini Program platform, as live-pusher is not available in other platforms like H5, App, or Alipay Mini Program.

2. Component Registration

  • Make sure you have correctly registered the live-pusher component in your page or component. For example:

    <live-pusher id="livePusher" url="your_rtmp_url" mode="SD" autopush></live-pusher>
    

3. Permissions

  • Ensure that your WeChat Mini Program has the necessary permissions to use the live-pusher component. You may need to configure this in the Mini Program’s backend settings.

4. uni-app Version

  • Ensure that you are using a version of uni-app that supports the live-pusher component. If you are using an older version, consider updating to the latest version.

5. Debugging

  • Check the console for any additional error messages that might give more context about why the live-pusher component is not being found.
  • Make sure that the live-pusher component is correctly referenced in your project.

6. Custom Components

  • If you are using a custom component that wraps live-pusher, ensure that the component is correctly imported and used.

Example Usage in WeChat Mini Program:

<live-pusher
  id="livePusher"
  url="your_rtmp_url"
  mode="SD"
  autopush
  @statechange="onStateChange"
  @netstatus="onNetStatus">
</live-pusher>
Page({
  onStateChange(e) {
    console.log('state change:', e.detail);
  },
  onNetStatus(e) {
    console.log('net status:', e.detail);
  }
});
回到顶部