Post

ECMAScript Object and Function Definitions

ECMAScript Object and Function Definitions

Overview

There are a fixed set of objects in ECMAScript, each of which have a fixed set of properties (i.e. values) and methods (i.e. functions). For all object types except Math, there are functions to create an instance of the object. The supported set of objects are:

See Also

X3DCanvasElement

The X3DCanvasElement, <x3d-canvas>, is the main element that displays the X3D content. It defines some functions to be used with this object.

Instance Creation Method(s)

An <x3d-canvas> can be created with the document.createElement function to get a reference to an X3DCanvasElement.

1
const canvas = document .createElement ("x3d-canvas")

Attributes

The X3DCanvasElement defines several attributes that are documented here.

Properties

browser: X3DBrowser

A reference to the X3DBrowser object that is associated with this element. This property is read only.

Methods

captureStream (frameRate?: number): MediaStream

See HTMLCanvasElement.captureStream().

toBlob (callback: (blob: Blob) => void, type?: string, quality?: number): void

See HTMLCanvasElement.toBlob().

toDataURL (type?: string, encoderOptions?: number): string

See HTMLCanvasElement.toDataURL().

X3D Object

See Accessing the External Browser for properties and methods of the X3D object.

This post is licensed under CC BY 4.0 by the author.