VideoSource
扩展图像源
包含视频的数据源。(见样式规范 有关选项的详细文档。)
Parameters
idstringoptions视频源规范dispatcher调度员eventedParent事件发生
Examples
// add to map
map.addSource('some id', {
type: 'video',
url: [
'http://xxx.mp4',
'https://xxx.webm'
],
coordinates: [
[-76.54, 39.18],
[-76.52, 39.18],
[-76.52, 39.17],
[-76.54, 39.17]
]
});
// update
var mySource = map.getSource('some id');
mySource.setCoordinates([
[-76.54335737228394, 39.18579907229748],
[-76.52803659439087, 39.1838364847587],
[-76.5295386314392, 39.17683392507606],
[-76.54520273208618, 39.17876344106642]
]);
map.removeSource('some id'); // remove
pause
暂停视频。
play
播放视频。
getVideo
返回 HTMLvideo元素。
返回**HTMLVideoElement **HTMLvideo元素。
setCoordinates
设置视频的坐标并重新渲染地图。
返回**[VideoSource][263]**这个
这篇文档有帮助吗?感谢反馈!