videoOnTerrain

The videoOnTerrain object enables creation of video on terrain objects and provides access to created objects. A video on terrain object plays a video file on a selected position on the terrain. The following members and methods are available:

§  items

§  create()

items

static items : Array.<  TerraExplorerObject >

Returns an array of TerraExplorerObject containing all video on terrain objects in the project.

create

create (description, videoURL, fov, pos, HeadingPitchRange, options) → {Cesium.promise}

Creates a video on terrain object.

Parameters

Name

Type

Description

description

String

The name of the video on terrain object as it appears in the Objects section of the Analysis tab on the sidebar.

videoURL

string

URL of the video file. Only the following types are supported due to HTML5 VIDEO TAG limitations: WebM, MP4, Ogg.

fov

Number

Horizontal field of view, in degrees, covered by the camera. (1-60).

pos

Cesium.Cartesian3

Position of the projector.

HeadingPitchRange

Cesium.HeadingPitchRange

Yaw, pitch and range of the projection.

Options

Object

Name

Type

Description

loop

Boolean

Determines whether the video repeats.

showProjector

Boolean

Determines whether the projector pyramid object is displayed in the 3D Window.

Returns

Cesium.promise - A promise (Cesium.promise) that resolves to the newly created video on terrain TerraExplorerObject object.

Example

The following example creates a video on terrain:

var name = 'Bunny';

var url = 'https://cesiumjs.org/videos/Sandcastle/big-buck-bunny_trailer.mp4';

var fov = 53;

var position = viewer.camera.position.clone();

var heading= viewer.camera.heading;

var pitch = viewer.camera.pitch ;

var range= 200 ;

var headingPitchRange = new Cesium.HeadingPitchRange(heading, pitch, range);

TerraExplorer.objects.videoOnTerrain.create(name, url, fov, position, headingPitchRange, {loop : true, showProjector: true}).then(function(c){setTimeout(function(){c.Pause();},4000)});