切换 uniapp_uniapp市场美狐直播美颜sdk-uniapp官方合作发布插件说明-美狐原生sdk将不再难接入...

 @TOC

美狐直播美颜sdk-uniapp官方合作发布插件说明-一颗优雅草科技

插件市场:

关于山东小狐狸网络科技有限公司的介绍:

山东小狐狸网络科技有限公司 资本:1100万 规模:10~100人 地址:中国(山东)自由贸易试验区济南片区经十路5777号万科金域国际天泰家园1号楼办公楼2204 美狐主营:美狐美颜SDK。基于人脸识别技术和图像渲染技术,以打造专业级美颜SDK为目标,包含实时美颜、人脸美型、抖动特效、动态贴纸等特效功能,为多种音视频业务场景如直播、短视频、一对一等提供的相应的美化解决方案。

b1413d22d8c0ea280293439d97b524c6.png

638a5c0a91f31049427eab36252450fc.png

de423548bf00c8459e4f8070bee8c6a3.png

使用说明

这里面是需要填写sdk获得的授权信息。 另外本版本是腾讯云直播推流,所以需要腾讯云推流的license ,也就是第三个选项。 填写好这些信息便可运行测试。

ac9999929ebc5cf51815fd812973989e.png

demo示例

index.vue文件

<template>
    <view>
        <view class="uni-padding-wrap uni-common-mt">   


                <button type="primary" @tap="start()">start </button>



        </view>
    </view>
</template>

<script>
    export default {
        data() {
            return {
                title: 'Hello'
            }
        },
        onLoad() {

        },
        methods: {


            start()
            {
                  uni.navigateTo({
                    url: 'video',
                    success: res => {},
                    fail: () => {},
                    complete: () => {}
                  });
            } 
        }
    }
</script>

video.nvue文件

<template>
    <div class="container"> 
        <div     :style="{ width: hqwidth, height: hqhight }" class="devices">

                <MHTXLive id="mainMap"  :style="{ width: hqwidth, height: hqhight }"    ref="myMHLive"      ></MHTXLive >


        </div>


        <view class="fanhan">



            <button     @click="StartPreview()"> 开始预览</button>  
            <button     @click="StopPreview()"> 停止预览</button>   


            <button     @click="StartPush()"> 开始推流</button>
            <button     @click="StopPush()"> 停止推流</button>   

            <button     @click="Tiezhi()"> 贴纸</button>  
            <button     @click="Meiyan()"> 美颜</button>  

            <button     @click="Texiao()"> 特效</button>  
            <button     @click="Hahajing()"> 哈哈镜</button>   


            <button     @click="OpenFalsh()"> 闪光灯开</button> 
            <button     @click="CloseFlash()"> 闪光灯关</button>    

            <button     @click="SwitchCamera()"> 切换摄像头</button> 
            <button     @click="back()"> back</button> 




        </view>



    </div>


</template>

<script> 
    var globalEvent = weex.requireModule('globalEvent');
    export default {
        data() { 
            return {
                title: 'Hello',
                hqwidth:0,
                hqhight:0,
                 editorText:"sdsd"
            }    
        },
        onBackPress(e) {
           if (e.from == 'backbutton') { 



               /
                  /
                     /
                        /
                           /

                        // 退出页面的是 调用一下 backbutton

             this.$refs.myMHLive.backbutton();  
            return false;  
           }
          }, 
        created() {
            let that = this; 

        },
        onLoad: function(option) {
            var that=this;
            plus.navigator.setFullscreen(true);
            uni.getSystemInfo({
                success: function(e) {
                    console.log(e)
                    that.hqwidth = e.windowWidth
                    that.hqhight = e.windowHeight
                }
            })
        },
        methods: {


            back(){
                 this.$refs.myMHLive.backbutton();  
                uni.navigateBack();
            },
            StartPreview(){ 
                var Live = this.$refs.myMHLive;
                Live.StartPreview(); 
            },
            StopPreview(){  
                var Live = this.$refs.myMHLive;
                Live.StopPreview(); 
            },
            Texiao(){ 
                var Live = this.$refs.myMHLive;
                Live.Texiao(result => {
                                const msg = JSON.stringify(result);
                                  // JSONObject result = new JSONObject();
                                  //               result.put("type",   "ViewHide" );
                                  //               result.put("code",   0 );
                                  //               result.put("msg",   "视图隐藏" );


                                          // params.put("type",   "ViewShow" );
                                          // params.put("code",   0 );
                                          // params.put("msg",   "视图显示" );
                                 console.log(result);
                             }); 
            },
            Hahajing(){ 
                var Live = this.$refs.myMHLive;
                Live.Hahajing(result => {
                                const msg = JSON.stringify(result);
                                  // JSONObject result = new JSONObject();
                                  //               result.put("type",   "ViewHide" );
                                  //               result.put("code",   0 );
                                  //               result.put("msg",   "视图隐藏" );


                                          // params.put("type",   "ViewShow" );
                                          // params.put("code",   0 );
                                          // params.put("msg",   "视图显示" );
                                 console.log(result);
                             }); 
            },
            Tiezhi(){ 
                var Live = this.$refs.myMHLive;
                Live.Tiezhi(result => {
                                const msg = JSON.stringify(result);
                                  // JSONObject result = new JSONObject();
                                  //               result.put("type",   "ViewHide" );
                                  //               result.put("code",   0 );
                                  //               result.put("msg",   "视图隐藏" );


                                          // params.put("type",   "ViewShow" );
                                          // params.put("code",   0 );
                                          // params.put("msg",   "视图显示" );
                                 console.log(result);
                             }); 
            },
            Meiyan(){ 
                var Live = this.$refs.myMHLive;
                Live.Meiyan(result => {
                                const msg = JSON.stringify(result);
                                  // JSONObject result = new JSONObject();
                                  //               result.put("type",   "ViewHide" );
                                  //               result.put("code",   0 );
                                  //               result.put("msg",   "视图隐藏" );


                                          // params.put("type",   "ViewShow" );
                                          // params.put("code",   0 );
                                          // params.put("msg",   "视图显示" );
                                 console.log(result);
                             }); 
            }, 
            StartPush(){   
                var Live = this.$refs.myMHLive;
                Live.StartPush(
                    {
                    URL:"rtmp://txlivepush.youyacao.com/蜻蜓-uni/kiro?txSecret=205640c212325356b1f812ee95b2731a&txTime=5FEC42E3"
                    },
                        result => {
                                const msg = JSON.stringify(result);
                                 console.log(result);
                             }); 
            },
            StopPush(){   
                var Live = this.$refs.myMHLive;
                Live.StopPush(result => {
                                const msg = JSON.stringify(result);
                                 console.log(result);
                             }); 
            },
             OpenFalsh(){
                var Live = this.$refs.myMHLive;
                Live.OpenFalsh(); 
             },
             CloseFlash(){   
                var Live = this.$refs.myMHLive;
                Live.CloseFlash(); 
             },
             SwitchCamera(){    
                var Live = this.$refs.myMHLive;
                Live.SwitchCamera(); 
             } 

        }
    }
</script>

其他说明

相比涂图科技高精准定位高端企业用户,美狐sdk的价格相对就显得非常亲民,可通过优雅草科技伙伴渠道优惠购取sdk。

uniapp插件下载地址:

https://ext.dcloud.net.cn/plugin?id=3800

直接给您节省了 接入原生sdk的成本和精力。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值