Netless

Netless

  • JavaScript
  • Android
  • iOS
  • Server
  • FAQ
  • GitHub
  • 🇨🇳 中文

›Features

Overview

  • Introduction
  • Open source
  • Version history

Quick start

  • Overview
  • Client integration
  • Initialization
  • Create Room
  • Join room

Features

  • Doc-conversion & replay
  • State management
  • Tools
  • Perspective operation
  • Whiteboard operation
  • Custom event
  • Scene management
  • Big class read-only
  • Replay

Upgrade

  • 2.0 v2migration

Doc-conversion & replay

Before reading this article, please read the server-side documentation: Document to Picture, Document to Web Page, and make sure that the corresponding service has been activated in console.

The SDK encapsulates the interaction of the SDK server into a Converter class. Developers do not need to care about the interaction with the SDK server on the client.

Show converted documents

For a pptx document, each page will correspond to a scene on the whiteboard.

A 24 page pptx file will create 24 scenes on a whiteboard. For the concept of the scene, see Scene Management for details.

Converter c = new Converter(this.roomToken);
c.startConvertTask("{pptx url}", Converter.ConvertType.Dynamic, new ConverterCallbacks(){
    @Override
    public void onFailure(ConvertException e) {

    }

    @Override
    public void onFinish(ConvertedFiles ppt, ConversionInfo convertInfo) {
        if (ppt.getScenes() != null) {
            room.putScenes("dynamic", ppt.getScenes(), 0);
            room.setScenePath("dynamic/1");
        }
    }

    @Override
    public void onProgress(Double progress, ConversionInfo convertInfo) {

    }
});

Dynamic PPT playback

You can play the dynamic PPT by calling the following method. After all the animations of the PPT on the current page are completed, when you call this method again, you will automatically enter the next page scene.

room.pptNextStep(); // Next page (Next step)
room.pptPreviousStep(); // Previous page (Previous step)

Custom font

If your pptx contains fonts that are not in our default font list, you can support it by configuring a custom font list. First, you need to upload the font file to your own server or object storage platform. Then, the URL of the font file is configured with the following code when the SDK is initialized.

WhiteSdkConfiguration config = new WhiteSdkConfiguration(DeviceType.touch, 10, 0.1);
HashMap<String, String> map = new HashMap();
map.put("Calibri", "https://your-cdn.com/Calibri.ttf");
map.put("宋体","https://your-cdn.com/Songti.ttf");
map.put("楷体",  "https://your-cdn.com/Kaiti.ttf");
// When initializing the SDK, bring in config
sdkConfiguration.setFont(map);
Last updated on 8/25/2020 by az
← Join roomState management →
  • Show converted documents
  • Dynamic PPT playback
  • Custom font
Netless
Let's interactive.
Product
ConsoleHomepageDemoGithub
Company
Join usServicePrivacy
Contact
support@netless.linkCommunity
Copyright © 2020 Netless