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()
static items : Array.< TerraExplorerObject >
Returns an array of TerraExplorerObject containing all video on terrain objects in the project.
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 |
Position of the projector. |
||||||||||
HeadingPitchRange |
Yaw, pitch and range of the projection. |
||||||||||
Options |
Object |
|
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)});