Code Monkey home page Code Monkey logo

whiteboard-demo's Introduction

whiteboard-demo

本项目目前已经处于停止维护状态,接入请使用 fastboard,体验请访问 flat

whiteboard

Experience address:https://demo.netless.link/

简体中文

1. Applicable developers

  • A web developer who is engaged in the development of online education software, online meetings, and remote collaboration software, and wants to quickly implant an interactive whiteboard in a short time.
  • Have a certain TypeScript, React coding or reading foundation.
  • If you want to develop components for the second time, you need to install lerna to start.

2. Advantage

The whole process is componentized. If you are not picky about the component's UI, you can just use the code in the whiteboard folder in the project. If you want to change the style of the component, you can customize the component under the premise of understanding the role of lerna and reading DEV_README.md.

3. Precautions

It is not safe for all Tokens in the demo to be hard-coded on the front end. It is recommended to have a server to call after the production environment.

4. Simply start the project

Simply starting a project means to directly apply the component code style in the project, and only write the "glue" code by yourself.

4.1 Get the SDK Token of Netless Whiteboard

  1. Register a Netless account

    Console

  2. Get AppIdentifier

    Console -> Application management -> Click copy

  3. Get SDK Token

    Console -> Application management -> Configuration -> Click copy

  4. Complete the configuration, fill in the configuration file

    .env.example file name is changed to .env

    APPIDENTIFIER=283/VGixxxxxx2HJg // Whiteboard APPIDENTIFIER
    SDKTOKEN=NETLESSSDK_YWs9eDRxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxRkNTIyYjMwMmIyZGRj // Whiteboard SDKTOKEN
  5. Safety Precautions

    After going online, this Token It is recommended to maintain it in the backend

4.2 Get Alibaba Cloud's AK SK (optional)

The process of synchronizing rich media such as videos and pictures on the whiteboard does not directly transmit these large-volume data through long connections, but uploads it to Alibaba Cloud's cloud storage and synchronizes the url address returned by the cloud storage. Under the premise that the developer understands that what is synchronized is the address, he should be able to figure out the basic elements required for the configuration of OSS during debugging:

  1. For local debugging, we did not configure the proxy at the packaging layer, so cross-domain access should be enabled.

  2. Shared reading is allowed, and can be changed to support various anti-theft links after going online.

  3. You can upload by yourself (Needless to say, see the OSS documentation)

  4. Debug configuration reference https://developer.netless.link/docs/faq/oss-config/

  5. Complete the configuration, fill in the configuration file

    .env.example file name is changed to .env

    AK=LTAI4xxxxxxxxxxuDmu
    SK=ycdfrOxxxxxxxxxxxxxxxxxxWqsy
    OSSREGION=oss-cn-hangzhou
    BUCKET=bxxxxxxxgs
    FOLDER=testxxxxx
    PREFIX=https://bxxxxxxxgs.oss-cn-hangzhou.aliyuncs.com/
  6. If you don't want to configure cloud storage, please comment out the following code and run it directly. But you cannot use the core functions such as uploading pictures, audio and video, PPT, etc.

     <ToolBox room={room} customerComponent={
            [
                <OssUploadButton oss={ossConfigObj}
                     room={room}
                     whiteboardRef={whiteboardLayerDownRef}/>,
                <PluginCenter oss={ossConfigObj}
                      room={room}/>
            ]
    }/>
    
    // changed to
    <ToolBox room={room}/>
  7. Safety Precautions

    After going online, this Config It is recommended to maintain it in the backend

4.3 Startup project

# Access to the whiteboard folder
cd whiteboard
# Load dependencies
pnpm install
# Startup project
pnpm dev
# Packaged project
pnpm build

5. Component secondary development

We assume that the developers who need secondary development are deep players and need to be familiar with some front-end engineering and component-related tools.

  • yarn or npm
  • lerna (There is a simple way to run it below, please search and learn by yourself for detailed usage)

5.1 Component introduction

The advantage of using lerna management is: the common functions of the componentized whiteboard are convenient to use, maintain and manage. The following briefly lists the core components, and introduces their functions and styles.

5.1.1 Whiteboard proprietary controls

全部控件位置

  • @netless/tool-box

    • Toolbar: control the switching of teaching aids of the whiteboard and the management of the color and thickness of the teaching aids
  • @netless/redo-undo

    • Undo redo
  • @netless/page-controller

    • Pagination control: display the total number of pages, the current page, the previous page, the next page, the first page, and the last page.
  • @netless/zoom-controller

    • Zoom in and out control: zoom in, zoom out, current percentage, return to initial size and position
  • @netless/preview-controller

    • Multi-page preview control: preview page content, insert blank page, delete page

    • Preview the details page

      预览图

  • @netless/cursor-tool

    • Cursor tool: support cursor position display, cursor teaching aid status, cursor operator name display
  • @netless/docs-center

    • Document Center: Manage the courseware materials uploaded in the whiteboard room, such as: PPT, PDF, WORD, PPTX

    • Document Center Preview

      docs-center

  • @netless/oss-upload-button

    • Upload management button: upload pictures, courseware
  • @netless/white-video-plugin

    • Video plug-in: Support uploading video, which is used for injection during initialization.
  • @netless/white-audio-plugin

    • Audio plug-in: Support audio plug-in, used to inject during initialization.
  • @netless/plugin-center

    • Plug-in whiteboard plug-in management center: manage the display of plug-ins, used to upload videos using api.

5.1.2 Common controls

  • @netless/fetch-middleware
    • Network request middleware: has the function of setting request timeout error report
  • @netless/loading-bar
    • Progress bar: upload to oss for display
  • @netless/menu-box
    • Sidebar component with animation: used in document center and preview management

5.2 Start project build

# STEP 1
pnpm -r install
# STEP 2
pnpm -r build:lib
# STEP 3
pnpm --filter "whiteboard" build

5.3 Introduction to common commands(out-dated)

# Install global lerna
yarn global add lerna
# or npm install
npm install lerna -g

# Separate yarn
yarn

# lerna Ready to work
lerna bootstrap

# Start hot update of all scripts
lerna run --parallel dev

# Yarn build command to build all libraries
lerna run build

# Run only the yarn dev script of toolbox
lerna run --scope `lib-name` dev
# lerna run --parallel  --scope @netless/toolbox --scope whiteboard dev

# Run run dev scripts except tool-box
lerna run --ignore @netless/tool-box dev

# build all libraries
lerna run --parallel build:lib

whiteboard-demo's People

Contributors

a1528zhang avatar alwaysmavs avatar blackhole1 avatar cheerego7 avatar crimx avatar haoran965 avatar hyrious avatar l1shen avatar leavesster avatar moskize91 avatar tripletre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

whiteboard-demo's Issues

小程序观看白板?

请问一下,老师在pc端白板授课,学生在小程序观看白板讲课,通过你们提供的服务能否实现?

Use independently

  1. Is it available as an npm package
  2. Can it be used independently without the whole sdk...Just want a whiteboard connected to my own socket.io instance
  3. Some parts on the toolbar are in chinese

iOS14.6打开白板失败

我在使用white-web-sdk这个库打包了二次开发的js包,提供给webview使用,在Android里面表现正常,在iOS14.5以及以下表现正常,但是在iOS14.6中(已测试两台设备),第一次打开正常,第二次后面都会超时失败。

反复进行调试发现,浏览器加载完white-web-sdk(打包为bundle.js)后,会加载一次blob请求(看不到white-web-sdk的源代码具体位置),失败的原因是因为这一次请求超时,而无法完成白板的加载,麻烦检查一下原因。

B132B56D-DAF9-4B15-A6F6-0789550BB56F

float bar is disloated in RTL mode

I am using the whiteboard in RTL mode but when I use selector and select any element especially image or text in which float bar is included then the floating bar is not displaying it seems like it is positioned somewhere else.
In LTR mode it is working fine.
Could you please suggest how can I fix this?

无法播放

image

为什么这个项目跑起来之后,上传音频之后,鼠标放上去,无法点击播放,还是选择、拖动状态

上传mp3播放时主播端和观众端进度不同

主播端:win10 chrome / electron
观众端:win10 edge/electron android
"white-web-sdk": "2.11.6"
在demo.netless.link上可以复现,
上传mp3后,暂停播放双方的进度会一致,但是开始播放就又会错开数十秒
这可能是什么原因?
image

請問什麼原因會造成白板流量激增導致 crash 的問題?

從4/8開始
陸續發生流量激增導致白板 crash 這個問題
觀看上課錄影也都跟之前沒什麼異常
想詢問看看所謂流量激增
是指針對白板的行為
還是有什麼其他可能
之前都沒遇過
目前使用的版本"white-react-sdk": "2.16.10"
我會先嘗試升級到 2.16.15 看看狀況

Whiteboard camera scaling issue

I want to to use whiteboard with fixed width and height. So I can take screenshot in fixed size always. Here I can use cameraBound option when joining the room and it is working fine. But issue happening when I am scaling down (Zoom out) the camera using moveCamera method, then it allows more space on both sides. After that when zoom in again, we cant access that space, drag tool also not able to scroll to that space. So, Without zoom out user will not able to know what is drawn on that space. Please suggest what should I do ?

Project is crashed.

By running the command
yarn dev
It throws the errors.
image

And can you please explain how to set all env content?
image

启动命令报错

按照您的readme操作作完后到了本地启动的一步,但是报错是start命令找不到。
D:\公司文件\uniApp\myBoard\react-whiteboard\whiteboard>yarn start yarn run v1.22.5 warning package.json: No license field error Command "start" not found. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this comm and.

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.