dtapi
TypeScript icon, indicating that this package has built-in type declarations

1.11.2 • Public • Published

 

build version publish date

 

Introduction

Documentation

Install

$ npm i dtapi

Import

import DtApi from 'dtapi';

Init

const config = {
    "id": "player", //[required] Render scene container(DOM node id)
    "url": "http://172.31.19.235:8889/Renderers/Any/order", //[optional] Cloud rendering service address
    "order": "b96285A3", //[optional] Rendering order, obtained on the cloud rendering client
    "resolution": [3840,2160], //[optional] Set the cloud rendering output resolution[width, height]
    "debugMode": "normal", //[optional] none: does not print logs, normal: normal logs
    "keyboard": { //[optional] keyboard event
        "normal": false, //[optional] Keyboard event, exclude F1~F12 [default disabled]
        "func": false //[optional] Browser F1 ~ F12 function keys [default disabled]
    }
}

const App = new DtApi(config);

Parameter Reset

const newargs = {
    "url": "Your Server URL",
    "order": "Code",
    "resolution": [3840,2160]
}
App.System.SetOption(newargs)

Starting

App.Renderer.Start().then(res => {
    // TODO res
});

Starting Events

App.Renderer.RegisterEvent([
    {
        name: 'onStopedRenderCloud', func: function () {
            // TODO on StopedRenderCloud
        }
    },
    {
        name: 'onVideoStreamLoaded', func: function () {
            // TODO on Scene Ready
        }
    }
])

Scene Events

App.Renderer.registerSceneEvent([
    {
        name: 'OnWdpSceneIsReady', func: function () {
            // TODO on Scene Ready
        }
    },
    {
        name: 'OnEntityAdded', func: function () {
            // TODO on EntityAdded
        }
    },
    {
        name: 'OnEntityRemoved', func: function () {
            // TODO on EntityRemoved
        }
    },
    {
        name: 'OnEntityClicked', func: function () {
           // TODO on EntityClicked
        }
    },
    {
        name: 'OnWebJSEvent', func: function () {
           // TODO The widnow event receives "WebJSEvent"
        }
    }
])

Stop Rendering

App.Renderer.Stop();

License

Readme

Keywords

Package Sidebar

Install

npm i dtapi

Weekly Downloads

2

Version

1.11.2

License

MIT

Unpacked Size

4.25 MB

Total Files

232

Last publish

Collaborators

  • dtgalaxysupport