React Native Zoom US 项目教程
react-native-zoom-us项目地址:https://gitcode.com/gh_mirrors/re/react-native-zoom-us
1. 项目的目录结构及介绍
react-native-zoom-us/
├── android/
│ ├── app/
│ ├── build.gradle
│ ├── settings.gradle
│ └── ...
├── ios/
│ ├── react-native-zoom-us/
│ ├── react-native-zoom-us.xcodeproj/
│ └── ...
├── src/
│ ├── index.ts
│ ├── native.ts
│ ├── video-view.tsx
│ └── ...
├── .eslintrc
├── .gitattributes
├── .gitignore
├── .npmignore
├── CHANGELOG.md
├── LICENSE
├── README.md
├── RNZoomUs.podspec
├── package-lock.json
├── package.json
└── tsconfig.json
目录结构介绍
android/
: 包含 Android 项目的相关文件和配置。ios/
: 包含 iOS 项目的相关文件和配置。src/
: 包含项目的源代码文件。index.ts
: 项目的入口文件。native.ts
: 与原生代码交互的文件。video-view.tsx
: 视频视图组件。
.eslintrc
: ESLint 配置文件。.gitattributes
: Git 属性配置文件。.gitignore
: Git 忽略文件配置。.npmignore
: npm 忽略文件配置。CHANGELOG.md
: 项目更新日志。LICENSE
: 项目许可证。README.md
: 项目说明文档。RNZoomUs.podspec
: CocoaPods 配置文件。package-lock.json
: npm 依赖锁定文件。package.json
: 项目依赖和脚本配置文件。tsconfig.json
: TypeScript 配置文件。
2. 项目的启动文件介绍
index.ts
index.ts
是项目的入口文件,负责初始化和导出主要的模块和功能。以下是该文件的主要内容:
import ZoomUs from 'react-native-zoom-us';
// 初始化
await ZoomUs.initialize({
jwtToken: 'your_jwt_token'
});
// 初始化并配置
await ZoomUs.initialize({
jwtToken: 'your_jwt_token',
domain: 'zoom.us'
}, {
disableShowVideoPreviewWhenJoinMeeting: true,
enableCustomizedMeetingUI: true
});
// 启动会议
await ZoomUs.startMeeting({
userName: 'Johny',
meetingNumber: '12345678',
zoomAccessToken: 'zak',
userType: 2 // 可选
});
// 加入会议
await ZoomUs.joinMeeting({
userName: 'Johny',
meetingNumber: '12345678'
});
3. 项目的配置文件介绍
package.json
package.json
文件包含了项目的依赖、脚本和其他配置信息。以下是该文件的主要内容:
{
"name": "react-native-zoom-us",
"version": "6.18.0",
"description": "React Native wrapper for ZoomUS SDK",
"main": "src/index.ts",
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"react": "17.0.2",
"react-native": "0.72.2",
"react-native-zoom-us": "6.18.0"
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@babel/runtime": "^7.12.5",
"@react-native-community/eslint-config": "^2.0.0",
"babel-jest": "^26.6.3",
"eslint": "^7.14.0",
"jest": "^26.6
react-native-zoom-us项目地址:https://gitcode.com/gh_mirrors/re/react-native-zoom-us