Giter VIP home page Giter VIP logo

agora-uniapp-sdk's Introduction

Agora-Uniapp-SDK

此 SDK 基于 uni-app 以及 Agora Android 和 iOS 的视频 SDK 实现。

发版说明

变更日志

集成文档(云打包)

需要同时引用以下两个插件,JS 插件主要是为了做代码提示,且包含一些JS的逻辑,便于开发者使用 Native 插件

Native 插件

JS 插件

集成文档(离线打包)

克隆或下载本工程,并进入工程目录

git clone https://github.com/AgoraIO-Community/Agora-Uniapp-SDK.git
cd Agora-Uniapp-SDK

安装依赖项并编译 JavaScript 脚本

yarn

随后拷贝 lib/commonjs 中生成的源代码到你的工程

如果你的 uni-app 项目支持 TypeScript, 则直接拷贝 src 内的源代码到你的工程即可

执行 install.sh 脚本以下载 Agora iOS SDK

sh ./install.sh

并确认 ios/libs 目录中包含 .framework 文件

将 Android 和 iOS 工程分别放到 uni-app 离线 SDK 对应的目录中

  • Android:UniPlugin-Hello-AS
  • iOS:HBuilder-uniPluginDemo

将 Android 和 iOS 工程分别引入 uni-app 离线 SDK 工程

Android

  • settings.gradle 中添加
include ':uniplugin_agora_rtc'
project(':uniplugin_agora_rtc').projectDir = new File(rootProject.projectDir, 'android')
  • app/build.gradle 中添加 implementation project(':uniplugin_agora_rtc')

iOS

在 Xcode 中右键 HBuilder-uniPlugin 工程,并点击 Add Files to "HBuilder-uniPlugin", 选中 AgoraRtcUniPlugin.xcodeproj 并添加

在 Xcode 中点击 HBuilder-uniPlugin 工程,并点击 HBuilder Target,选中 Build Phases

  • Dependencies 中添加 AgoraRtcUniPlugin
  • Link Binary With Libraries 中添加 AgoraRtcUniPlugin.framework
  • Embed Frameworks 中添加 AgoraRtcKit.framework Agorafdkaac.framework Agoraffmpeg.framework AgoraSoundTouch.framework (需要通过 Add Other... 选择 ios/libs 目录中的 .framework 文件添加)

如何使用

// 指向插件JS源码在你的工程中的相对路径,比如
import RtcEngine from '../../components/Agora-RTC-JS/index';
RtcEngine.create('你的AppID').then((engine) => {
  console.log('init success');
});

插件绝大部分 API 都使用 Promise 包装,为保证调用时序,请使用 await 关键字

常见错误

API文档

资源

开源许可

MIT

agora-uniapp-sdk's People

Contributors

lichking-2234 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.