MediaLayer with video

Explore in the sandboxView live

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.

Use dark colors for code blocksCopy
                                                                                                                                       
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
          // 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.

Use dark colors for code blocksCopy
                                                                                                                                       
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
          // 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"
          });

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.