├── .gitignore ├── tsconfig.prod.json ├── src ├── appToken.ts ├── apiMiddleware │ ├── index.ts │ ├── netlessWhiteboardApi.ts │ └── RoomOperator.ts ├── assets │ └── image │ │ ├── name_bg.jpg │ │ ├── room_not_find.svg │ │ └── netless_black.svg ├── pages │ ├── WhiteboardPage.less │ ├── PageError.tsx │ ├── PageError.less │ ├── AppRoutes.tsx │ ├── Homepage.less │ ├── WhiteboardCreatorPage.tsx │ ├── ReplayPage.tsx │ ├── Homepage.tsx │ └── WhiteboardPage.tsx ├── index.tsx ├── locale │ ├── zh-CN.yml │ ├── index.ts │ └── en.yml └── custom.d.ts ├── public ├── favicon.ico ├── manifest.json └── index.html ├── resources └── icon.png ├── tsconfig.test.json ├── theme.js ├── Dockerfile ├── main.js ├── tsconfig.json ├── nginx.conf ├── LICENSE ├── tslint.json ├── config-overrides.js ├── package.json ├── theme.less ├── README.md └── webpack.config.js /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea 2 | /node_modules 3 | /build 4 | /dist 5 | -------------------------------------------------------------------------------- /tsconfig.prod.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json" 3 | } -------------------------------------------------------------------------------- /src/appToken.ts: -------------------------------------------------------------------------------- 1 | export const netlessToken = { 2 | sdkToken: process.env.sdkToken, 3 | }; 4 | -------------------------------------------------------------------------------- /src/apiMiddleware/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./netlessWhiteboardApi"; 2 | export * from "./RoomOperator"; 3 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netless-io/netless-rtc-react-whiteboard/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /resources/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netless-io/netless-rtc-react-whiteboard/HEAD/resources/icon.png -------------------------------------------------------------------------------- /tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "commonjs" 5 | } 6 | } -------------------------------------------------------------------------------- /src/assets/image/name_bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netless-io/netless-rtc-react-whiteboard/HEAD/src/assets/image/name_bg.jpg -------------------------------------------------------------------------------- /src/pages/WhiteboardPage.less: -------------------------------------------------------------------------------- 1 | @import "../../theme"; 2 | 3 | .whiteboard-box { 4 | width: 100%; 5 | height: 100vh; 6 | } 7 | -------------------------------------------------------------------------------- /theme.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "antd": { 3 | '@icon-url': '"~antd-iconfont/iconfont"', 4 | "@primary-color": "#5B908E", 5 | } 6 | }; 7 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openresty/openresty:centos 2 | COPY ./build /usr/local/openresty/nginx/build 3 | COPY ./nginx.conf /usr/local/openresty/nginx/conf/nginx.conf 4 | 5 | CMD ["openresty"] 6 | 7 | -------------------------------------------------------------------------------- /src/apiMiddleware/netlessWhiteboardApi.ts: -------------------------------------------------------------------------------- 1 | import { RoomOperator } from "./RoomOperator"; 2 | export const netlessWhiteboardApi = new class { 3 | public readonly room: RoomOperator = new RoomOperator(); 4 | }; 5 | -------------------------------------------------------------------------------- /src/index.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import * as ReactDOM from "react-dom"; 3 | import {AppRoutes} from "./pages/AppRoutes"; 4 | 5 | ReactDOM.render( 6 | , 7 | document.getElementById("app-root"), 8 | ); 9 | -------------------------------------------------------------------------------- /main.js: -------------------------------------------------------------------------------- 1 | const { app, BrowserWindow } = require('electron') 2 | 3 | app.on('ready', () => { 4 | let mainWindow = new BrowserWindow({ 5 | width: 1160, 6 | height: 720, 7 | }); 8 | mainWindow.loadURL('https://demo-rtc.herewhite.com'); 9 | }); -------------------------------------------------------------------------------- /src/locale/zh-CN.yml: -------------------------------------------------------------------------------- 1 | modules: 2 | 3 | global: 4 | white: White 5 | slogan: 让想法同步。 6 | copy: 复制 7 | copy-fail: 复制失败! 8 | copy-success: 已经成功复制到剪贴板! 9 | unnamed: 未命名 10 | cancel: 取消 11 | default-room-name: 未命名 12 | 13 | pages: 14 | 15 | home: 16 | all-doc: 全部文档 17 | my-created: 我创建的 18 | -------------------------------------------------------------------------------- /public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /src/custom.d.ts: -------------------------------------------------------------------------------- 1 | declare module "*.svg" { 2 | const content: string; 3 | export = content; 4 | } 5 | 6 | declare module "@netless/white-fast-web-sdk" { 7 | const WhiteFastSDK: any; 8 | export default WhiteFastSDK; 9 | } 10 | 11 | 12 | declare module "*.jpg" { 13 | const content: string; 14 | export = content; 15 | } 16 | declare module "*.png" { 17 | const content: string; 18 | export = content; 19 | } 20 | 21 | -------------------------------------------------------------------------------- /src/locale/index.ts: -------------------------------------------------------------------------------- 1 | import {Language, addLocaleData} from "@netless/i18n-react-router"; 2 | 3 | addLocaleData([ 4 | ...require("react-intl/locale-data/zh"), 5 | ...require("react-intl/locale-data/en"), 6 | ]); 7 | 8 | export type Lan = "en" | "zh-CN"; 9 | 10 | export const language = new Language({ 11 | defaultLan: "zh-CN", 12 | localeDescriptions: { 13 | "en": require("./en.yml"), 14 | "zh-CN": require("./zh-CN.yml"), 15 | }, 16 | }); 17 | -------------------------------------------------------------------------------- /src/pages/PageError.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import "./PageError.less"; 3 | import * as room_not_find from "../assets/image/room_not_find.svg"; 4 | 5 | export default class PageError extends React.Component<{}, {}> { 6 | public constructor(props: {}) { 7 | super(props); 8 | } 9 | public render(): React.ReactNode { 10 | return ( 11 | 12 | 13 | 14 | 15 | 您访问的页面不存在 16 | 17 | 18 | 19 | ); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/pages/PageError.less: -------------------------------------------------------------------------------- 1 | @import "../../theme"; 2 | 3 | .page404-box { 4 | width: 100%; 5 | display: flex; 6 | align-items: center; 7 | flex-direction: column; 8 | } 9 | 10 | .page404-image-box { 11 | height: 100vh; 12 | width: 100%; 13 | display: flex; 14 | flex-direction: column; 15 | align-items: center; 16 | justify-content: center; 17 | } 18 | 19 | .page404-image-inner { 20 | width: 420px; 21 | } 22 | 23 | .page404-image-inner-disconnected { 24 | width: 320px; 25 | } 26 | 27 | .page404-inner { 28 | margin-top: 24px; 29 | text-align: center; 30 | font-size: 16px; 31 | color: @gray; 32 | } 33 | 34 | .page404-btn { 35 | margin-top: 40px; 36 | width: 148px; 37 | } 38 | 39 | 40 | @media screen and (max-width: 660px) { 41 | .page404-image-inner { 42 | width: 280px; 43 | } 44 | .page404-image-inner-disconnected { 45 | width: 100%; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": "src", 4 | "outDir": "dist", 5 | "module": "ESNext", 6 | "target": "es5", 7 | "skipLibCheck": true, 8 | "lib": [ 9 | "es6", 10 | "dom" 11 | ], 12 | "allowSyntheticDefaultImports": true, 13 | "sourceMap": true, 14 | "declaration": true, 15 | "experimentalDecorators": true, 16 | "jsx": "react", 17 | "moduleResolution": "node", 18 | "forceConsistentCasingInFileNames": false, 19 | "noImplicitReturns": true, 20 | "noImplicitThis": true, 21 | "noImplicitAny": true, 22 | "strictNullChecks": true, 23 | "suppressImplicitAnyIndexErrors": true, 24 | "noUnusedLocals": false, 25 | "paths": { 26 | "*" : ["node_modules/white-web-sdk/types/*"] 27 | } 28 | }, 29 | "exclude": [ 30 | "node_modules", 31 | "dist", 32 | "build", 33 | "scripts" 34 | ], 35 | "include": [ 36 | "./src/**/*" 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /src/locale/en.yml: -------------------------------------------------------------------------------- 1 | modules: 2 | error-page: 3 | title-not-exist: The page you visited does not exist 4 | title-not-disconnect: Room disconnected 5 | title-room-not-exist: Room does not exist 6 | btn: Back to home 7 | 8 | pages: 9 | login: 10 | login: Login 11 | forget-password: Forgot password ? 12 | input-password: Input password 13 | input-phone-or-email: Phone userId / Email 14 | input-email: Input Email 15 | home: 16 | all-doc: All Document 17 | my-created: I Created 18 | share-to-me: Share To Me 19 | recycle-bin: Recycle Bin 20 | my-doc: My Document 21 | search-input: Link / Doc Name 22 | account-setting: Account Set 23 | user-name: Name 24 | 25 | player: 26 | broadcaster-perspective: Broadcaster Perspective 27 | menu-title: Replay list 28 | freedom-perspective: Freedom Perspective 29 | notification-title: Playback function Beta release notes 30 | notification-inner: White will 31 | -------------------------------------------------------------------------------- /nginx.conf: -------------------------------------------------------------------------------- 1 | 2 | user root; 3 | worker_processes 1; 4 | daemon off; 5 | 6 | #error_log logs/error.log notice; 7 | #error_log logs/error.log info; 8 | 9 | #pid logs/nginx.pid; 10 | 11 | events { 12 | worker_connections 1024; 13 | } 14 | 15 | 16 | http { 17 | 18 | 19 | include mime.types; 20 | default_type application/octet-stream; 21 | 22 | #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 23 | # '$status $body_bytes_sent "$http_referer" ' 24 | # '"$http_user_agent" "$http_x_forwarded_for"'; 25 | 26 | #access_log logs/access.log main; 27 | 28 | sendfile on; 29 | #tcp_nopush on; 30 | 31 | #keepalive_timeout 0; 32 | keepalive_timeout 65; 33 | 34 | #gzip on; 35 | 36 | 37 | server { 38 | listen 80; 39 | location / { 40 | root /usr/local/openresty/nginx/build; 41 | try_files $uri $uri/ /index.html; 42 | } 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 netless 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/apiMiddleware/RoomOperator.ts: -------------------------------------------------------------------------------- 1 | import Fetcher from "@netless/fetch-middleware"; 2 | import {netlessToken} from "../appToken"; 3 | export enum RoomType { 4 | transitory = "transitory", 5 | persistent = "persistent", 6 | historied = "historied", 7 | } 8 | 9 | const fetcher = new Fetcher(5000, "https://cloudcapiv4.herewhite.com"); 10 | 11 | export class RoomOperator { 12 | 13 | public async createRoomApi(name: string, limit: number, mode: RoomType): Promise { 14 | const json = await fetcher.post({ 15 | path: `room`, 16 | query: { 17 | token: netlessToken.sdkToken, 18 | }, 19 | body: { 20 | name: name, 21 | limit: limit, 22 | mode: mode, 23 | }, 24 | }); 25 | return json as any; 26 | } 27 | 28 | public async joinRoomApi(uuid: string): Promise { 29 | const json = await fetcher.post({ 30 | path: `room/join`, 31 | query: { 32 | uuid: uuid, 33 | token: netlessToken.sdkToken, 34 | }, 35 | }); 36 | return json as any; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/pages/AppRoutes.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import {AppRouter, HistoryType} from "@netless/i18n-react-router"; 3 | import {language} from "../locale"; 4 | import {message} from "antd"; 5 | import WhiteboardCreatorPage from "./WhiteboardCreatorPage"; 6 | import WhiteboardPage from "./WhiteboardPage"; 7 | import Homepage from "./Homepage"; 8 | import ReplayPage from "./ReplayPage"; 9 | export class AppRoutes extends React.Component<{}, {}> { 10 | 11 | public constructor(props: {}) { 12 | super(props); 13 | } 14 | 15 | public componentDidCatch(error: any, inf: any): void { 16 | message.error(`网页加载发生错误:${error}`); 17 | } 18 | 19 | public render(): React.ReactNode { 20 | return ( 21 | 27 | ); 28 | } 29 | } -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 25 | Netless 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "class-name": true, 4 | "member-access": [true, "check-accessor", "check-constructor"], 5 | "semicolon": [true, "always"], 6 | "comment-format": [ 7 | true, 8 | "check-space" 9 | ], 10 | "no-eval": true, 11 | "no-internal-module": true, 12 | "no-unsafe-finally": true, 13 | "one-line": [ 14 | true, 15 | "check-open-brace", 16 | "check-whitespace" 17 | ], 18 | "quotemark": [ 19 | true, 20 | "double" 21 | ], 22 | "triple-equals": [ 23 | true, 24 | "allow-null-check" 25 | ], 26 | "typedef": [true, "call-signature", "parameter", "member-variable-declaration"], 27 | "typedef-whitespace": [ 28 | true, 29 | { 30 | "call-signature": "nospace", 31 | "index-signature": "nospace", 32 | "parameter": "nospace", 33 | "property-declaration": "nospace", 34 | "variable-declaration": "nospace" 35 | } 36 | ], 37 | "curly": true, 38 | "no-invalid-this": [true, "check-function-in-method"], 39 | "no-string-throw": true, 40 | "no-unused-expression": true, 41 | "no-var-keyword": true, 42 | "use-isnan": true, 43 | "indent": [true, "spaces"], 44 | "no-trailing-whitespace": true, 45 | "prefer-const": true, 46 | "trailing-comma": [true, {"multiline": "always", "singleline": "never"}], 47 | "array-type": [true, "array"], 48 | "arrow-parens": [true, "ban-single-arg-parens"], 49 | "no-angle-bracket-type-assertion": true, 50 | "whitespace": [ 51 | true, 52 | "check-branch", 53 | "check-decl", 54 | "check-operator", 55 | "check-separator", 56 | "check-type", 57 | "check-typecast" 58 | ] 59 | } 60 | } -------------------------------------------------------------------------------- /config-overrides.js: -------------------------------------------------------------------------------- 1 | const tsImportPluginFactory = require("ts-import-plugin"); 2 | const {getLoader} = require("react-app-rewired"); 3 | const rewireLess = require('react-app-rewire-less'); 4 | const rewireYAML = require('react-app-rewire-yaml'); 5 | const rewireDefinePlugin = require("react-app-rewire-define-plugin"); 6 | 7 | module.exports = function override(config, env) { 8 | config = rewireYAML(config, env); 9 | 10 | const tsLoader = getLoader( 11 | config.module.rules, 12 | rule => 13 | rule.loader && 14 | typeof rule.loader === "string" && 15 | rule.loader.includes("ts-loader") 16 | ); 17 | 18 | tsLoader.options = { 19 | getCustomTransformers: () => ({ 20 | before: [ 21 | tsImportPluginFactory({ 22 | libraryDirectory: "es", 23 | libraryName: "antd", 24 | style: true, 25 | }), 26 | ], 27 | }) 28 | }; 29 | config = rewireLess.withLoaderOptions({ 30 | modifyVars: require("./theme").antd, 31 | javascriptEnabled: true, 32 | })(config, env); 33 | 34 | config = setupProcessEnv(config, env); 35 | 36 | return config; 37 | }; 38 | 39 | function setupProcessEnv(config, env) { 40 | let scope = process.env.SCOPE; 41 | switch (process.env.SCOPE) { 42 | case "testing": 43 | default: { 44 | scope = "development"; 45 | consoleLambdaOrigin = "https://cloudcapiv4.herewhite.com"; 46 | break; 47 | } 48 | } 49 | config = rewireDefinePlugin(config, env, { 50 | "process.env.SCOPE": JSON.stringify(scope), 51 | "process.env.CONSOLE_LAMBDA_ORIGIN": JSON.stringify(consoleLambdaOrigin), 52 | "process.env.sdkToken": JSON.stringify(process.env.sdkToken) 53 | }); 54 | return config; 55 | } 56 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "netless-rtc-react-whiteboard", 3 | "version": "1.1.3", 4 | "main": "./main.js", 5 | "author": "Wushuang", 6 | "license": "MIT", 7 | "theme": "./theme.js", 8 | "proxy": "http://localhost:3009/", 9 | "scripts": { 10 | "dev": "react-app-rewired start --scripts-version react-scripts-ts", 11 | "build": "rimraf build && NODE_ENV=production react-app-rewired --max-old-space-size=4096 build --scripts-version react-scripts-ts", 12 | "build:app": "rm -rf ./dist && electron-builder build --win --x64 && electron-builder build --mac --x64" 13 | }, 14 | "build": { 15 | "appId": "netless", 16 | "directories": { 17 | "buildResources": "resources" 18 | }, 19 | "files": [ 20 | "package.json", 21 | "main.js", 22 | "resources/icon.*" 23 | ] 24 | }, 25 | "dependencies": { 26 | "@netless/fetch-middleware": "^1.0.4", 27 | "@netless/i18n-react-router": "^1.0.5", 28 | "@netless/white-fast-web-sdk": "^1.4.12", 29 | "agora-rtc-sdk": "^2.9.0", 30 | "ali-oss": "^6.1.1", 31 | "antd": "^3.10.4", 32 | "react": "^16.3.2", 33 | "react-dom": "^16.3.2", 34 | "uuid": "^3.3.2" 35 | }, 36 | "devDependencies": { 37 | "@types/agora-rtc-sdk": "^2.6.0", 38 | "@types/ali-oss": "^6.0.3", 39 | "@types/js-yaml": "^3.11.2", 40 | "@types/node": "^11.12.2", 41 | "@types/query-string": "5", 42 | "@types/react": "^16.4.12", 43 | "@types/react-dom": "^16.0.5", 44 | "@types/uuid": "^3.4.4", 45 | "@types/video.js": "^7.2.10", 46 | "fork-ts-checker-webpack-plugin": "^1.3.4", 47 | "js-yaml": "^3.12.0", 48 | "react-app-rewire-define-plugin": "^1.0.0", 49 | "react-app-rewire-less": "^2.1.1", 50 | "react-app-rewire-yaml": "^1.1.0", 51 | "react-app-rewired": "^1.5.2", 52 | "react-scripts-ts": "^2.16.0", 53 | "rimraf": "^2.6.3", 54 | "ts-import-plugin": "^1.5.0", 55 | "tslint": "^5.9.1", 56 | "typescript": "^3.5.1" 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/pages/Homepage.less: -------------------------------------------------------------------------------- 1 | @import "../../theme"; 2 | 3 | .page-input-box { 4 | width: 100%; 5 | height: 100vh; 6 | display: flex; 7 | flex-direction: row; 8 | background-color: white; 9 | img { 10 | cursor: pointer; 11 | position: absolute; 12 | margin-left: 48px; 13 | margin-top: 48px; 14 | } 15 | } 16 | 17 | .page-input-mid-box { 18 | width: 300px; 19 | } 20 | 21 | .name-button { 22 | width: 240px; 23 | margin-top: 24px; 24 | font-size: 14px; 25 | } 26 | 27 | .name-title { 28 | margin-bottom: 24px; 29 | font-weight: bold; 30 | font-size: 16px; 31 | } 32 | 33 | .page-input-left-mid-box { 34 | width: 360px; 35 | height: 280px; 36 | display: flex; 37 | justify-content: center; 38 | box-sizing: border-box; 39 | padding-right: 20px; 40 | padding-left: 20px; 41 | border-radius: 8px; 42 | box-shadow: 0 0 16px #E7EAEE; 43 | } 44 | 45 | .page-input-left-mid-box-tab { 46 | width: 300px; 47 | margin-top: 12px; 48 | .ant-tabs-tab { 49 | width: 134px; 50 | text-align: center; 51 | font-size: 16px; 52 | } 53 | } 54 | .page-input { 55 | width: 240px; 56 | font-size: 14px; 57 | } 58 | .page-input-left-inner-box { 59 | height: 180px; 60 | width: 100%; 61 | display: flex; 62 | align-items: center; 63 | justify-content: center; 64 | flex-direction: column; 65 | margin-top: 8px; 66 | } 67 | 68 | .page-input-left-box { 69 | width: 50%; 70 | display: flex; 71 | align-items: center; 72 | justify-content: center; 73 | flex-direction: column; 74 | } 75 | .page-input-right-box { 76 | width: 50%; 77 | display: flex; 78 | align-items: center; 79 | justify-content: center; 80 | flex-direction: column; 81 | background: url("../assets/image/name_bg.jpg") no-repeat scroll center center; 82 | } 83 | @media screen and (max-width: 840px) { 84 | .page-input-left-box { 85 | width: 100%; 86 | } 87 | .page-input-right-box { 88 | display: none; 89 | } 90 | .page-input-left-mid-box { 91 | width: 300px; 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /theme.less: -------------------------------------------------------------------------------- 1 | @base_black: #141414; 2 | @base_gray: #7A7A7A; 3 | @toolboxShadow: 0 1px 2px 0 rgba(0, 0, 0, 0.20); 4 | @toolboxShadowHover: 0 4px 8px 0 rgba(0, 0, 0, 0.20); 5 | 6 | @main_color: #5B908E; 7 | @main_color_green: #16BD5D; 8 | @black_darker: #141414; 9 | @black_dark: #292929; 10 | @black: #3D3D3D; 11 | @black_light: #525252; 12 | @black_lighter: #666666; 13 | @gray_darker: #7A7A7A; 14 | @gray_dark: #8F8F8F; 15 | @gray: #A2A7AD; 16 | @gray_light: #B8B8B8; 17 | @gray_lighter: #CCCCCC; 18 | @white_not_nearly: #E0E0E0; 19 | @white_nearly: #F5F5F5; 20 | @white_almost: #FAFAFA; 21 | @white: #FFFFFF; 22 | // Roboto,-apple-system,BlinkMacSystemFont,Helvetica,Arial,sans-serif 23 | body { 24 | margin: 0; 25 | padding: 0; 26 | overflow-x: hidden; 27 | font-family: MarkPro, -apple-system, BlinkMacSystemFont, Helvetica Neue, Helvetica, Roboto, Arial, HYQiHei, "PingFang SC", "PingFang TC", sans-serif; 28 | } 29 | 30 | a { 31 | text-decoration: none; 32 | outline: none; 33 | color: @black_dark; 34 | } 35 | a:link { 36 | text-decoration: none; 37 | outline: none; 38 | } 39 | a:visited { 40 | text-decoration: none; 41 | outline: none; 42 | } 43 | a:hover { 44 | text-decoration: none; 45 | outline: none; 46 | } 47 | a:active { 48 | text-decoration: none; 49 | outline: none; 50 | } 51 | 52 | 53 | select { 54 | outline: none; 55 | } 56 | 57 | textarea { 58 | outline: none; 59 | -webkit-appearance: none; 60 | resize: none; 61 | } 62 | 63 | .ant-menu-vertical { 64 | border-right: white; 65 | } 66 | 67 | .hover-transition { 68 | transition-duration: 0.2s; 69 | } 70 | 71 | .ant-menu-inline { 72 | border-right: 1px solid white; 73 | } 74 | 75 | .main-duration { 76 | transition-duration: 0.3s; 77 | -moz-transition-duration: 0.3s; /* Firefox 4 */ 78 | -webkit-transition-duration: 0.3s; /* Safari 和 Chrome */ 79 | -o-transition-duration: 0.3s; /* Opera */ 80 | 81 | transition-timing-function: ease-in-out; 82 | -moz-transition-timing-function: ease-in-out; 83 | -webkit-transition-timing-function: ease-in-out; 84 | -o-transition-timing-function: ease-in-out; 85 | } 86 | 87 | .ant-popover-inner-content { 88 | padding: 0; 89 | } 90 | -------------------------------------------------------------------------------- /src/pages/WhiteboardCreatorPage.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import {Redirect} from "@netless/i18n-react-router"; 3 | import {netlessWhiteboardApi, RoomType} from "../apiMiddleware"; 4 | import {message} from "antd"; 5 | import {RouteComponentProps} from "react-router"; 6 | import PageError from "./PageError"; 7 | export enum IdentityType { 8 | host = "host", 9 | guest = "guest", 10 | listener = "listener", 11 | } 12 | export type WhiteboardCreatorPageState = { 13 | uuid?: string; 14 | userId?: string; 15 | foundError: boolean; 16 | }; 17 | 18 | export type WhiteboardCreatorPageProps = RouteComponentProps<{ 19 | identityType: IdentityType; 20 | uuid?: string; 21 | }>; 22 | 23 | 24 | export default class WhiteboardCreatorPage extends React.Component { 25 | 26 | public constructor(props: WhiteboardCreatorPageProps) { 27 | super(props); 28 | this.state = { 29 | foundError: false, 30 | }; 31 | } 32 | 33 | private createRoomAndGetUuid = async (room: string, limit: number, mode: RoomType): Promise => { 34 | const res = await netlessWhiteboardApi.room.createRoomApi(room, limit, mode); 35 | if (res.code === 200) { 36 | return res.msg.room.uuid; 37 | } else { 38 | return null; 39 | } 40 | } 41 | public async componentWillMount(): Promise { 42 | try { 43 | let uuid: string | null; 44 | if (this.props.match.params.uuid) { 45 | uuid = this.props.match.params.uuid; 46 | } else { 47 | uuid = await this.createRoomAndGetUuid("test1", 0, RoomType.historied); 48 | } 49 | const userId = `${Math.floor(Math.random() * 100000)}`; 50 | this.setState({userId: userId}); 51 | if (uuid) { 52 | this.setState({uuid: uuid}); 53 | } else { 54 | message.error("create room fail"); 55 | } 56 | } catch (error) { 57 | this.setState({foundError: true}); 58 | throw error; 59 | } 60 | } 61 | 62 | public render(): React.ReactNode { 63 | const identityType = this.props.match.params.identityType; 64 | if (this.state.foundError) { 65 | return ; 66 | } else if (this.state.uuid && this.state.userId) { 67 | return ; 68 | } 69 | return null; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/pages/ReplayPage.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import {RouteComponentProps} from "react-router"; 3 | import "./WhiteboardPage.less"; 4 | import {netlessWhiteboardApi} from "../apiMiddleware"; 5 | import WhiteFastSDK from "@netless/white-fast-web-sdk"; 6 | export type ReplayPageProps = RouteComponentProps<{ 7 | uuid: string; 8 | userId: string; 9 | startTime?: string; 10 | endTime?: string; 11 | mediaUrl?: string; 12 | }>; 13 | 14 | export type WhiteboardPageState = { 15 | player: any; 16 | }; 17 | 18 | export default class ReplayPage extends React.Component { 19 | private netlessPlayer: any; 20 | public constructor(props: ReplayPageProps) { 21 | super(props); 22 | this.state = { 23 | player: null, 24 | }; 25 | } 26 | 27 | private getRoomToken = async (uuid: string): Promise => { 28 | const res = await netlessWhiteboardApi.room.joinRoomApi(uuid); 29 | if (res.code === 200) { 30 | return res.msg.roomToken; 31 | } else { 32 | return null; 33 | } 34 | } 35 | 36 | private getDuration = (): number | undefined => { 37 | const {startTime, endTime} = this.props.match.params; 38 | if (startTime && endTime) { 39 | return parseInt(endTime) - parseInt(startTime); 40 | } else { 41 | return undefined; 42 | } 43 | } 44 | 45 | private startReplay = async (): Promise => { 46 | const {userId, uuid, startTime, mediaUrl} = this.props.match.params; 47 | const roomToken = await this.getRoomToken(uuid); 48 | const url = mediaUrl ? `https://beings.oss-cn-hangzhou.aliyuncs.com/${mediaUrl}` : undefined; 49 | if (roomToken) { 50 | this.netlessPlayer = WhiteFastSDK.Player("netless-replay", { 51 | uuid: uuid, 52 | roomToken: roomToken, 53 | userId: userId, 54 | userName: "伍双", 55 | userAvatarUrl: "https://ohuuyffq2.qnssl.com/netless_icon.png", 56 | logoUrl: "https://white-sdk.oss-cn-beijing.aliyuncs.com/video/netless_black2.svg", 57 | boardBackgroundColor: "#F2F2F2", 58 | playerCallback: (player: any) => { 59 | this.setState({player: player}); 60 | }, 61 | clickLogoCallback: () => { 62 | this.props.history.push("/"); 63 | }, 64 | // roomName: "伍双的教室", 65 | beginTimestamp: startTime && parseInt(startTime), 66 | duration: this.getDuration(), 67 | // mediaUrl: mediaUrl, 68 | // isManagerOpen: true, 69 | mediaUrl: url, 70 | // isChatOpen: 71 | }); 72 | } 73 | } 74 | 75 | 76 | public async componentDidMount(): Promise { 77 | await this.startReplay(); 78 | } 79 | public componentWillUnmount(): void { 80 | if (this.netlessPlayer) { 81 | this.netlessPlayer.release(); 82 | } 83 | } 84 | public render(): React.ReactNode { 85 | return ( 86 | 87 | ); 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # netless-agora-react-whiteboard 2 | 3 | ## 一、前言 4 | 5 | 1. `netless-react-whiteboard` 是 netless 提供的 web 实践项目,目的是为了让用户更加具象化的了解 netless 白板的功能和场景。 6 | 2. 我们采用 react 前端框架,Typescript 作为编程语言的技术选型编写这个项目,目的是让项目更加容易维护和迭代。 7 | 3. 我们将项目很多可复用的组件都抽象成了 react 的控件托管在 [netless-io](https://github.com/netless-io) 这个仓库,用户可以参考相关代码或者直接使用组件。我们也非常欢迎指正错误提交 PR. 8 | 4. 如有疑问可以发邮件到: rick@herewhite.com 9 | 10 | ## 二、开发准备 11 | 12 | ### 1. 概述 13 | 14 | 1. 云服务 token 获取,要启动这个项目完整的功能需要接入三个类型的云服务。 15 | 16 | - 互动白板 17 | - 云存储 18 | - 音视频 19 | 20 | 该 demo 使用的是 netless 自研的互动白板,阿里云的云存储,声网的音视频通讯服务作为基础选型。 21 | 22 | 2. 填写 `appTokenConfig.ts` 文件 23 | 24 | ``` typescript 25 | export const netlessToken = "xxx"; 26 | 27 | export const ossConfigObj = { 28 | accessKeyId: "xxx", 29 | accessKeySecret: "xxx", 30 | region: "oss-cn-xxx", 31 | bucket: "xxx", 32 | folder: "xxx", 33 | prefix: "https://xxx.oss-cn-xxx.aliyuncs.com/", 34 | }; 35 | 36 | export const rtcAppId = "xxx"; 37 | ``` 38 | 39 | ### 2. 白板 Token 40 | 41 | 1. 用途:用于白板的权限管理。 42 | 2. 获取方式: 43 | - 地址:https://console.herewhite.com/zh-CN/ 44 |  45 | 46 | 3. 填写参数 47 | 48 | ``` 49 | export const netlessToken = "xxx"; 50 | ``` 51 | 4. 如果要体验 `ppt、pptx、word、pdf 转图片` 或者 `pptx 转网页` 服务请去管理控制台先开启对应的服务。 52 | 53 | ### 3. 云存储 Token 54 | 55 | 1. 用途:存储互动白板的图片 ppt 等静态资源。 56 | 2. 获取方式: 57 | - 地址:https://oss.console.aliyun.com/overview 58 |  59 | 60 | 3. 填写参数 61 | 62 | ``` 63 | export const ossConfigObj = { 64 | accessKeyId: "xxx", 65 | accessKeySecret: "xxx", 66 | region: "oss-cn-xxx", 67 | bucket: "xxx", 68 | folder: "xxx", 69 | prefix: "https://xxx.oss-cn-xxx.aliyuncs.com/", 70 | }; 71 | ``` 72 | 73 | 74 | ### 4. 音视频 Token 75 | 76 | 1. 用途:音视频实时通信。 77 | 2. 获取方式: 78 | - 地址:https://dashboard.agora.io/ 79 |  80 | 3. 填写参数 81 | 82 | ``` 83 | export const rtcAppId = "xxx"; 84 | ``` 85 | 86 | ### 5. 注意事项 87 | 88 | **以上 token 都是用户的核心资产,本项目只是为了方便演示才直接放在项目当中,客户正式商用的时候请妥善保管。** 89 | 90 | ## 三、安装启动 91 | 92 | ### 1. 基础工具 93 | 94 | 1. node >= 8 95 | 2. 使用 `npm` 或者 `yarn` 管理依赖库。以下都用 `yarn` 命令说明。 96 | 97 | ### 2. 获取 98 | 99 | ```shell 100 | git clone git@github.com:netless-io/netless-react-whiteboard.git 101 | ``` 102 | 103 | ### 3. 安装 104 | 105 | ```shell 106 | # 访问目标文件 107 | cd netless-react-whiteboard 108 | 109 | # 安装依赖 110 | yarn 111 | ``` 112 | 113 | ### 4. 填写配置文件 114 | 115 | > 如果前面已经填写,这里不用重复 116 | 117 | ```typescript 118 | export const netlessToken = ""; 119 | 120 | export const ossConfigObj = { 121 | accessKeyId: "", 122 | accessKeySecret: "", 123 | region: "", 124 | bucket: "", 125 | folder: "", 126 | prefix: "", 127 | }; 128 | 129 | export const agoraAppId = ""; 130 | ``` 131 | 132 | ### 5. 启动 133 | 134 | ```shell 135 | # 启动项目 136 | yarn dev 137 | ``` 138 | 139 | ### 6. 构建 140 | 141 | ```shell 142 | # 构建项目 143 | yarn build 144 | ``` 145 | 146 | ### 7. 效果 147 | 148 | 1. 首页 149 |  150 | 151 | 2. 白板 152 |  153 | 154 | ## 四、深度使用 155 | 156 | 1. 文档站 157 | 158 | 地址:https://developer.herewhite.com/#/ 159 | 160 |  161 | 162 | 163 | 2. 管理控制台 164 | 165 | 地址:https://console.herewhite.com/zh-CN/ 166 | 167 |  168 | 169 | 3. 官网 170 | 171 | 地址:https://www.herewhite.com/ 172 | 173 |  174 | 175 | 4. 开源控件托管 176 | 177 | 地址:https://github.com/netless-io 178 | 179 |  180 | 181 | -------------------------------------------------------------------------------- /src/pages/Homepage.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import {Input, Button, Tabs} from "antd"; 3 | import "./Homepage.less"; 4 | import {RouteComponentProps} from "react-router"; 5 | import netless_black from "../assets/image/netless_black.svg"; 6 | import {Link} from "@netless/i18n-react-router"; 7 | import {FormComponentProps} from "antd/lib/form"; 8 | import {IdentityType} from "./WhiteboardCreatorPage"; 9 | 10 | const { TabPane } = Tabs; 11 | 12 | export type HomepageProps = RouteComponentProps<{}> & FormComponentProps; 13 | export type HomepageStates = { 14 | name: string; 15 | url: string; 16 | }; 17 | 18 | export default class Homepage extends React.Component { 19 | public constructor(props: HomepageProps) { 20 | super(props); 21 | this.state = { 22 | name: "", 23 | url: "", 24 | }; 25 | } 26 | private handleWhiteboardClickBtn = (): void => { 27 | this.props.history.push(`/whiteboard/${IdentityType.host}`); 28 | } 29 | private handleClickBtnUrl = (): void => { 30 | const isUrl = this.state.url.substring(0, 4) === "http"; 31 | if (this.state.url) { 32 | if (isUrl) { 33 | window.open(this.state.url, "_self"); 34 | } else { 35 | if (this.state.url.length === 32) { 36 | const isNotLive = this.state.url.search("live") === -1; 37 | if (isNotLive) { 38 | const isNotInteractive = this.state.url.search("live") === -1; 39 | if (isNotInteractive) { 40 | this.props.history.push(`/classroom/${IdentityType.host}/${this.state.url}/`); 41 | } else { 42 | this.props.history.push(`/classroom/${IdentityType.guest}/${this.state.url}/`); 43 | } 44 | } else { 45 | this.props.history.push(`/classroom/${IdentityType.listener}/${this.state.url}/`); 46 | } 47 | } 48 | } 49 | } 50 | } 51 | 52 | public render(): React.ReactNode { 53 | return ( 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | this.setState({name: e.target.value})} size={"large"} placeholder={"输入用户名"}/> 64 | 69 | 创建白板房间 70 | 71 | 72 | 73 | 74 | 75 | this.setState({url: e.target.value})} 77 | size={"large"} placeholder={"输入房间地址或者 UUID"}/> 78 | 84 | 加入房间 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | ); 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by taozeyu on 2017/6/4. 3 | */ 4 | 5 | const path = require("path"); 6 | const webpack = require("webpack"); 7 | const HtmlWebpackPlugin = require("html-webpack-plugin"); 8 | const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); 9 | 10 | const basic = { 11 | 12 | entry: [ 13 | "./src/index.ts", 14 | ], 15 | 16 | output: { 17 | filename: "javascript/index-[hash].js", 18 | path: __dirname + "/build", 19 | publicPath: "/", 20 | }, 21 | 22 | resolve: { 23 | extensions: [".ts", ".tsx", ".js", ".svg"], 24 | }, 25 | 26 | devtool: 'source-map', 27 | 28 | module: { 29 | rules: [ 30 | { 31 | test: /\.js$/, 32 | enforce: "pre", 33 | loader: "source-map-loader", 34 | exclude: [ 35 | path.resolve(__dirname, "src/rtc/rtsLib"), 36 | ] 37 | }, 38 | { 39 | test: /\.tsx?$/, 40 | use: [ 41 | 'ts-loader', 42 | { 43 | loader: 'ui-component-loader', 44 | options: { 45 | 'lib': 'antd', 46 | 'libDir': 'es', 47 | 'style': false, 48 | } 49 | }, 50 | ], 51 | exclude: /node_modules/, 52 | }, { 53 | test: /\.less$/, 54 | use: [ 55 | {loader: "style-loader"}, {loader: "css-loader"}, {loader: "less-loader"} 56 | ] 57 | }, { 58 | test: /\.css$/, 59 | use: [ 60 | {loader: "style-loader"}, {loader: "css-loader"} 61 | ] 62 | }, { 63 | test: /\.svg$/, 64 | exclude: /node_modules/, 65 | loader: 'svg-react-loader', 66 | query: { 67 | classIdPrefix: '[name]-[hash:8]__', 68 | propsMap: { 69 | fillRule: 'fill-rule', 70 | foo: 'bar' 71 | }, 72 | xmlnsTest: /^xmlns.*$/ 73 | } 74 | }, { 75 | test: /\.(png|jpg)$/, 76 | loader: 'url-loader?limit=8192&name=icons/[hash:8].[name].[ext]' 77 | }] 78 | }, 79 | plugins: [ 80 | new HtmlWebpackPlugin({ 81 | template: "./src/index-template.html", 82 | filename: "index.html", 83 | path: __dirname + "/build", 84 | inject: "body", 85 | }), 86 | new ForkTsCheckerWebpackPlugin({ memoryLimit : 10000, workers: 2 }) 87 | ] 88 | }; 89 | 90 | const development = { 91 | devServer: { 92 | port: 3000, 93 | historyApiFallback: true, 94 | // proxy: { 95 | // "/api": { 96 | // pathRewrite: {'^/api': '/'}, 97 | // target: "http://bad006a941144606a2cf5b693c5dddea-cn-hangzhou.alicloudapi.com/", 98 | // changeOrigin: true 99 | // }, 100 | // }, 101 | }, 102 | }; 103 | 104 | const production = { 105 | plugins: [ 106 | new webpack.optimize.UglifyJsPlugin({ 107 | compress: { 108 | warnings: false 109 | } 110 | }), 111 | ], 112 | }; 113 | 114 | function merge(conf1, conf2) { 115 | if (conf1 instanceof Array && conf2 instanceof Array) { 116 | const array = []; 117 | conf1.forEach(function (e) { 118 | array.push(e); 119 | }); 120 | conf2.forEach(function (e) { 121 | array.push(e); 122 | }); 123 | return array; 124 | } 125 | const result = {}; 126 | 127 | function mergeValue(v1, v2) { 128 | if (typeof v1 === "object" && typeof v2 === "object") { 129 | return merge(v1, v2); 130 | 131 | } else if (v1 === undefined) { 132 | return v2; 133 | 134 | } else { 135 | return v1; 136 | } 137 | } 138 | 139 | for (const key in conf1) { 140 | result[key] = mergeValue(conf1[key], conf2[key]); 141 | } 142 | for (const key in conf2) { 143 | if (!(key in conf1)) { 144 | result[key] = mergeValue(conf1[key], conf2[key]); 145 | } 146 | } 147 | return result; 148 | } 149 | 150 | module.exports = merge( 151 | basic, 152 | process.env.NODE_ENV === 'production' ? production : development 153 | ); 154 | -------------------------------------------------------------------------------- /src/pages/WhiteboardPage.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import {RouteComponentProps} from "react-router"; 3 | import AgoraRTC from "agora-rtc-sdk"; 4 | import "./WhiteboardPage.less"; 5 | import {netlessWhiteboardApi} from "../apiMiddleware"; 6 | import WhiteFastSDK from "@netless/white-fast-web-sdk"; 7 | import {IdentityType} from "./WhiteboardCreatorPage"; 8 | export type WhiteboardPageProps = RouteComponentProps<{ 9 | uuid: string; 10 | userId: string; 11 | identityType: IdentityType; 12 | }>; 13 | 14 | export type WhiteboardPageState = { 15 | recordData: RecordDataType | null; 16 | room: any, 17 | }; 18 | export type RecordDataType = {startTime?: number, endTime?: number, mediaUrl?: string}; 19 | export default class WhiteboardPage extends React.Component { 20 | private netlessRoom: any; 21 | public constructor(props: WhiteboardPageProps) { 22 | super(props); 23 | this.state = { 24 | recordData: null, 25 | room: null, 26 | }; 27 | } 28 | 29 | private getRoomToken = async (uuid: string): Promise => { 30 | const res = await netlessWhiteboardApi.room.joinRoomApi(uuid); 31 | if (res.code === 200) { 32 | return res.msg.roomToken; 33 | } else { 34 | return null; 35 | } 36 | } 37 | 38 | private handleReplayUrl = (): void => { 39 | const {userId, uuid} = this.props.match.params; 40 | const {recordData} = this.state; 41 | if (recordData) { 42 | if (recordData.startTime) { 43 | if (recordData.endTime) { 44 | if (recordData.mediaUrl) { 45 | this.props.history.push(`/replay/${uuid}/${userId}/${recordData.startTime}/${recordData.endTime}/${recordData.mediaUrl}/`); 46 | } else { 47 | this.props.history.push(`/replay/${uuid}/${userId}/${recordData.startTime}/${recordData.endTime}/`); 48 | } 49 | } else { 50 | this.props.history.push(`/replay/${uuid}/${userId}/${recordData.startTime}/`); 51 | } 52 | } else { 53 | this.props.history.push(`/replay/${uuid}/${userId}/`); 54 | } 55 | } else { 56 | this.props.history.push(`/replay/${uuid}/${userId}/`); 57 | } 58 | } 59 | 60 | private startJoinRoom = async (): Promise => { 61 | const {userId, uuid, identityType} = this.props.match.params; 62 | const roomToken = await this.getRoomToken(uuid); 63 | if (roomToken) { 64 | this.netlessRoom = WhiteFastSDK.Room("whiteboard", { 65 | uuid: uuid, 66 | roomToken: roomToken, 67 | userId: userId, 68 | // userName: "伍双", 69 | // roomName: "伍双的房间", 70 | // userAvatarUrl: "https://ohuuyffq2.qnssl.com/netless_icon.png", 71 | logoUrl: "https://white-sdk.oss-cn-beijing.aliyuncs.com/video/netless_black2.svg", 72 | loadingSvgUrl: "", 73 | clickLogoCallback: () => { 74 | // this.props.history.push("/"); 75 | }, 76 | recordDataCallback: (data: RecordDataType) => { 77 | this.setState({recordData: data}); 78 | }, 79 | replayCallback: () => { 80 | this.handleReplayUrl(); 81 | }, 82 | exitRoomCallback: () => { 83 | this.props.history.push("/"); 84 | }, 85 | rtc: { 86 | type: "agora", 87 | rtcObj: AgoraRTC, 88 | appId: "7276f931285b4f22a9a6f2961b4ec1e2", 89 | recordConfig: { 90 | customerId: "b4e2bc22a89549b2a84969b844258fe3", 91 | customerCertificate: "594daac9c32b491795f8cbd27a7d5265", 92 | }, 93 | }, 94 | identity: identityType, 95 | language: "Chinese", 96 | toolBarPosition: "left", 97 | isManagerOpen: true, 98 | pagePreviewPosition: "right", 99 | boardBackgroundColor: "#F2F2F2", 100 | isReadOnly: false, 101 | defaultColorArray: [ 102 | "#E77345", 103 | "#005BF6", 104 | "#F5AD46", 105 | "#68AB5D", 106 | "#9E51B6", 107 | "#1E2023", 108 | ], 109 | documentArray: [ 110 | { 111 | active: false, 112 | pptType: "dynamic", 113 | id: "1", 114 | data: "[{\"name\":\"1\",\"componentsCount\":1,\"ppt\":{\"height\":720,\"src\":\"pptx://white-cover.oss-cn-hangzhou.aliyuncs.com/dynamicConvert/5c822a0a920b4151be66b6eca3b97a45/1.slide\",\"width\":1280}},{\"name\":\"2\",\"componentsCount\":1,\"ppt\":{\"height\":720,\"src\":\"pptx://white-cover.oss-cn-hangzhou.aliyuncs.com/dynamicConvert/5c822a0a920b4151be66b6eca3b97a45/2.slide\",\"width\":1280}},{\"name\":\"3\",\"componentsCount\":1,\"ppt\":{\"height\":720,\"src\":\"pptx://white-cover.oss-cn-hangzhou.aliyuncs.com/dynamicConvert/5c822a0a920b4151be66b6eca3b97a45/3.slide\",\"width\":1280}},{\"name\":\"4\",\"componentsCount\":1,\"ppt\":{\"height\":720,\"src\":\"pptx://white-cover.oss-cn-hangzhou.aliyuncs.com/dynamicConvert/5c822a0a920b4151be66b6eca3b97a45/4.slide\",\"width\":1280}},{\"name\":\"5\",\"componentsCount\":1,\"ppt\":{\"height\":720,\"src\":\"pptx://white-cover.oss-cn-hangzhou.aliyuncs.com/dynamicConvert/5c822a0a920b4151be66b6eca3b97a45/5.slide\",\"width\":1280}},{\"name\":\"6\",\"componentsCount\":1,\"ppt\":{\"height\":720,\"src\":\"pptx://white-cover.oss-cn-hangzhou.aliyuncs.com/dynamicConvert/5c822a0a920b4151be66b6eca3b97a45/6.slide\",\"width\":1280}},{\"name\":\"7\",\"componentsCount\":1,\"ppt\":{\"height\":720,\"src\":\"pptx://white-cover.oss-cn-hangzhou.aliyuncs.com/dynamicConvert/5c822a0a920b4151be66b6eca3b97a45/7.slide\",\"width\":1280}},{\"name\":\"8\",\"componentsCount\":1,\"ppt\":{\"height\":720,\"src\":\"pptx://white-cover.oss-cn-hangzhou.aliyuncs.com/dynamicConvert/5c822a0a920b4151be66b6eca3b97a45/8.slide\",\"width\":1280}},{\"name\":\"9\",\"componentsCount\":1,\"ppt\":{\"height\":720,\"src\":\"pptx://white-cover.oss-cn-hangzhou.aliyuncs.com/dynamicConvert/5c822a0a920b4151be66b6eca3b97a45/9.slide\",\"width\":1280}},{\"name\":\"10\",\"componentsCount\":1,\"ppt\":{\"height\":720,\"src\":\"pptx://white-cover.oss-cn-hangzhou.aliyuncs.com/dynamicConvert/5c822a0a920b4151be66b6eca3b97a45/10.slide\",\"width\":1280}},{\"name\":\"11\",\"componentsCount\":1,\"ppt\":{\"height\":720,\"src\":\"pptx://white-cover.oss-cn-hangzhou.aliyuncs.com/dynamicConvert/5c822a0a920b4151be66b6eca3b97a45/11.slide\",\"width\":1280}},{\"name\":\"12\",\"componentsCount\":1,\"ppt\":{\"height\":720,\"src\":\"pptx://white-cover.oss-cn-hangzhou.aliyuncs.com/dynamicConvert/5c822a0a920b4151be66b6eca3b97a45/12.slide\",\"width\":1280}},{\"name\":\"13\",\"componentsCount\":1,\"ppt\":{\"height\":720,\"src\":\"pptx://white-cover.oss-cn-hangzhou.aliyuncs.com/dynamicConvert/5c822a0a920b4151be66b6eca3b97a45/13.slide\",\"width\":1280}},{\"name\":\"14\",\"componentsCount\":1,\"ppt\":{\"height\":720,\"src\":\"pptx://white-cover.oss-cn-hangzhou.aliyuncs.com/dynamicConvert/5c822a0a920b4151be66b6eca3b97a45/14.slide\",\"width\":1280}},{\"name\":\"15\",\"componentsCount\":1,\"ppt\":{\"height\":720,\"src\":\"pptx://white-cover.oss-cn-hangzhou.aliyuncs.com/dynamicConvert/5c822a0a920b4151be66b6eca3b97a45/15.slide\",\"width\":1280}},{\"name\":\"16\",\"componentsCount\":1,\"ppt\":{\"height\":720,\"src\":\"pptx://white-cover.oss-cn-hangzhou.aliyuncs.com/dynamicConvert/5c822a0a920b4151be66b6eca3b97a45/16.slide\",\"width\":1280}}]", 115 | }], 116 | }); 117 | } 118 | } 119 | 120 | 121 | public async componentDidMount(): Promise { 122 | await this.startJoinRoom(); 123 | } 124 | 125 | public componentWillUnmount(): void { 126 | if (this.netlessRoom) { 127 | this.netlessRoom.release(); 128 | } 129 | } 130 | 131 | public render(): React.ReactNode { 132 | return ( 133 | 134 | 135 | ); 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /src/assets/image/room_not_find.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | -------------------------------------------------------------------------------- /src/assets/image/netless_black.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | about_page_top_bg1 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | --------------------------------------------------------------------------------