# JSVideoObject

> Create a API with Module.createVideoObject.

```javascript
var object = Module.createVideoObject("ID");
```

## Properties

| Name     | Type                                                                                        | Description                                                  |
| -------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------ |
| isplayer | boolean                                                                                     | Whether the video is currently playing.                      |
| key      | string                                                                                      | Object key value.                                            |
| tilt     | number                                                                                      | Viewing angle.                                               |
| far      | number                                                                                      | Maximum visibility distance.                                 |
| pan      | number                                                                                      | Viewing direction.                                           |
| bank     | number                                                                                      | Video tilt.                                                  |
| fovX     | number                                                                                      | Field of view width.                                         |
| fovY     | number                                                                                      | Field of view height.                                        |
| alpha    | number                                                                                      | Video transparency value.                                    |
| axisX    | boolean                                                                                     | Horizontal flip.                                             |
| axisY    | boolean                                                                                     | Vertical flip.                                               |
| position | [JSVector3D](https://egiscorp.gitbook.io/xdworld_global_manual/introduce-1/core/jsvector3d) | Object location coordinates (longitude, latitude, altitude). |
| zoom     | number                                                                                      | Video scale.                                                 |
| distance | number                                                                                      | Distance between the camera and the object.                  |

## Function

### createVideo(option) → string

> Creates a video object.

{% tabs %}
{% tab title="Information" %}

| Name     | Type                                                                                        | Description                                                  |
| -------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------ |
| url      | string                                                                                      | Media URL path.                                              |
| position | [JSVector3D](https://egiscorp.gitbook.io/xdworld_global_manual/introduce-1/core/jsvector3d) | Object location coordinates (longitude, latitude, altitude). |
| pan      | number                                                                                      | Viewing direction.                                           |
| tilt     | number                                                                                      | Viewing angle.                                               |
| far      | number                                                                                      | Maximum visibility distance.                                 |
| bank     | number                                                                                      | Video tilt.                                                  |
| zoom     | number                                                                                      | Video scale.                                                 |
| fov      | number                                                                                      | Video field of view setting.                                 |
| render   | function                                                                                    | Render callback function setting.                            |
| xaxis    | boolean                                                                                     | Horizontal flip setting.                                     |
| yaxis    | boolean                                                                                     | Vertical flip setting.                                       |

* Return
  * success: Texture creation success.
  * In case of object creation failure
  * null: If no object is created.
  * url tag isn't exist: If the url tag is missing.
  * position tag isn't exist: If the position tag is missing.
  * pan tag isn't exist: If the pan tag is missing.
  * tilt tag isn't exist: If the tilt tag is missing.
  * far tag isn't exist: If the far tag is missing.
  * fov tag isn't exist: If the fov tag is missing.
* Sample
  * Refer to function createVideoFrustum.
  * [Sandbox\_Video Object](https://sandbox.egiscloud.com/code/main.do?id=object_video)
    {% endtab %}

{% tab title="Template" %}

```javascript
```

{% endtab %}
{% endtabs %}

### setTexture(option) → string

> Changes the texture of a video object.

{% tabs %}
{% tab title="Information" %}

| Name          | Type    | Description                        |
| ------------- | ------- | ---------------------------------- |
| size          | number  | Video size (width, height).        |
| data          | array   | Array of video frame pixel values. |
| objectmapping | boolean | Whether to visualize on buildings. |

* Return
  * success: Texture creation success.
  * In case of texture creation failure
  * null: If no object is created.
  * object is null: If the object is not registered.
  * size tag isn't exist: If the size tag is missing.
  * imagedata tag isn't exist: If the imagedata tag is missing.
  * texture is't exist: If the texture is not created properly.
* Sample
  * Refer to function createVideos.
  * [Sandbox\_Video Object](https://sandbox.egiscloud.com/code/main.do?id=object_video)
    {% endtab %}

{% tab title="Template" %}

```javascript
```

{% endtab %}
{% endtabs %}

### clearTexture() → boolean

> Initializes the video object.

{% tabs %}
{% tab title="Information" %}

* Return
  * true: If initialization is successful.
  * false: If initialization fails.
  * If no object is created.
  * If there is no video data.
  * If there is no video path.
* Sample
  * Refer to function clearCCTV.
  * [Sandbox\_Video Object](https://sandbox.egiscloud.com/code/main.do?id=object_video)
    {% endtab %}

{% tab title="Template" %}

```javascript
```

{% endtab %}
{% endtabs %}
