MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / add

Method add

src/mapboxgl/mapping/layers/VideoMapLayer.js:30–48  ·  view source on GitHub ↗

* @function VideoMapLayer.prototype.add * @description 添加视频图层。 * @param {string} address - 视频地址。

(address)

Source from the content-addressed store, hash-verified

28 * @param {string} address - 视频地址。
29 */
30 add(address) {
31 this.address = address;
32 if (!this.address) {
33 return;
34 }
35 this.renderer = new VideoLayerRenderer({ url: this.address, id: this.id, loop: this.loop, autoplay: this.autoplay });
36 this.video = this.renderer.createVideo();
37 this.videoDomId = this.renderer.getVideoDomId();
38 this.video.one('firstplay', () => {
39 if (this.autoplay) {
40 this.play();
41 }
42 });
43 this.video.one('canplay', () => {
44 this.videoWidth = this.video.videoWidth();
45 this.videoHeight = this.video.videoHeight();
46 this._addVideoLayer(this.map);
47 });
48 }
49
50 _createVideoElement() {
51 let video = document.createElement('video');

Callers

nothing calls this directly

Calls 5

playMethod · 0.95
_addVideoLayerMethod · 0.95
createVideoMethod · 0.80
getVideoDomIdMethod · 0.80
oneMethod · 0.80

Tested by

no test coverage detected