c***@mediinfo.com.cn
c***@mediinfo.com.cn
  • 发布:2024-09-04 15:05
  • 更新:2024-09-04 15:05
  • 阅读:218

项目中使用小程序组件live-pusher、live-player,使用的条件编译,运行npm run build 时报错

分类:uni-app

主页面是.vue文件

  <!--#ifdef MP-WEIXIN-->  
    <floatBox  
      class="floatBox"  
      ref="floatBox"  
      :direction="'all'"  
      :domWidth="domWidth"  
      :height="domHeight"  
      :xMove="screenWidth"  
      :yMove="screenHeight"  
      :disabledValue="isQuanPin"  
    >  
      <view  
        :style="{ width: domWidth, height: domHeight + 'px' }"  
        @click="changeHuaMian"  
      >  
        <shiPinTHMini  
          :wenZhenDH="wenZhenDH"  
          :wenZhenZT="wenZhenZT"  
          ref="shiPinTH"  
          @closeWH="closeWH"  
          @changeWH="changeWH"  
          @isshiPinShow="isshiPinShow"  
          @isliaoTianShiShow="isliaoTianShiShow"  
          @fenXiangTH="fenXiangTH"  
          @updateXQ="updateXQ"  
        ></shiPinTHMini>  
      </view>  
    </floatBox>  
    <!--#endif-->

子组件shiPinTHMini 中使用了live-pusher 和live-player 标签

<template>  
    <view id="shiPinTHBig" :class="isChange ? 'merc-tuWenWZ-shiPinTH-smallStyle' : 'merc-tuWenWZ-shiPinTH-bigStyle'"  
      @click="isQuanPin && isChange ? isChange = false : ''">  
      <live-pusher id="pusherContent" max-bitrate="500" :url="publishUrl" :enable-camera="enableCamera" :enable-mic="enableMic"  :style="{height:'100%', position: 'absolute', width: '100%' }"  
      autopush="true" />  
      <view class="merc-tuWenWZ-shiPinTH-showHeiPing" v-show="isShowHeiPing"></view>  
    </view>  
    <view id="shiPinTHSmall" :class="isChange ? 'merc-tuWenWZ-shiPinTH-bigStyle' : 'merc-tuWenWZ-shiPinTH-smallStyle'"  
    @click="isChange ? '' : isChange = true">  
    <live-player  id="playerContent" :src="playerUrl" mode="RTC"   
      class="player"   
      @statechange="playerStateChange"  
      orientation="vertical"  
      object-fit="fillCrop"   
      :style="{height:'100%',position: 'absolute', width: '100%', top: player.top, left: player.left}"  
      autoplay="true"/>  
      <view v-if="!video_muted" class="yiShenTX">  
        <view class="merc-tuWenWZ-shiPinTH-yiShenXX-yiShenTX_img">  
          <md-image :src="require(`@/static/image/yisheng_touxiang.png`)" width="32px" height="40px"  
        ></md-image>  
        </view>  
      </view>  
    </view>  
</template>

运行 npm run build:h5 时报错,信息如下

These dependencies were not found:

  • uni-view/components/live-player in ./node_modules/@dcloudio/vue-cli-plugin-uni-optimize/.tmp/components.js
  • uni-view/components/live-pusher in ./node_modules/@dcloudio/vue-cli-plugin-uni-optimize/.tmp/components.js

2024-09-04 15:05 负责人:无 分享
已邀请:

要回复问题请先登录注册