This sample demonstrates how to add a video element to a MediaLayer in a 3D SceneView. MediaLayer is used to display static images and videos on the map by specifying their geographic locations using extent and rotation or the corner points of the bounding box.
The video in the sample was downloaded from the NASA Scientific Visualization Studio website. This video follows sea salt, dust, and smoke from Aug 14 to Aug 23, 2017, to reveal how these particles are transported across the map. Please refer to this page for the complete video and for more information about this video.
In this sample, the video element is created by setting the VideoElement's video property to point to the URL address of the video file. Its geographic location is set by setting the extent of the video element.
// create a video element by setting video param to point to the video file url
// set the geographic location of the video file on the map using an extent
const element = new VideoElement({
video:
"https://arcgis.github.io/arcgis-samples-javascript/sample-data/media-layer/videos/hurricanes_aerosol-aug.mp4",
georeference: new ExtentAndRotationGeoreference({
extent: new Extent({
xmin: -150,
ymin: 1,
xmax: 20,
ymax: 80,
spatialReference: {
wkid: 4326
}
})
})
});
Once the video element is created, it is added to the MediaLayer's source.
// add the video element to the media layer
const layer = new MediaLayer({
source: [element],
title: "2017 Hurricanes and Aerosols Simulation",
copyright: "NASA's Goddard Space Flight Center"
});