更新记录

0.0.2(2021-02-25) 下载此版本

去掉IOS版本中三方库的UIWebview接口

0.0.1(2020-10-29) 下载此版本

1.初始化发版,提供腾讯云点播客户端上传SDK集成。


平台兼容性

Android Android CPU类型 iOS
适用版本区间:4.4 - 4.4 armeabi-v7a:未测试,arm64-v8a:未测试,x86:未测试 适用版本区间:9 - 14

原生插件通用使用流程:

  1. 购买插件,选择该插件绑定的项目。
  2. 在HBuilderX里找到项目,在manifest的app原生插件配置中勾选模块,如需要填写参数则参考插件作者的文档添加。
  3. 根据插件作者的提供的文档开发代码,在代码中引用插件,调用插件功能。
  4. 打包自定义基座,选择插件,得到自定义基座,然后运行时选择自定义基座,进行log输出测试。
  5. 开发完毕后正式云打包

付费原生插件目前不支持离线打包。
Android 离线打包原生插件另见文档 https://nativesupport.dcloud.net.cn/NativePlugin/offline_package/android
iOS 离线打包原生插件另见文档 https://nativesupport.dcloud.net.cn/NativePlugin/offline_package/ios

注意事项:使用HBuilderX2.7.14以下版本,如果同一插件且同一appid下购买并绑定了多个包名,提交云打包界面提示包名绑定不一致时,需要在HBuilderX项目中manifest.json->“App原生插件配置”->”云端插件“列表中删除该插件重新选择


使用很简单只有一个方法,下方是完整的示例代码

复制代码<template>
    <view @click="handleUpload" class="content">
        <image class="logo" src="/static/logo.png"></image>
        <view class="text-area">
            <text class="title">{{title}}</text>
        </view>
    </view>
</template>

<script>
    const Haike = uni.requireNativePlugin('fb-haike');
    export default {
        data() {
            return {
                title: 'Hello'
            }
        },
        onLoad() {},
        methods: {
            handleUpload() {

                uni.chooseVideo({
                    success(e) {
                        Haike.uploadVideo({
                            videoPath: e.tempFilePath,
                            signature: '这里填写云点播的上传签名,具体请看官方文档'
                        }, (result) => {

                            //上传进度回调
                            if(result.type == 'progress'){
                                console.log(result);
                                //{type:"progress",uploadBytes:12030,totalBytes:968554}
                                //其中type字段为类型标识,uploadBytes字段为已上传的字节数,totalBytes为文件的总字节数

                            }

                            //上传完成回调
                            if(result.type == 'complete'){
                                console.log(result);
                                //{type:"complete",code:0,videoId:968554,videoURL:http://xxxxxx,descMsg:"upload success"}
                                //其中type字段为类型标识,code字段为上传结果码,结果吗为0则是上传成功,其他错误结果码可以查看腾讯云点播的文档
                                //videoId为云点播中视频的id,videoURL为视频的播放地址,descMsg为上传的结果描述
                            }

                        })
                    }
                })

            }
        }
    }
</script>

<style>
    .content {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .logo {
        height: 200rpx;
        width: 200rpx;
        margin-top: 200rpx;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 50rpx;
    }

    .text-area {
        display: flex;
        justify-content: center;
    }

    .title {
        font-size: 36rpx;
        color: #8f8f94;
    }
</style>

隐私、权限声明

1. 本插件需要申请的系统权限列表:

2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:

3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率:

许可协议

作者未提供license.md
我是大钊

2021-10-04

非常好的插件,安卓端简单好用。IOS端还不知道。 能不能再加个取消上传功能? IOS打包失败: [PluginPath]fb-haike/ios//uniplugin_haike.framework/uniplugin_haike(AFNetworkReachabilityManager.o) ARCHIVE FAILED The following build commands failed: Ld /Users/[Name]/Library/Developer/Xcode/DerivedData/HBuilder-ejoyrscydzaqssfwdndugcidujii/Build/Intermediates.noindex/ArchiveIntermediates/HBuilder/IntermediateBuildFilesPath/HBuilder.build/Release-iphoneos/HBuilder.build/Objects-normal/arm64/Binary/HBuilder normal arm64 (1 failure) Error code = 0 Error message: opendir([PackagePath]/XArchive/exportArchive): failed to open dir: No such file or directory

263***@qq.com

2020-11-27

Error in created hook: "TypeError: Cannot read property 'TCPlayer' of undefined"

Property or method "handleUpload" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property.

Invalid handler for event "click": got undefined

2021-10-09

安卓端很好用,苹果端在线打包失败,也不留个联系方式