deeptwins-engine-3d 0.1.76 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/Build/DeepTwins/Image/noise.png +0 -0
- package/dist/assets/Build/DeepTwins/Workers/CustomRasterClip.worker.js +1 -2
- package/dist/assets/Build/DeepTwins/Workers/MvtVector.worker.js +1 -1
- package/dist/assets/Build/Map3d/ThirdParty/Workers/zip-web-worker.js +640 -0
- package/dist/assets/Build/Map3d/ThirdParty/wasm_splats_bg.wasm +0 -0
- package/dist/assets/Build/Map3d/ThirdParty/zip-module.wasm +0 -0
- package/dist/assets/Build/Map3d/Workers/chunk-27NG6PQR.js +456 -0
- package/dist/assets/Build/Map3d/Workers/chunk-2JVMMMWT.js +353 -0
- package/dist/assets/Build/Map3d/Workers/chunk-2Y2XYQCS.js +1481 -0
- package/dist/assets/Build/Map3d/Workers/chunk-34RF3V5G.js +220 -0
- package/dist/assets/Build/Map3d/Workers/chunk-35H7BYLJ.js +1800 -0
- package/dist/assets/Build/Map3d/Workers/chunk-57OGEF5V.js +435 -0
- package/dist/assets/Build/Map3d/Workers/chunk-5PX3DYJA.js +196 -0
- package/dist/assets/Build/Map3d/Workers/chunk-7B5XGQRN.js +171 -0
- package/dist/assets/Build/Map3d/Workers/chunk-ATLWOZFF.js +39 -0
- package/dist/assets/Build/Map3d/Workers/chunk-BMSUECTA.js +1055 -0
- package/dist/assets/Build/Map3d/Workers/chunk-C6IA4TKW.js +476 -0
- package/dist/assets/Build/Map3d/Workers/chunk-CZ44I32U.js +157 -0
- package/dist/assets/Build/Map3d/Workers/chunk-DE6UV44R.js +122 -0
- package/dist/assets/Build/Map3d/Workers/chunk-DUCCKVOG.js +834 -0
- package/dist/assets/Build/Map3d/Workers/chunk-EBJBPIYX.js +239 -0
- package/dist/assets/Build/Map3d/Workers/chunk-EYSYQ2R6.js +138 -0
- package/dist/assets/Build/Map3d/Workers/chunk-FMCAAUQI.js +368 -0
- package/dist/assets/Build/Map3d/Workers/chunk-GMYZNRRQ.js +2717 -0
- package/dist/assets/Build/Map3d/Workers/chunk-GWPNZZV4.js +781 -0
- package/dist/assets/Build/Map3d/Workers/chunk-HLP2U4KW.js +758 -0
- package/dist/assets/Build/Map3d/Workers/chunk-HSJSUPQV.js +500 -0
- package/dist/assets/Build/Map3d/Workers/chunk-I73Q3AG7.js +58 -0
- package/dist/assets/Build/Map3d/Workers/chunk-IMZ4YIMV.js +511 -0
- package/dist/assets/Build/Map3d/Workers/chunk-IZSK4DVF.js +421 -0
- package/dist/assets/Build/Map3d/Workers/chunk-JKLMRPKK.js +75 -0
- package/dist/assets/Build/Map3d/Workers/chunk-KGM345JM.js +691 -0
- package/dist/assets/Build/Map3d/Workers/chunk-L4IR5U4G.js +102 -0
- package/dist/assets/Build/Map3d/Workers/chunk-MG4EVQH2.js +44 -0
- package/dist/assets/Build/Map3d/Workers/chunk-NXWEFAZJ.js +300 -0
- package/dist/assets/Build/Map3d/Workers/chunk-PDFAJISJ.js +59 -0
- package/dist/assets/Build/Map3d/Workers/chunk-PHWZFJR5.js +100 -0
- package/dist/assets/Build/Map3d/Workers/chunk-PLE7CHBE.js +101 -0
- package/dist/assets/Build/Map3d/Workers/chunk-PN3GIZ5Q.js +163 -0
- package/dist/assets/Build/Map3d/Workers/chunk-PXL5XLHV.js +1073 -0
- package/dist/assets/Build/Map3d/Workers/chunk-QYXOF5JC.js +959 -0
- package/dist/assets/Build/Map3d/Workers/chunk-R2LIFXV3.js +115 -0
- package/dist/assets/Build/Map3d/Workers/chunk-R4W6IRJZ.js +10357 -0
- package/dist/assets/Build/Map3d/Workers/chunk-R5PZXG56.js +1258 -0
- package/dist/assets/Build/Map3d/Workers/chunk-RZQLZIUI.js +629 -0
- package/dist/assets/Build/Map3d/Workers/chunk-SIBDD6Y4.js +390 -0
- package/dist/assets/Build/Map3d/Workers/chunk-U5NN6JTQ.js +398 -0
- package/dist/assets/Build/Map3d/Workers/chunk-UA5RPPP3.js +73 -0
- package/dist/assets/Build/Map3d/Workers/chunk-UXLKFS3C.js +305 -0
- package/dist/assets/Build/Map3d/Workers/chunk-VUX4BQIM.js +37 -0
- package/dist/assets/Build/Map3d/Workers/chunk-WJDUUUJS.js +684 -0
- package/dist/assets/Build/Map3d/Workers/chunk-XBJOJHWX.js +139 -0
- package/dist/assets/Build/Map3d/Workers/chunk-XJDMTNKD.js +634 -0
- package/dist/assets/Build/Map3d/Workers/chunk-XUCXZZE5.js +963 -0
- package/dist/assets/Build/Map3d/Workers/chunk-YIKGVMJ5.js +287 -0
- package/dist/assets/Build/Map3d/Workers/chunk-YTNCIBPQ.js +262 -0
- package/dist/assets/Build/Map3d/Workers/chunk-ZMDUYETO.js +55 -0
- package/dist/assets/Build/Map3d/Workers/chunk-ZW52HXFN.js +2857 -0
- package/dist/esm/analyze/LineOfSightAnalysis.js +1 -326
- package/dist/esm/analyze/SubmergenceAnalysis.js +1 -137
- package/dist/esm/analyze/SunLightAnalysis.js +1 -91
- package/dist/esm/analyze/TerrainExcavationAnalysis.js +1 -612
- package/dist/esm/analyze/ViewshedAnalysis.js +1 -292
- package/dist/esm/cameraControl/ModelRoamHistory.js +1 -639
- package/dist/esm/cameraControl/ModelRoamRealTime.js +1 -874
- package/dist/esm/cameraControl/Roam.js +1 -418
- package/dist/esm/cameraControl/Rotate.js +1 -134
- package/dist/esm/cameraControl/RotateInPlace.js +1 -99
- package/dist/esm/constant.d.ts +90 -0
- package/dist/esm/constant.js +1 -1287
- package/dist/esm/deepTwins/index.js +1 -121
- package/dist/esm/drawCommand/index.js +1 -3
- package/dist/esm/drawCommand/viewShed/Event.js +1 -142
- package/dist/esm/drawCommand/viewShed/RectangularSensorPrimitive.js +1 -1306
- package/dist/esm/drawCommand/viewShed/ViewShadowPrimitive.js +1 -66
- package/dist/esm/drawCommand/viewShed/ViewShedAnalyserLayer.js +1 -466
- package/dist/esm/drawCommand/viewShed/ViewShedMap.js +1 -1238
- package/dist/esm/drawCommand/viewShed/config.js +1 -21
- package/dist/esm/drawCommand/volumeCloud/GeometryPrimitive.js +1 -89
- package/dist/esm/drawCommand/volumeCloud/ImprovedNoise.js +1 -112
- package/dist/esm/drawCommand/volumeCloud/VolumeClouds.js +1 -91
- package/dist/esm/drawer/algorithm.js +1 -314
- package/dist/esm/drawer/common.js +1 -965
- package/dist/esm/drawer/coordinate.js +1 -184
- package/dist/esm/drawer/index.js +1 -688
- package/dist/esm/drawer/plotUtil.js +1 -266
- package/dist/esm/drawer/shape/Assemble.js +1 -415
- package/dist/esm/drawer/shape/AttackArrow.js +1 -442
- package/dist/esm/drawer/shape/BaseShape.js +1 -383
- package/dist/esm/drawer/shape/Bow.js +1 -375
- package/dist/esm/drawer/shape/Circle.js +1 -461
- package/dist/esm/drawer/shape/Curve.js +1 -386
- package/dist/esm/drawer/shape/DragPoint.js +1 -211
- package/dist/esm/drawer/shape/Elliptic.js +1 -491
- package/dist/esm/drawer/shape/Formation.js +1 -395
- package/dist/esm/drawer/shape/PincerArrow.js +1 -445
- package/dist/esm/drawer/shape/Point.js +1 -131
- package/dist/esm/drawer/shape/Polygon.js +1 -368
- package/dist/esm/drawer/shape/Polyline.js +1 -325
- package/dist/esm/drawer/shape/RegularPolygon.js +1 -468
- package/dist/esm/drawer/shape/RightAngleArrow.js +1 -423
- package/dist/esm/drawer/shape/Sector.js +1 -568
- package/dist/esm/drawer/shape/StraightArrow.js +1 -422
- package/dist/esm/drawer/shape/SwallowtailArrow.js +1 -438
- package/dist/esm/drawer/types.js +1 -11
- package/dist/esm/drawer/utils.js +1 -381
- package/dist/esm/global.css +22 -1
- package/dist/esm/graphicLayer/BaseEntity.js +1 -51
- package/dist/esm/graphicLayer/BaseLayer.js +1 -730
- package/dist/esm/graphicLayer/BasePointPrimitive.js +1 -45
- package/dist/esm/graphicLayer/BasePrimitive.js +1 -36
- package/dist/esm/graphicLayer/BasePrimitiveInstance.js +1 -37
- package/dist/esm/graphicLayer/BaseSource.d.ts +1 -1
- package/dist/esm/graphicLayer/BaseSource.js +1 -630
- package/dist/esm/graphicLayer/BillboardEntity.js +1 -106
- package/dist/esm/graphicLayer/BillboardPrimitive.js +1 -119
- package/dist/esm/graphicLayer/BoxEntity.js +1 -99
- package/dist/esm/graphicLayer/BoxPrimitive.js +1 -48
- package/dist/esm/graphicLayer/BoxPrimitiveInstance.js +1 -91
- package/dist/esm/graphicLayer/EllipseEntity.js +1 -110
- package/dist/esm/graphicLayer/EllipsePrimitive.js +1 -47
- package/dist/esm/graphicLayer/EllipsePrimitiveInstance.js +1 -98
- package/dist/esm/graphicLayer/EllipsoidEntity.js +1 -118
- package/dist/esm/graphicLayer/EllipsoidPrimitive.js +1 -48
- package/dist/esm/graphicLayer/EllipsoidPrimitiveInstance.js +1 -113
- package/dist/esm/graphicLayer/GraphicLayerCollection.js +1 -491
- package/dist/esm/graphicLayer/HtmlEntity.d.ts +4 -0
- package/dist/esm/graphicLayer/HtmlEntity.js +1 -189
- package/dist/esm/graphicLayer/LabelEntity.js +1 -110
- package/dist/esm/graphicLayer/LabelPrimitive.js +1 -127
- package/dist/esm/graphicLayer/ModelEntity.js +1 -122
- package/dist/esm/graphicLayer/ModelPrimitive.js +1 -59
- package/dist/esm/graphicLayer/ModelPrimitiveInstance.js +1 -86
- package/dist/esm/graphicLayer/PointEntity.js +1 -94
- package/dist/esm/graphicLayer/PointPrimitive.js +1 -107
- package/dist/esm/graphicLayer/PolygonEntity.js +1 -103
- package/dist/esm/graphicLayer/PolygonGroundPrimitive.js +1 -49
- package/dist/esm/graphicLayer/PolygonGroundPrimitiveImageMaterialInstance.js +1 -87
- package/dist/esm/graphicLayer/PolygonPrimitive.js +1 -60
- package/dist/esm/graphicLayer/PolygonPrimitiveImageMaterialInstance.js +1 -84
- package/dist/esm/graphicLayer/PolygonPrimitiveInstance.js +1 -101
- package/dist/esm/graphicLayer/PolylineEntity.js +1 -96
- package/dist/esm/graphicLayer/PolylineGroundPrimitive.js +1 -55
- package/dist/esm/graphicLayer/PolylineGroundPrimitiveInstance.js +1 -85
- package/dist/esm/graphicLayer/PolylinePrimitive.js +1 -53
- package/dist/esm/graphicLayer/PolylinePrimitiveInstance.js +1 -85
- package/dist/esm/graphicLayer/PolylineVolumeEntity.js +1 -105
- package/dist/esm/graphicLayer/PolylineVolumePrimitive.js +1 -47
- package/dist/esm/graphicLayer/PolylineVolumePrimitiveInstance.js +1 -94
- package/dist/esm/graphicLayer/WallEntity.js +1 -96
- package/dist/esm/graphicLayer/WallPrimitive.js +1 -47
- package/dist/esm/graphicLayer/WallPrimitiveInstance.js +1 -88
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +1 -175
- package/dist/esm/lowAltitude/BarrierLayer.js +1 -172
- package/dist/esm/lowAltitude/BaseGridMvtLayer.js +1 -122
- package/dist/esm/lowAltitude/FactorLayer.js +1 -199
- package/dist/esm/lowAltitude/FlightPlanning.js +1 -411
- package/dist/esm/lowAltitude/FlightRiskEvaluation.js +1 -543
- package/dist/esm/lowAltitude/GridDraw.js +1 -137
- package/dist/esm/lowAltitude/PoiLayer.js +1 -74
- package/dist/esm/lowAltitude/RoutePlanning.js +1 -318
- package/dist/esm/lowAltitude/VisitLayer.js +1 -180
- package/dist/esm/map/Event.js +1 -377
- package/dist/esm/map/GroundSkyBox.js +1 -166
- package/dist/esm/map/Map.js +1 -881
- package/dist/esm/map/Property.js +1 -35
- package/dist/esm/material/AtmosphericDispersion.js +1 -569
- package/dist/esm/material/GlobalVolumetricCloud.js +1 -377
- package/dist/esm/material/VolumeCloud.js +1 -115
- package/dist/esm/material/WeatherEffects.js +1 -351
- package/dist/esm/material/entity/BaseMaterialProperty.js +1 -51
- package/dist/esm/material/entity/CircleWaveMaterialProperty.js +1 -101
- package/dist/esm/material/entity/DynamicWallMaterialProperty.js +1 -101
- package/dist/esm/material/entity/ImageGlowingMaterialProperty.js +1 -89
- package/dist/esm/material/entity/ImageMaterialProperty.js +1 -34
- package/dist/esm/material/entity/PolylineTrailLinkMaterialProperty.js +1 -132
- package/dist/esm/material/primitive/BaseMaterialAppearance.js +1 -28
- package/dist/esm/material/primitive/ImageGlowingMaterialAppearance.js +1 -77
- package/dist/esm/material/primitive/ImageMaterialAppearance.js +1 -77
- package/dist/esm/measure/Area.js +1 -220
- package/dist/esm/measure/BaseDraw.js +1 -105
- package/dist/esm/measure/Distance.js +1 -223
- package/dist/esm/measure/index.js +1 -266
- package/dist/esm/measure/types.js +1 -17
- package/dist/esm/measure/utils.js +1 -319
- package/dist/esm/particle/BaseParticle.js +1 -196
- package/dist/esm/particle/FireParticle.js +1 -65
- package/dist/esm/particle/FountainParticle.js +1 -80
- package/dist/esm/particle/SmokeParticle.js +1 -65
- package/dist/esm/particle/common.js +1 -23
- package/dist/esm/particle/index.js +1 -5
- package/dist/esm/property/PositionProperty.js +1 -56
- package/dist/esm/tileLayer/ArcGisLayer.js +1 -41
- package/dist/esm/tileLayer/CustomRasterClipWorkerClient.js +1 -147
- package/dist/esm/tileLayer/CustomRasterLayer.js +1 -1136
- package/dist/esm/tileLayer/ImageryLayer.js +1 -44
- package/dist/esm/tileLayer/MvtVectorLoad.js +1 -1549
- package/dist/esm/tileLayer/MvtVectorWorkerClient.js +1 -126
- package/dist/esm/tileLayer/RasterLayer.js +1 -23
- package/dist/esm/tileLayer/WmsLayer.js +1 -26
- package/dist/esm/tileLayer/WmtsLayer.js +1 -23
- package/dist/esm/tool/BuildClampedPolygonGrid.js +1 -278
- package/dist/esm/tool/Compass.js +1 -282
- package/dist/esm/tool/PrimitiveCluster.js +1 -706
- package/dist/esm/tool/TimerInterval.js +1 -58
- package/dist/esm/tool/common.js +1 -405
- package/dist/esm/tool/fetch.js +1 -222
- package/dist/esm/tool/heatmap.js +1 -631
- package/dist/esm/tool/utils.d.ts +1 -0
- package/dist/esm/tool/utils.js +1 -501
- package/dist/esm/toolTip/index.js +1 -79
- package/dist/esm/videoFusion/BaseVideo.d.ts +7 -0
- package/dist/esm/videoFusion/BaseVideo.js +1 -330
- package/dist/esm/videoFusion/VideoProject.js +1 -230
- package/dist/esm/videoFusion/VideoTexture.js +1 -163
- package/dist/esm/visualization/BaseHeatmap.js +1 -271
- package/dist/esm/visualization/BoundaryHighlight.d.ts +135 -0
- package/dist/esm/visualization/BoundaryHighlight.js +1 -0
- package/dist/esm/visualization/DynamicWater.js +1 -289
- package/dist/esm/visualization/Frustum.js +1 -248
- package/dist/esm/visualization/Heatmap2d.js +1 -97
- package/dist/esm/visualization/Heatmap3d.js +1 -281
- package/dist/esm/visualization/MigrationEffect.js +1 -397
- package/dist/esm/visualization/PointCluster.js +1 -220
- package/dist/esm/visualization/RadarScan.js +1 -333
- package/dist/esm/visualization/SampledTerrainRiver.d.ts +180 -0
- package/dist/esm/visualization/SampledTerrainRiver.js +1 -0
- package/dist/esm/visualization/SampledTerrainWater.d.ts +170 -0
- package/dist/esm/visualization/SampledTerrainWater.js +1 -0
- package/dist/esm/visualization/WindField.d.ts +72 -0
- package/dist/esm/visualization/WindField.js +1 -0
- package/dist/esm/visualization/windCore.d.ts +161 -0
- package/dist/esm/visualization/windCore.js +8 -0
- package/dist/umd/deeptwins-engine-3d.min.css +1 -1
- package/dist/umd/deeptwins-engine-3d.min.js +1 -1
- package/package.json +6 -4
|
@@ -1,79 +1 @@
|
|
|
1
|
-
function
|
|
2
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
4
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
5
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
-
import * as Cesium from 'deeptwins-cesium';
|
|
9
|
-
import "./index.css";
|
|
10
|
-
|
|
11
|
-
// 跟随鼠标的提示框
|
|
12
|
-
var ToolTip = /*#__PURE__*/function () {
|
|
13
|
-
function ToolTip(map, options) {
|
|
14
|
-
_classCallCheck(this, ToolTip);
|
|
15
|
-
_defineProperty(this, "_mapContext", void 0);
|
|
16
|
-
_defineProperty(this, "tooltip", void 0);
|
|
17
|
-
_defineProperty(this, "_isShow", true);
|
|
18
|
-
_defineProperty(this, "_handleMove", void 0);
|
|
19
|
-
_defineProperty(this, "_handleLeave", void 0);
|
|
20
|
-
this._mapContext = map._mapContext;
|
|
21
|
-
this.tooltip = document.createElement('div');
|
|
22
|
-
this.tooltip.className = 'deepTwins-toolTip';
|
|
23
|
-
map.container.appendChild(this.tooltip);
|
|
24
|
-
this.setOptions(options);
|
|
25
|
-
this._init();
|
|
26
|
-
}
|
|
27
|
-
_createClass(ToolTip, [{
|
|
28
|
-
key: "getMap",
|
|
29
|
-
value: function getMap() {
|
|
30
|
-
return this._mapContext && this._mapContext.getMap();
|
|
31
|
-
}
|
|
32
|
-
}, {
|
|
33
|
-
key: "_init",
|
|
34
|
-
value: function _init() {
|
|
35
|
-
var _this = this;
|
|
36
|
-
var self = this;
|
|
37
|
-
this._handleMove = this.getMap().on(Cesium.ScreenSpaceEventType.MOUSE_MOVE, function (e) {
|
|
38
|
-
if (_this._isShow) {
|
|
39
|
-
var position = e.original.endPosition;
|
|
40
|
-
_this.tooltip.style.left = position.x + 'px';
|
|
41
|
-
_this.tooltip.style.top = position.y + 'px';
|
|
42
|
-
_this.tooltip.style.display = 'block';
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
this._handleLeave = function () {
|
|
46
|
-
_this.tooltip.style.display = 'none';
|
|
47
|
-
};
|
|
48
|
-
this._handleLeave.off = function () {
|
|
49
|
-
self.getMap().scene.canvas.removeEventListener('mouseleave', this);
|
|
50
|
-
};
|
|
51
|
-
this.getMap().scene.canvas.addEventListener('mouseleave', this._handleLeave);
|
|
52
|
-
}
|
|
53
|
-
}, {
|
|
54
|
-
key: "show",
|
|
55
|
-
value: function show(isShow) {
|
|
56
|
-
this._isShow = isShow;
|
|
57
|
-
if (!isShow) {
|
|
58
|
-
this.tooltip.style.display = 'none';
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}, {
|
|
62
|
-
key: "setOptions",
|
|
63
|
-
value: function setOptions(options) {
|
|
64
|
-
var _ref = options || {},
|
|
65
|
-
_ref$text = _ref.text,
|
|
66
|
-
text = _ref$text === void 0 ? '' : _ref$text;
|
|
67
|
-
this.tooltip.innerText = text;
|
|
68
|
-
}
|
|
69
|
-
}, {
|
|
70
|
-
key: "destroy",
|
|
71
|
-
value: function destroy() {
|
|
72
|
-
this.tooltip.remove();
|
|
73
|
-
this._handleMove.off();
|
|
74
|
-
this._handleLeave.off();
|
|
75
|
-
}
|
|
76
|
-
}]);
|
|
77
|
-
return ToolTip;
|
|
78
|
-
}();
|
|
79
|
-
export { ToolTip as default };
|
|
1
|
+
(function(_0x3c95aa,_0x36b3f6){var _0x2fa936=_0x5bd3,_0x296043=_0x3c95aa();while(!![]){try{var _0x23a0ff=-parseInt(_0x2fa936(0x83))/0x1*(-parseInt(_0x2fa936(0x8f))/0x2)+-parseInt(_0x2fa936(0x9b))/0x3+parseInt(_0x2fa936(0x7a))/0x4*(-parseInt(_0x2fa936(0x93))/0x5)+-parseInt(_0x2fa936(0x8b))/0x6+parseInt(_0x2fa936(0x9d))/0x7+parseInt(_0x2fa936(0x94))/0x8+-parseInt(_0x2fa936(0x9f))/0x9*(parseInt(_0x2fa936(0x87))/0xa);if(_0x23a0ff===_0x36b3f6)break;else _0x296043['push'](_0x296043['shift']());}catch(_0x55090d){_0x296043['push'](_0x296043['shift']());}}}(_0x169b,0x3b338));function _typeof(_0x43780e){'@babel/helpers - typeof';var _0x187a04=_0x5bd3;return _typeof=_0x187a04(0x9e)==typeof Symbol&&_0x187a04(0xa2)==typeof Symbol[_0x187a04(0x7b)]?function(_0x4fafa7){return typeof _0x4fafa7;}:function(_0x3a353e){var _0x2ca57d=_0x187a04;return _0x3a353e&&'function'==typeof Symbol&&_0x3a353e['constructor']===Symbol&&_0x3a353e!==Symbol[_0x2ca57d(0x86)]?_0x2ca57d(0xa2):typeof _0x3a353e;},_typeof(_0x43780e);}function _classCallCheck(_0x567e45,_0x465a04){if(!(_0x567e45 instanceof _0x465a04))throw new TypeError('Cannot\x20call\x20a\x20class\x20as\x20a\x20function');}function _defineProperties(_0x431a7e,_0x4e12a6){var _0x2d18c9=_0x5bd3;for(var _0x25beb0=0x0;_0x25beb0<_0x4e12a6[_0x2d18c9(0x97)];_0x25beb0++){var _0x316edb=_0x4e12a6[_0x25beb0];_0x316edb['enumerable']=_0x316edb[_0x2d18c9(0xa0)]||![],_0x316edb['configurable']=!![];if(_0x2d18c9(0x92)in _0x316edb)_0x316edb['writable']=!![];Object[_0x2d18c9(0x78)](_0x431a7e,_toPropertyKey(_0x316edb[_0x2d18c9(0x8e)]),_0x316edb);}}function _createClass(_0x49649b,_0x53aeba,_0x51c342){var _0xc23bb9=_0x5bd3;if(_0x53aeba)_defineProperties(_0x49649b['prototype'],_0x53aeba);if(_0x51c342)_defineProperties(_0x49649b,_0x51c342);return Object['defineProperty'](_0x49649b,_0xc23bb9(0x86),{'writable':![]}),_0x49649b;}function _0x169b(){var _0x42801c=['DMfSDwu','mtvtC2rewfy','mZe5odKWngPqBernqG','y2fSBa','x2LZu2HVDW','BgvUz3rO','C3r5Bgu','C2v0t3b0Aw9UCW','tu9vu0vFtu9wrq','ndiWnde3sfbLDgrf','x2HHBMrSzuXLyxzL','mJmZmZC5m3rvvLHwuW','zNvUy3rPB24','mtH1uvnfwgS','zw51BwvYywjSzq','x2HHBMrSzu1VDMu','C3LTyM9S','zgvMAw5LuhjVCgvYDhK','zgLZCgXHEq','ndaZotjMvgDKtha','AxrLCMf0B3i','x21HCenVBNrLEhq','y2XHC3noyw1L','zgvMyxvSDa','y2fUDMfZ','Dg9VBhrPCa','zgL2','Dg9qCMLTAxrPDMu','mJKYmtnuswTOr1q','BM9Uzq','zw5Kug9ZAxrPB24','ChjVDg90ExbL','mJm0ndy3mhzgBKPuva','z2v0twfW','Aw5UzxjuzxH0','yxbWzw5Kq2HPBgq','mZm1mZG4zuDsALrY','x2LUAxq','zgvLCfr3Aw5ZlxrVB2XuAxa','A2v5','mtrrC2n4wvG','B2jQzwn0','Dgv4Da'];_0x169b=function(){return _0x42801c;};return _0x169b();}function _defineProperty(_0x3bc98e,_0x12638c,_0x498c64){return _0x12638c=_toPropertyKey(_0x12638c),_0x12638c in _0x3bc98e?Object['defineProperty'](_0x3bc98e,_0x12638c,{'value':_0x498c64,'enumerable':!![],'configurable':!![],'writable':!![]}):_0x3bc98e[_0x12638c]=_0x498c64,_0x3bc98e;}function _toPropertyKey(_0x30afa2){var _0x1272bb=_toPrimitive(_0x30afa2,'string');return'symbol'==_typeof(_0x1272bb)?_0x1272bb:String(_0x1272bb);}function _toPrimitive(_0x364219,_0x3c9bb5){var _0x43ba3f=_0x5bd3;if('object'!=_typeof(_0x364219)||!_0x364219)return _0x364219;var _0x105924=_0x364219[Symbol[_0x43ba3f(0x82)]];if(void 0x0!==_0x105924){var _0x44f846=_0x105924[_0x43ba3f(0x95)](_0x364219,_0x3c9bb5||_0x43ba3f(0x7e));if(_0x43ba3f(0x90)!=_typeof(_0x44f846))return _0x44f846;throw new TypeError('@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.');}return('string'===_0x3c9bb5?String:Number)(_0x364219);}function _0x5bd3(_0x1a291e,_0x57061f){_0x1a291e=_0x1a291e-0x78;var _0x169b75=_0x169b();var _0x5bd3d1=_0x169b75[_0x1a291e];if(_0x5bd3['kUggOh']===undefined){var _0x35c32f=function(_0x49e016){var _0x106c9b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x3f83a3='',_0x43780e='';for(var _0x4fafa7=0x0,_0x3a353e,_0x567e45,_0x465a04=0x0;_0x567e45=_0x49e016['charAt'](_0x465a04++);~_0x567e45&&(_0x3a353e=_0x4fafa7%0x4?_0x3a353e*0x40+_0x567e45:_0x567e45,_0x4fafa7++%0x4)?_0x3f83a3+=String['fromCharCode'](0xff&_0x3a353e>>(-0x2*_0x4fafa7&0x6)):0x0){_0x567e45=_0x106c9b['indexOf'](_0x567e45);}for(var _0x431a7e=0x0,_0x4e12a6=_0x3f83a3['length'];_0x431a7e<_0x4e12a6;_0x431a7e++){_0x43780e+='%'+('00'+_0x3f83a3['charCodeAt'](_0x431a7e)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x43780e);};_0x5bd3['NMzOlR']=_0x35c32f,_0x5bd3['JRGyPI']={},_0x5bd3['kUggOh']=!![];}var _0xc9d9f6=_0x169b75[0x0],_0xca0a7d=_0x1a291e+_0xc9d9f6,_0x2f19b8=_0x5bd3['JRGyPI'][_0xca0a7d];return!_0x2f19b8?(_0x5bd3d1=_0x5bd3['NMzOlR'](_0x5bd3d1),_0x5bd3['JRGyPI'][_0xca0a7d]=_0x5bd3d1):_0x5bd3d1=_0x2f19b8,_0x5bd3d1;}import*as _0x3f83a3 from'deeptwins-cesium';import'./index.css';var ToolTip=(function(){var _0x36f7d5=_0x5bd3;function _0x65f2e4(_0x2f7095,_0x498ae1){var _0x2c02ba=_0x5bd3;_classCallCheck(this,_0x65f2e4),_defineProperty(this,_0x2c02ba(0x7c),void 0x0),_defineProperty(this,'tooltip',void 0x0),_defineProperty(this,'_isShow',!![]),_defineProperty(this,_0x2c02ba(0xa1),void 0x0),_defineProperty(this,_0x2c02ba(0x9c),void 0x0),this['_mapContext']=_0x2f7095['_mapContext'],this[_0x2c02ba(0x80)]=document['createElement'](_0x2c02ba(0x81)),this[_0x2c02ba(0x80)][_0x2c02ba(0x7d)]=_0x2c02ba(0x8d),_0x2f7095['container'][_0x2c02ba(0x8a)](this['tooltip']),this[_0x2c02ba(0x99)](_0x498ae1),this[_0x2c02ba(0x8c)]();}return _createClass(_0x65f2e4,[{'key':_0x36f7d5(0x88),'value':function _0x41e8b3(){var _0x105d90=_0x36f7d5;return this['_mapContext']&&this['_mapContext'][_0x105d90(0x88)]();}},{'key':_0x36f7d5(0x8c),'value':function _0x4c8c4b(){var _0x35ca33=_0x36f7d5,_0x234de0=this,_0x1bd8ad=this;this[_0x35ca33(0xa1)]=this['getMap']()['on'](_0x3f83a3['ScreenSpaceEventType'][_0x35ca33(0x9a)],function(_0x2bd064){var _0x48ee85=_0x35ca33;if(_0x234de0[_0x48ee85(0x96)]){var _0x58cd39=_0x2bd064['original'][_0x48ee85(0x85)];_0x234de0['tooltip']['style']['left']=_0x58cd39['x']+'px',_0x234de0[_0x48ee85(0x80)][_0x48ee85(0x98)]['top']=_0x58cd39['y']+'px',_0x234de0[_0x48ee85(0x80)]['style']['display']='block';}}),this[_0x35ca33(0x9c)]=function(){var _0x20f09d=_0x35ca33;_0x234de0[_0x20f09d(0x80)]['style']['display']='none';},this[_0x35ca33(0x9c)]['off']=function(){var _0x3e4049=_0x35ca33;_0x1bd8ad[_0x3e4049(0x88)]()['scene'][_0x3e4049(0x7f)]['removeEventListener']('mouseleave',this);},this[_0x35ca33(0x88)]()['scene']['canvas']['addEventListener']('mouseleave',this[_0x35ca33(0x9c)]);}},{'key':'show','value':function _0x4a318e(_0x28fdb3){var _0x56d7c5=_0x36f7d5;this[_0x56d7c5(0x96)]=_0x28fdb3,!_0x28fdb3&&(this[_0x56d7c5(0x80)][_0x56d7c5(0x98)][_0x56d7c5(0x79)]=_0x56d7c5(0x84));}},{'key':'setOptions','value':function _0x2fef6b(_0x479011){var _0x3763f3=_0x36f7d5,_0x194584=_0x479011||{},_0x41fa7c=_0x194584[_0x3763f3(0x91)],_0x4ac08e=_0x41fa7c===void 0x0?'':_0x41fa7c;this['tooltip'][_0x3763f3(0x89)]=_0x4ac08e;}},{'key':'destroy','value':function _0x14139b(){var _0x42835b=_0x36f7d5;this['tooltip']['remove'](),this[_0x42835b(0xa1)]['off'](),this[_0x42835b(0x9c)]['off']();}}]),_0x65f2e4;}());export{ToolTip as default};
|
|
@@ -11,12 +11,16 @@ export default class BaseVideo {
|
|
|
11
11
|
hls: any;
|
|
12
12
|
private onErrorFun;
|
|
13
13
|
private _maskImage;
|
|
14
|
+
private _frameCanvas;
|
|
15
|
+
private _frameTexture;
|
|
14
16
|
constructor(map: any, options: any);
|
|
15
17
|
getMap(): any;
|
|
16
18
|
_canOperate(): boolean;
|
|
17
19
|
private _init;
|
|
18
20
|
private _initMaskImage;
|
|
19
21
|
_drawCanvas(options: any): HTMLCanvasElement;
|
|
22
|
+
_createFrameTexture(context: any, options: any): any;
|
|
23
|
+
_updateFrameTexture(options: any): void;
|
|
20
24
|
show(isShow: boolean): void;
|
|
21
25
|
play(): void;
|
|
22
26
|
onError(fun: any): void;
|
|
@@ -24,4 +28,7 @@ export default class BaseVideo {
|
|
|
24
28
|
setPlaybackRate(playbackRate?: number): void;
|
|
25
29
|
rePlay(): void;
|
|
26
30
|
destroy(): void;
|
|
31
|
+
private _getFrameCanvas;
|
|
32
|
+
private _canDrawFrame;
|
|
33
|
+
private _isMaskReady;
|
|
27
34
|
}
|
|
@@ -1,330 +1 @@
|
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
4
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
5
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
-
import * as Cesium from 'deeptwins-cesium';
|
|
9
|
-
import Hls from 'hls.js';
|
|
10
|
-
import { merge } from 'lodash';
|
|
11
|
-
import { v4 as uuidv4 } from 'uuid';
|
|
12
|
-
import { DEFAULT_VIDEO_TEXTURE_HLS, DEFAULT_VIDEO_TEXTURE_VIDEO, VIDEO_CONTAINER_ID } from "../constant";
|
|
13
|
-
import * as utils from "../tool/utils";
|
|
14
|
-
|
|
15
|
-
// 视频
|
|
16
|
-
var BaseVideo = /*#__PURE__*/function () {
|
|
17
|
-
function BaseVideo(map, options) {
|
|
18
|
-
_classCallCheck(this, BaseVideo);
|
|
19
|
-
_defineProperty(this, "_mapContext", void 0);
|
|
20
|
-
_defineProperty(this, "options", void 0);
|
|
21
|
-
_defineProperty(this, "videoElement", void 0);
|
|
22
|
-
_defineProperty(this, "videoPolygonLayer", void 0);
|
|
23
|
-
_defineProperty(this, "isDestroyed", false);
|
|
24
|
-
_defineProperty(this, "videoType", '');
|
|
25
|
-
_defineProperty(this, "status", 'PREPARE');
|
|
26
|
-
_defineProperty(this, "synchronizer", null);
|
|
27
|
-
_defineProperty(this, "hls", void 0);
|
|
28
|
-
_defineProperty(this, "onErrorFun", void 0);
|
|
29
|
-
_defineProperty(this, "_maskImage", null);
|
|
30
|
-
this.options = options;
|
|
31
|
-
this._mapContext = map._mapContext;
|
|
32
|
-
if (options.video) {
|
|
33
|
-
this.videoType = 'video';
|
|
34
|
-
}
|
|
35
|
-
if (options.hls) {
|
|
36
|
-
this.videoType = 'hls';
|
|
37
|
-
}
|
|
38
|
-
if (options.custom) {
|
|
39
|
-
this.videoType = 'custom';
|
|
40
|
-
}
|
|
41
|
-
this._init();
|
|
42
|
-
this._initMaskImage();
|
|
43
|
-
}
|
|
44
|
-
_createClass(BaseVideo, [{
|
|
45
|
-
key: "getMap",
|
|
46
|
-
value: function getMap() {
|
|
47
|
-
return this._mapContext && this._mapContext.getMap();
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// 是否能进行操作
|
|
51
|
-
}, {
|
|
52
|
-
key: "_canOperate",
|
|
53
|
-
value: function _canOperate() {
|
|
54
|
-
if (this.isDestroyed) {
|
|
55
|
-
utils.error('video实例已销毁');
|
|
56
|
-
return false;
|
|
57
|
-
}
|
|
58
|
-
return true;
|
|
59
|
-
}
|
|
60
|
-
}, {
|
|
61
|
-
key: "_init",
|
|
62
|
-
value: function _init() {
|
|
63
|
-
var _this$getMap,
|
|
64
|
-
_this = this;
|
|
65
|
-
var videoContainer = (_this$getMap = this.getMap()) === null || _this$getMap === void 0 || (_this$getMap = _this$getMap.container) === null || _this$getMap === void 0 ? void 0 : _this$getMap.querySelector('#' + VIDEO_CONTAINER_ID);
|
|
66
|
-
if (!videoContainer) {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
if (this.videoType === 'video') {
|
|
70
|
-
this.videoElement = document.createElement('video');
|
|
71
|
-
this.videoElement.id = uuidv4();
|
|
72
|
-
var _merge = merge(DEFAULT_VIDEO_TEXTURE_VIDEO(), this.options.video),
|
|
73
|
-
loop = _merge.loop,
|
|
74
|
-
muted = _merge.muted,
|
|
75
|
-
autoPlay = _merge.autoPlay,
|
|
76
|
-
src = _merge.src,
|
|
77
|
-
type = _merge.type,
|
|
78
|
-
width = _merge.width,
|
|
79
|
-
height = _merge.height;
|
|
80
|
-
this.videoElement.width = width;
|
|
81
|
-
this.videoElement.height = height;
|
|
82
|
-
muted && this.videoElement.setAttribute('muted', 'muted');
|
|
83
|
-
autoPlay && this.videoElement.setAttribute('autoplay', 'autoplay');
|
|
84
|
-
loop && this.videoElement.setAttribute('loop', 'loop');
|
|
85
|
-
this.videoElement.setAttribute('crossorigin', '');
|
|
86
|
-
var sourceEl = document.createElement('source');
|
|
87
|
-
sourceEl.src = src;
|
|
88
|
-
sourceEl.type = type;
|
|
89
|
-
this.videoElement.appendChild(sourceEl);
|
|
90
|
-
videoContainer.appendChild(this.videoElement);
|
|
91
|
-
} else if (this.videoType === 'hls') {
|
|
92
|
-
this.videoElement = document.createElement('video');
|
|
93
|
-
this.videoElement.id = uuidv4();
|
|
94
|
-
var _merge2 = merge(DEFAULT_VIDEO_TEXTURE_HLS(), this.options.hls),
|
|
95
|
-
_muted = _merge2.muted,
|
|
96
|
-
_autoPlay = _merge2.autoPlay,
|
|
97
|
-
_src = _merge2.src,
|
|
98
|
-
_width = _merge2.width,
|
|
99
|
-
_height = _merge2.height;
|
|
100
|
-
this.videoElement.width = _width;
|
|
101
|
-
this.videoElement.height = _height;
|
|
102
|
-
_muted && this.videoElement.setAttribute('muted', 'muted');
|
|
103
|
-
_autoPlay && this.videoElement.setAttribute('autoplay', 'autoplay');
|
|
104
|
-
this.videoElement.setAttribute('loop', 'loop');
|
|
105
|
-
this.videoElement.setAttribute('crossorigin', '');
|
|
106
|
-
videoContainer.appendChild(this.videoElement);
|
|
107
|
-
if (Hls.isSupported()) {
|
|
108
|
-
this.hls = new Hls();
|
|
109
|
-
this.hls.loadSource(_src);
|
|
110
|
-
this.hls.attachMedia(this.videoElement);
|
|
111
|
-
this.hls.on(Hls.Events.MANIFEST_PARSED, function () {
|
|
112
|
-
if (_this.status === 'START') {
|
|
113
|
-
_autoPlay && _this.play();
|
|
114
|
-
} else {
|
|
115
|
-
_this.status = 'READY';
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
this.hls.on(Hls.Events.ERROR, function (event, data) {
|
|
119
|
-
console.error('HLS.js 错误:', data);
|
|
120
|
-
_this.onErrorFun && _this.onErrorFun(data);
|
|
121
|
-
});
|
|
122
|
-
} else if (this.videoElement.canPlayType('application/vnd.apple.mpegurl')) {
|
|
123
|
-
this.videoElement.src = _src;
|
|
124
|
-
this.videoElement.addEventListener('loadedmetadata', function () {
|
|
125
|
-
if (_this.status === 'START') {
|
|
126
|
-
_autoPlay && _this.play();
|
|
127
|
-
} else {
|
|
128
|
-
_this.status = 'READY';
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
} else if (this.videoType === 'custom') {
|
|
133
|
-
var element = document.createElement('div');
|
|
134
|
-
element.id = uuidv4();
|
|
135
|
-
var onReady = this.options.custom.onReady;
|
|
136
|
-
videoContainer.appendChild(element);
|
|
137
|
-
if (onReady) {
|
|
138
|
-
this.status = 'READY';
|
|
139
|
-
onReady(element, function (video) {
|
|
140
|
-
_this.videoElement = video;
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
// 添加初始化遮罩图片的方法
|
|
147
|
-
}, {
|
|
148
|
-
key: "_initMaskImage",
|
|
149
|
-
value: function _initMaskImage() {
|
|
150
|
-
if (!this._maskImage) {
|
|
151
|
-
this._maskImage = new Image();
|
|
152
|
-
this._maskImage.src = utils.getDeepTwinsFile('Image/video-mask.png');
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
// 绘制投影
|
|
157
|
-
}, {
|
|
158
|
-
key: "_drawCanvas",
|
|
159
|
-
value: function _drawCanvas(options) {
|
|
160
|
-
var _options$videoOptions = options.videoOptions,
|
|
161
|
-
width = _options$videoOptions.width,
|
|
162
|
-
height = _options$videoOptions.height,
|
|
163
|
-
edgeFeather = options.style.edgeFeather;
|
|
164
|
-
var canvas = document.createElement('canvas');
|
|
165
|
-
canvas.width = width;
|
|
166
|
-
canvas.height = height;
|
|
167
|
-
var ctx = canvas.getContext('2d');
|
|
168
|
-
|
|
169
|
-
// 1. 叠加当前视频帧
|
|
170
|
-
ctx.globalAlpha = 1.0; // 确保视频帧不透明
|
|
171
|
-
ctx.drawImage(this.videoElement, 0, 0, width, height);
|
|
172
|
-
|
|
173
|
-
// 2. 应用羽化遮罩
|
|
174
|
-
if (edgeFeather) {
|
|
175
|
-
ctx.globalCompositeOperation = 'destination-in'; // 使用遮罩影响透明度
|
|
176
|
-
|
|
177
|
-
var maskCanvas = document.createElement('canvas');
|
|
178
|
-
maskCanvas.width = width;
|
|
179
|
-
maskCanvas.height = height;
|
|
180
|
-
var maskCtx = maskCanvas.getContext('2d');
|
|
181
|
-
if (maskCtx && this._maskImage) {
|
|
182
|
-
// 绘制并拉伸遮罩图片到整个画布
|
|
183
|
-
maskCtx.drawImage(this._maskImage, 0, 0, width, height);
|
|
184
|
-
ctx.drawImage(maskCanvas, 0, 0);
|
|
185
|
-
}
|
|
186
|
-
ctx.globalCompositeOperation = 'source-over'; // 还原默认混合模式
|
|
187
|
-
}
|
|
188
|
-
return canvas;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
// 显示隐藏
|
|
192
|
-
}, {
|
|
193
|
-
key: "show",
|
|
194
|
-
value: function show(isShow) {
|
|
195
|
-
if (!this._canOperate()) {
|
|
196
|
-
return;
|
|
197
|
-
}
|
|
198
|
-
this.videoPolygonLayer && this.videoPolygonLayer.show(isShow);
|
|
199
|
-
isShow ? this.play() : this.pause();
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
// 开始播放
|
|
203
|
-
}, {
|
|
204
|
-
key: "play",
|
|
205
|
-
value: function play() {
|
|
206
|
-
var _this2 = this;
|
|
207
|
-
if (!this._canOperate()) {
|
|
208
|
-
return;
|
|
209
|
-
}
|
|
210
|
-
this.status = 'PLAYING';
|
|
211
|
-
if (this.videoType === 'video') {
|
|
212
|
-
var promise = this.videoElement.play();
|
|
213
|
-
if (promise) {
|
|
214
|
-
promise.catch(function (e) {
|
|
215
|
-
console.error(e);
|
|
216
|
-
_this2.pause();
|
|
217
|
-
_this2.onErrorFun && _this2.onErrorFun(e);
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
// 暂停后继续播放
|
|
222
|
-
if (this.synchronizer && this.videoType === 'hls') {
|
|
223
|
-
this.hls.startLoad();
|
|
224
|
-
this.getMap().clock.shouldAnimate = true;
|
|
225
|
-
}
|
|
226
|
-
// 开始播放
|
|
227
|
-
if (!this.synchronizer && this.videoType === 'hls') {
|
|
228
|
-
this.synchronizer = new Cesium.VideoSynchronizer({
|
|
229
|
-
clock: this.getMap().clock,
|
|
230
|
-
element: this.videoElement
|
|
231
|
-
});
|
|
232
|
-
this.getMap().clock.shouldAnimate = true;
|
|
233
|
-
var _promise = this.videoElement.play();
|
|
234
|
-
if (_promise) {
|
|
235
|
-
_promise.catch(function (e) {
|
|
236
|
-
console.error(e);
|
|
237
|
-
_this2.pause();
|
|
238
|
-
_this2.onErrorFun && _this2.onErrorFun(e);
|
|
239
|
-
});
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
if (this.synchronizer && this.videoType === 'custom') {
|
|
243
|
-
this.getMap().clock.shouldAnimate = true;
|
|
244
|
-
}
|
|
245
|
-
if (!this.synchronizer && this.videoType === 'custom') {
|
|
246
|
-
this.synchronizer = new Cesium.VideoSynchronizer({
|
|
247
|
-
clock: this.getMap().clock,
|
|
248
|
-
element: this.videoElement
|
|
249
|
-
});
|
|
250
|
-
this.getMap().clock.shouldAnimate = true;
|
|
251
|
-
}
|
|
252
|
-
this.videoElement.style.display = 'none';
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
// 监听错误
|
|
256
|
-
}, {
|
|
257
|
-
key: "onError",
|
|
258
|
-
value: function onError(fun) {
|
|
259
|
-
this.onErrorFun = fun;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
// 暂停播放
|
|
263
|
-
}, {
|
|
264
|
-
key: "pause",
|
|
265
|
-
value: function pause() {
|
|
266
|
-
if (!this._canOperate()) {
|
|
267
|
-
return;
|
|
268
|
-
}
|
|
269
|
-
this.status = 'PAUSE';
|
|
270
|
-
if (this.videoType === 'hls') {
|
|
271
|
-
this.hls.stopLoad();
|
|
272
|
-
this.getMap().clock.shouldAnimate = false;
|
|
273
|
-
}
|
|
274
|
-
if (this.videoType === 'custom') {
|
|
275
|
-
this.getMap().clock.shouldAnimate = false;
|
|
276
|
-
}
|
|
277
|
-
this.videoElement.pause();
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
// 设置播放速率
|
|
281
|
-
}, {
|
|
282
|
-
key: "setPlaybackRate",
|
|
283
|
-
value: function setPlaybackRate() {
|
|
284
|
-
var playbackRate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
285
|
-
if (!this._canOperate()) {
|
|
286
|
-
return;
|
|
287
|
-
}
|
|
288
|
-
if (this.videoType === 'video') {
|
|
289
|
-
this.videoElement.playbackRate = playbackRate;
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
// 重新播放
|
|
294
|
-
}, {
|
|
295
|
-
key: "rePlay",
|
|
296
|
-
value: function rePlay() {
|
|
297
|
-
if (!this._canOperate()) {
|
|
298
|
-
return;
|
|
299
|
-
}
|
|
300
|
-
if (this.videoType === 'video') {
|
|
301
|
-
this.videoElement.currentTime = 0;
|
|
302
|
-
this.play();
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
// 销毁
|
|
307
|
-
}, {
|
|
308
|
-
key: "destroy",
|
|
309
|
-
value: function destroy() {
|
|
310
|
-
if (!this._canOperate()) {
|
|
311
|
-
return;
|
|
312
|
-
}
|
|
313
|
-
this.status = 'PREPARE';
|
|
314
|
-
this.isDestroyed = true;
|
|
315
|
-
if (this.videoType === 'hls') {
|
|
316
|
-
this.synchronizer && this.synchronizer.destroy();
|
|
317
|
-
this.hls && this.hls.destroy();
|
|
318
|
-
this.getMap().clock.shouldAnimate = false;
|
|
319
|
-
}
|
|
320
|
-
if (this.videoType === 'custom') {
|
|
321
|
-
this.synchronizer && this.synchronizer.destroy();
|
|
322
|
-
this.getMap().clock.shouldAnimate = false;
|
|
323
|
-
}
|
|
324
|
-
this.videoElement.remove();
|
|
325
|
-
this.videoPolygonLayer.remove();
|
|
326
|
-
}
|
|
327
|
-
}]);
|
|
328
|
-
return BaseVideo;
|
|
329
|
-
}();
|
|
330
|
-
export { BaseVideo as default };
|
|
1
|
+
(function(_0x5580a9,_0x2e4ff5){var _0x615411=_0x1d89,_0x36e764=_0x5580a9();while(!![]){try{var _0x55e2d6=parseInt(_0x615411(0x207))/0x1+parseInt(_0x615411(0x22f))/0x2*(-parseInt(_0x615411(0x215))/0x3)+-parseInt(_0x615411(0x1e7))/0x4*(parseInt(_0x615411(0x1e2))/0x5)+parseInt(_0x615411(0x1e4))/0x6+parseInt(_0x615411(0x20c))/0x7+parseInt(_0x615411(0x22b))/0x8+parseInt(_0x615411(0x205))/0x9;if(_0x55e2d6===_0x2e4ff5)break;else _0x36e764['push'](_0x36e764['shift']());}catch(_0x5a8c0f){_0x36e764['push'](_0x36e764['shift']());}}}(_0x3b43,0x967d7));function _typeof(_0x5dd006){'@babel/helpers - typeof';var _0x3711db=_0x1d89;return _typeof=_0x3711db(0x21d)==typeof Symbol&&_0x3711db(0x1ea)==typeof Symbol[_0x3711db(0x234)]?function(_0x1e1cc){return typeof _0x1e1cc;}:function(_0x595c7b){var _0x127aba=_0x3711db;return _0x595c7b&&'function'==typeof Symbol&&_0x595c7b[_0x127aba(0x23d)]===Symbol&&_0x595c7b!==Symbol['prototype']?_0x127aba(0x1ea):typeof _0x595c7b;},_typeof(_0x5dd006);}function _classCallCheck(_0x19a29d,_0x5dc686){if(!(_0x19a29d instanceof _0x5dc686))throw new TypeError('Cannot\x20call\x20a\x20class\x20as\x20a\x20function');}function _defineProperties(_0x5a810b,_0x56bb6f){var _0x5a5e92=_0x1d89;for(var _0x5db7c7=0x0;_0x5db7c7<_0x56bb6f['length'];_0x5db7c7++){var _0x2c11a9=_0x56bb6f[_0x5db7c7];_0x2c11a9['enumerable']=_0x2c11a9[_0x5a5e92(0x1db)]||![],_0x2c11a9['configurable']=!![];if('value'in _0x2c11a9)_0x2c11a9[_0x5a5e92(0x1ef)]=!![];Object['defineProperty'](_0x5a810b,_toPropertyKey(_0x2c11a9['key']),_0x2c11a9);}}function _createClass(_0x2d9001,_0x4974ea,_0x2f4d28){var _0x5e667c=_0x1d89;if(_0x4974ea)_defineProperties(_0x2d9001['prototype'],_0x4974ea);if(_0x2f4d28)_defineProperties(_0x2d9001,_0x2f4d28);return Object[_0x5e667c(0x236)](_0x2d9001,'prototype',{'writable':![]}),_0x2d9001;}function _defineProperty(_0x1845f2,_0x2ffe86,_0x46a7c2){return _0x2ffe86=_toPropertyKey(_0x2ffe86),_0x2ffe86 in _0x1845f2?Object['defineProperty'](_0x1845f2,_0x2ffe86,{'value':_0x46a7c2,'enumerable':!![],'configurable':!![],'writable':!![]}):_0x1845f2[_0x2ffe86]=_0x46a7c2,_0x1845f2;}function _toPropertyKey(_0x4c1c16){var _0x551a93=_0x1d89,_0x466b66=_toPrimitive(_0x4c1c16,_0x551a93(0x223));return _0x551a93(0x1ea)==_typeof(_0x466b66)?_0x466b66:String(_0x466b66);}function _toPrimitive(_0x34f3ab,_0x3893a4){var _0x2f0dc1=_0x1d89;if('object'!=_typeof(_0x34f3ab)||!_0x34f3ab)return _0x34f3ab;var _0x2f5dde=_0x34f3ab[Symbol['toPrimitive']];if(void 0x0!==_0x2f5dde){var _0x3d791a=_0x2f5dde[_0x2f0dc1(0x1df)](_0x34f3ab,_0x3893a4||_0x2f0dc1(0x22c));if(_0x2f0dc1(0x217)!=_typeof(_0x3d791a))return _0x3d791a;throw new TypeError('@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.');}return('string'===_0x3893a4?String:Number)(_0x34f3ab);}import*as _0x3f09b3 from'deeptwins-cesium';import _0x127bb2 from'hls.js';import{merge}from'lodash';import{v4 as _0x575398}from'uuid';import{DEFAULT_VIDEO_TEXTURE_HLS,DEFAULT_VIDEO_TEXTURE_VIDEO,VIDEO_CONTAINER_ID}from'../constant';import*as _0x19538d from'../tool/utils';function _0x3b43(){var _0x3794f6=['yxr0ywnOtwvKAwe','mZiWmZvZCw1etgS','z2v0q29UDgv4Da','ntm0ntm1ogT5vMfQuq','x21HCenVBNrLEhq','vgv4DhvYzvDYyxa','mJG4tLjirK91','Bg9HzgvKBwv0ywrHDge','Bg9VCa','C3LTyM9S','vMLKzw9tEw5JAhjVBML6zxi','Axnezxn0CM95zwq','x2nHBKrYyxDgCMfTzq','C3rHDhvZ','D3jPDgfIBgu','B3b0Aw9UCW','B25fCNjVCKz1BG','zxjYB3i','DhLWzq','rxzLBNrZ','x3vWzgf0zuzYyw1Lvgv4DhvYzq','AgXZ','y2XLyxjszwn0','y2f0y2G','C3r5Bgu','DMLKzw9pChrPB25Z','DMLKzw9qB2X5z29Utgf5zxi','yxbWzw5Kq2HPBgq','ueXbwuLorW','Bxv0zwq','DMLKzw9izwLNAhq','zMXVB3i','C2HVDW','DMLKzw8','AgvPz2H0','yxbWBgLJyxrPB24VDM5KlMfWCgXLlM1WzwD1CMW','mZaWntaWmvvYzhfsqG','Cgf1C2u','nZm4nti0zxDAAury','u1rbuLq','z2v0twfW','u2fTCgXLCG','y3jVC3nVCMLNAw4','mtuWnJa1z0TxqxnP','zgL2','zgvZDhjVEq','x2rYyxDdyw52yxm','y3vYCMvUDfrPBwu','sefwrv9dvvjsru5ux0rbvee','DMLKzw9fBgvTzw50','C3jJ','C3rVCeXVywq','mtyYnJnVzMjqt00','y3jLyxrLrwXLBwvUDa','B2jQzwn0','yxv0B1bSyxK','D2LKDgG','DMLKzw9uExbL','y3vZDg9T','CMvTB3zL','zNvUy3rPB24','x2zYyw1Lq2fUDMfZ','x2nHBK9WzxjHDgu','x2DLDezYyw1Lq2fUDMfZ','C2v0qxr0CMLIDxrL','BMf0DxjHBfDPzhrO','C3rYAw5N','x2zYyw1Lvgv4DhvYzq','sw1Hz2uVDMLKzw8TBwfZAY5WBMC','z2XVyMfSq29TCg9ZAxrLt3bLCMf0Aw9U','AxntDxbWB3j0zwq','x21HC2TjBwfNzq','y2XVy2S','yxv0B3bSyxK','mti4nJyXnMfuzNrQsW','zgvMyxvSDa','C3LUy2HYB25PEMvY','zwrNzuzLyxrOzxi','mZK0A1r5BML5','BgvUz3rO','C2HVDwXKqw5PBwf0zq','ywrKrxzLBNrmAxn0zw5LCG','uKDcqq','AxrLCMf0B3i','uKvbrfK','zgvMAw5LuhjVCgvYDhK','vgv4DhvYzq','CgXHEq','B25szwfKEq','Bwf4','ugL4zwXgB3jTyxq','CMvHzhLtDgf0zq','y29UC3rYDwn0B3i','x2LUAxrnyxnRsw1Hz2u','zw51BwvYywjSzq','x2LUAxq','q0XbtvbFve9Frurhrq','y2fUugXHEvr5Cgu','y2fSBa','CgXHEwjHy2TsyxrL'];_0x3b43=function(){return _0x3794f6;};return _0x3b43();}var BaseVideo=(function(){var _0x7b4468=_0x1d89;function _0x24e144(_0x299b06,_0x43a0b5){var _0x5f71be=_0x1d89;_classCallCheck(this,_0x24e144),_defineProperty(this,_0x5f71be(0x1e5),void 0x0),_defineProperty(this,_0x5f71be(0x1f0),void 0x0),_defineProperty(this,'videoElement',void 0x0),_defineProperty(this,_0x5f71be(0x1fb),void 0x0),_defineProperty(this,_0x5f71be(0x1ec),![]),_defineProperty(this,_0x5f71be(0x21a),''),_defineProperty(this,'status','PREPARE'),_defineProperty(this,'synchronizer',null),_defineProperty(this,'hls',void 0x0),_defineProperty(this,'onErrorFun',void 0x0),_defineProperty(this,_0x5f71be(0x228),null),_defineProperty(this,_0x5f71be(0x21e),null),_defineProperty(this,'_frameTexture',null),this[_0x5f71be(0x1f0)]=_0x43a0b5,this[_0x5f71be(0x1e5)]=_0x299b06[_0x5f71be(0x1e5)],_0x43a0b5[_0x5f71be(0x202)]&&(this['videoType']='video'),_0x43a0b5['hls']&&(this['videoType']=_0x5f71be(0x1f6)),_0x43a0b5[_0x5f71be(0x21b)]&&(this['videoType']='custom'),this[_0x5f71be(0x1dc)](),this[_0x5f71be(0x23e)]();}return _createClass(_0x24e144,[{'key':'getMap','value':function _0x2182b7(){return this['_mapContext']&&this['_mapContext']['getMap']();}},{'key':'_canOperate','value':function _0x4b1e1b(){var _0x1ab38a=_0x1d89;if(this[_0x1ab38a(0x1ec)])return _0x19538d[_0x1ab38a(0x1f2)]('video实例已销毁'),![];return!![];}},{'key':'_init','value':function _0xe798e4(){var _0x53241e=_0x1d89,_0x554d72,_0x157b74=this,_0x20a45f=(_0x554d72=this[_0x53241e(0x209)]())===null||_0x554d72===void 0x0||(_0x554d72=_0x554d72['container'])===null||_0x554d72===void 0x0?void 0x0:_0x554d72['querySelector']('#'+VIDEO_CONTAINER_ID);if(!_0x20a45f)return;if(this[_0x53241e(0x21a)]===_0x53241e(0x202)){this['videoElement']=document['createElement'](_0x53241e(0x202)),this['videoElement']['id']=_0x575398();var _0x517c54=merge(DEFAULT_VIDEO_TEXTURE_VIDEO(),this[_0x53241e(0x1f0)][_0x53241e(0x202)]),_0xea5aa8=_0x517c54[_0x53241e(0x1e9)],_0x4bc646=_0x517c54['muted'],_0x113285=_0x517c54[_0x53241e(0x218)],_0x3c8220=_0x517c54[_0x53241e(0x213)],_0x33450b=_0x517c54[_0x53241e(0x1f3)],_0x47a98b=_0x517c54['width'],_0x372d5e=_0x517c54[_0x53241e(0x203)];this['videoElement'][_0x53241e(0x219)]=_0x47a98b,this[_0x53241e(0x212)][_0x53241e(0x203)]=_0x372d5e,_0x4bc646&&this[_0x53241e(0x212)]['setAttribute'](_0x53241e(0x1fe),'muted'),_0x113285&&this[_0x53241e(0x212)]['setAttribute'](_0x53241e(0x22a),_0x53241e(0x22a)),_0xea5aa8&&this['videoElement'][_0x53241e(0x221)]('loop',_0x53241e(0x1e9)),this[_0x53241e(0x212)][_0x53241e(0x221)]('crossorigin','');var _0x2e7557=document['createElement']('source');_0x2e7557['src']=_0x3c8220,_0x2e7557['type']=_0x33450b,this['videoElement'][_0x53241e(0x1fc)](_0x2e7557),_0x20a45f['appendChild'](this[_0x53241e(0x212)]);}else{if(this['videoType']==='hls'){this[_0x53241e(0x212)]=document[_0x53241e(0x216)]('video'),this['videoElement']['id']=_0x575398();var _0x18b80=merge(DEFAULT_VIDEO_TEXTURE_HLS(),this['options'][_0x53241e(0x1f6)]),_0x6b5495=_0x18b80[_0x53241e(0x1fe)],_0xfb739b=_0x18b80['autoPlay'],_0x86790b=_0x18b80[_0x53241e(0x213)],_0xe526d9=_0x18b80['width'],_0x340284=_0x18b80['height'];this[_0x53241e(0x212)][_0x53241e(0x219)]=_0xe526d9,this['videoElement'][_0x53241e(0x203)]=_0x340284,_0x6b5495&&this[_0x53241e(0x212)]['setAttribute']('muted',_0x53241e(0x1fe)),_0xfb739b&&this[_0x53241e(0x212)]['setAttribute'](_0x53241e(0x22a),_0x53241e(0x22a)),this['videoElement'][_0x53241e(0x221)]('loop',_0x53241e(0x1e9)),this[_0x53241e(0x212)][_0x53241e(0x221)](_0x53241e(0x20b),''),_0x20a45f[_0x53241e(0x1fc)](this[_0x53241e(0x212)]);if(_0x127bb2[_0x53241e(0x227)]())this['hls']=new _0x127bb2(),this['hls']['loadSource'](_0x86790b),this['hls'][_0x53241e(0x1e1)](this[_0x53241e(0x212)]),this['hls']['on'](_0x127bb2[_0x53241e(0x1f4)]['MANIFEST_PARSED'],function(){var _0x449cd0=_0x53241e;_0x157b74['status']===_0x449cd0(0x208)?_0xfb739b&&_0x157b74[_0x449cd0(0x238)]():_0x157b74['status']=_0x449cd0(0x235);}),this[_0x53241e(0x1f6)]['on'](_0x127bb2[_0x53241e(0x1f4)]['ERROR'],function(_0x5e3304,_0x339bf0){var _0x5cd462=_0x53241e;console[_0x5cd462(0x1f2)]('HLS.js\x20错误:',_0x339bf0),_0x157b74['onErrorFun']&&_0x157b74[_0x5cd462(0x1f1)](_0x339bf0);});else this['videoElement'][_0x53241e(0x1de)](_0x53241e(0x204))&&(this[_0x53241e(0x212)][_0x53241e(0x213)]=_0x86790b,this[_0x53241e(0x212)][_0x53241e(0x232)](_0x53241e(0x1e8),function(){var _0x14c8b0=_0x53241e;_0x157b74['status']===_0x14c8b0(0x208)?_0xfb739b&&_0x157b74['play']():_0x157b74[_0x14c8b0(0x1ee)]=_0x14c8b0(0x235);}));}else{if(this[_0x53241e(0x21a)]===_0x53241e(0x21b)){var _0x19dc3f=document[_0x53241e(0x216)](_0x53241e(0x20d));_0x19dc3f['id']=_0x575398();var _0x54ebe8=this['options'][_0x53241e(0x21b)][_0x53241e(0x239)];_0x20a45f[_0x53241e(0x1fc)](_0x19dc3f),_0x54ebe8&&(this['status']='READY',_0x54ebe8(_0x19dc3f,function(_0x4e9465){var _0x4a2465=_0x53241e;_0x157b74[_0x4a2465(0x212)]=_0x4e9465;}));}}}}},{'key':'_initMaskImage','value':function _0x1087ca(){var _0x3a622a=_0x1d89;!this['_maskImage']&&(this[_0x3a622a(0x228)]=new Image(),this[_0x3a622a(0x228)][_0x3a622a(0x213)]=_0x19538d['getDeepTwinsFile'](_0x3a622a(0x225)));}},{'key':_0x7b4468(0x20f),'value':function _0x3c9a72(_0x241d83){var _0x41319e=_0x7b4468,_0x35f2ba=_0x241d83[_0x41319e(0x1fa)],_0x5e9282=_0x35f2ba['width'],_0x465182=_0x35f2ba[_0x41319e(0x203)],_0x5d9adc=_0x241d83['style'][_0x41319e(0x22e)],_0x160b57=this['_getFrameCanvas'](_0x5e9282,_0x465182),_0x258440=_0x160b57[_0x41319e(0x1e3)]('2d');if(!_0x258440)return _0x160b57;_0x258440[_0x41319e(0x1f7)](0x0,0x0,_0x160b57['width'],_0x160b57[_0x41319e(0x203)]);if(this['_canDrawFrame']())try{_0x258440['globalAlpha']=0x1,_0x258440['drawImage'](this[_0x41319e(0x212)],0x0,0x0,_0x160b57[_0x41319e(0x219)],_0x160b57[_0x41319e(0x203)]);}catch(_0x30e563){this['onErrorFun']&&this[_0x41319e(0x1f1)](_0x30e563);}return _0x5d9adc&&this['_isMaskReady']()&&(_0x258440[_0x41319e(0x226)]='destination-in',_0x258440['drawImage'](this['_maskImage'],0x0,0x0,_0x160b57['width'],_0x160b57[_0x41319e(0x203)]),_0x258440['globalCompositeOperation']='source-over'),_0x160b57;}},{'key':'_createFrameTexture','value':function _0x16ee76(_0x2b0100,_0x442a59){var _0x713e12=_0x7b4468,_0x1e0ebf=this[_0x713e12(0x20f)](_0x442a59);return this['_frameTexture']=new _0x3f09b3[(_0x713e12(0x237))]({'context':_0x2b0100,'source':_0x1e0ebf,'pixelFormat':_0x3f09b3[_0x713e12(0x23b)][_0x713e12(0x233)],'pixelDatatype':_0x3f09b3['PixelDatatype']['UNSIGNED_BYTE'],'sampler':new _0x3f09b3[(_0x713e12(0x20a))]({'wrapS':_0x3f09b3[_0x713e12(0x1e6)]['CLAMP_TO_EDGE'],'wrapT':_0x3f09b3[_0x713e12(0x1e6)][_0x713e12(0x1dd)],'minificationFilter':_0x3f09b3['TextureMinificationFilter']['LINEAR'],'magnificationFilter':_0x3f09b3['TextureMagnificationFilter']['LINEAR']})}),this['_frameTexture'];}},{'key':_0x7b4468(0x1f5),'value':function _0xc86d1f(_0x3358f1){var _0xf4d416=_0x7b4468,_0x3560ab,_0xd4896;if(!this['_frameTexture']||(_0x3560ab=(_0xd4896=this[_0xf4d416(0x224)])[_0xf4d416(0x1ec)])!==null&&_0x3560ab!==void 0x0&&_0x3560ab[_0xf4d416(0x1df)](_0xd4896))return;this['_frameTexture']['copyFrom']({'source':this['_drawCanvas'](_0x3358f1)});}},{'key':_0x7b4468(0x201),'value':function _0x2ce862(_0x200434){var _0x2e2f82=_0x7b4468;if(!this['_canOperate']())return;this['videoPolygonLayer']&&this[_0x2e2f82(0x1fb)][_0x2e2f82(0x201)](_0x200434),_0x200434?this[_0x2e2f82(0x238)]():this[_0x2e2f82(0x206)]();}},{'key':_0x7b4468(0x238),'value':function _0x31ec15(){var _0x2b6b0d=_0x7b4468,_0x4256ec=this;if(!this['_canOperate']())return;this[_0x2b6b0d(0x1ee)]=_0x2b6b0d(0x1fd);if(this['videoType']==='video'){var _0x40c20b=this[_0x2b6b0d(0x212)][_0x2b6b0d(0x238)]();_0x40c20b&&_0x40c20b[_0x2b6b0d(0x1f8)](function(_0x3883f3){var _0x45e71c=_0x2b6b0d;console[_0x45e71c(0x1f2)](_0x3883f3),_0x4256ec['pause'](),_0x4256ec['onErrorFun']&&_0x4256ec[_0x45e71c(0x1f1)](_0x3883f3);});}this['synchronizer']&&this[_0x2b6b0d(0x21a)]===_0x2b6b0d(0x1f6)&&(this[_0x2b6b0d(0x1f6)]['startLoad'](),this['getMap']()[_0x2b6b0d(0x229)][_0x2b6b0d(0x231)]=!![]);if(!this[_0x2b6b0d(0x22d)]&&this['videoType']===_0x2b6b0d(0x1f6)){this[_0x2b6b0d(0x22d)]=new _0x3f09b3[(_0x2b6b0d(0x1eb))]({'clock':this['getMap']()[_0x2b6b0d(0x229)],'element':this['videoElement']}),this[_0x2b6b0d(0x209)]()['clock']['shouldAnimate']=!![];var _0x1a4f74=this['videoElement']['play']();_0x1a4f74&&_0x1a4f74[_0x2b6b0d(0x1f8)](function(_0x5e97a9){var _0x433795=_0x2b6b0d;console['error'](_0x5e97a9),_0x4256ec['pause'](),_0x4256ec[_0x433795(0x1f1)]&&_0x4256ec['onErrorFun'](_0x5e97a9);});}this[_0x2b6b0d(0x22d)]&&this[_0x2b6b0d(0x21a)]===_0x2b6b0d(0x21b)&&(this[_0x2b6b0d(0x209)]()[_0x2b6b0d(0x229)][_0x2b6b0d(0x231)]=!![]),!this['synchronizer']&&this['videoType']==='custom'&&(this[_0x2b6b0d(0x22d)]=new _0x3f09b3['VideoSynchronizer']({'clock':this['getMap']()[_0x2b6b0d(0x229)],'element':this[_0x2b6b0d(0x212)]}),this[_0x2b6b0d(0x209)]()[_0x2b6b0d(0x229)]['shouldAnimate']=!![]),this[_0x2b6b0d(0x212)]&&(this[_0x2b6b0d(0x212)][_0x2b6b0d(0x1f9)]['display']='none');}},{'key':'onError','value':function _0x366319(_0x57f1b7){this['onErrorFun']=_0x57f1b7;}},{'key':'pause','value':function _0x11e236(){var _0x1b30b0=_0x7b4468,_0x20affa,_0x2b9607;if(!this['_canOperate']())return;this['status']='PAUSE',this[_0x1b30b0(0x21a)]===_0x1b30b0(0x1f6)&&(this['hls'][_0x1b30b0(0x214)](),this[_0x1b30b0(0x209)]()['clock']['shouldAnimate']=![]),this['videoType']==='custom'&&(this[_0x1b30b0(0x209)]()[_0x1b30b0(0x229)]['shouldAnimate']=![]),(_0x20affa=this[_0x1b30b0(0x212)])===null||_0x20affa===void 0x0||(_0x2b9607=_0x20affa[_0x1b30b0(0x206)])===null||_0x2b9607===void 0x0||_0x2b9607[_0x1b30b0(0x1df)](_0x20affa);}},{'key':'setPlaybackRate','value':function _0x33eb89(){var _0x24f5d4=_0x7b4468,_0x10da02=arguments[_0x24f5d4(0x230)]>0x0&&arguments[0x0]!==undefined?arguments[0x0]:0x1;if(!this[_0x24f5d4(0x21f)]())return;this['videoType']==='video'&&(this['videoElement'][_0x24f5d4(0x1e0)]=_0x10da02);}},{'key':'rePlay','value':function _0x29a951(){var _0x400120=_0x7b4468;if(!this['_canOperate']())return;this['videoType']===_0x400120(0x202)&&(this[_0x400120(0x212)][_0x400120(0x210)]=0x0,this['play']());}},{'key':'destroy','value':function _0x6e80b6(){var _0x3eb220=_0x7b4468,_0x1658a2,_0x5c87c5,_0x37262f,_0x398369;if(!this[_0x3eb220(0x21f)]())return;this['status']='PREPARE',this['isDestroyed']=!![],this[_0x3eb220(0x21a)]==='hls'&&(this['synchronizer']&&this[_0x3eb220(0x22d)][_0x3eb220(0x20e)](),this[_0x3eb220(0x1f6)]&&this['hls'][_0x3eb220(0x20e)](),this['getMap']()['clock']['shouldAnimate']=![]),this[_0x3eb220(0x21a)]==='custom'&&(this['synchronizer']&&this['synchronizer']['destroy'](),this[_0x3eb220(0x209)]()[_0x3eb220(0x229)]['shouldAnimate']=![]),(_0x1658a2=this['videoElement'])===null||_0x1658a2===void 0x0||(_0x5c87c5=_0x1658a2[_0x3eb220(0x21c)])===null||_0x5c87c5===void 0x0||_0x5c87c5['call'](_0x1658a2),(_0x37262f=this['videoPolygonLayer'])===null||_0x37262f===void 0x0||(_0x398369=_0x37262f['remove'])===null||_0x398369===void 0x0||_0x398369['call'](_0x37262f),this[_0x3eb220(0x21e)]=null,this[_0x3eb220(0x224)]=null;}},{'key':_0x7b4468(0x220),'value':function _0x3c8026(_0x1b966c,_0x17987f){var _0x1f5864=_0x7b4468,_0x53ca04=Math[_0x1f5864(0x23a)](0x1,Math[_0x1f5864(0x200)](Number(_0x1b966c)||0x1)),_0x2ea119=Math['max'](0x1,Math['floor'](Number(_0x17987f)||0x1));return!this['_frameCanvas']&&(this['_frameCanvas']=document['createElement']('canvas')),(this['_frameCanvas']['width']!==_0x53ca04||this['_frameCanvas'][_0x1f5864(0x203)]!==_0x2ea119)&&(this['_frameCanvas']['width']=_0x53ca04,this[_0x1f5864(0x21e)]['height']=_0x2ea119),this[_0x1f5864(0x21e)];}},{'key':_0x7b4468(0x1ed),'value':function _0x39c2b3(){var _0x2f1bee=_0x7b4468;if(!this['videoElement'])return![];if(this[_0x2f1bee(0x212)]instanceof HTMLCanvasElement)return this['videoElement'][_0x2f1bee(0x219)]>0x0&&this[_0x2f1bee(0x212)]['height']>0x0;if(this[_0x2f1bee(0x212)]instanceof HTMLVideoElement)return this[_0x2f1bee(0x212)][_0x2f1bee(0x23c)]>=this[_0x2f1bee(0x212)][_0x2f1bee(0x211)]&&this[_0x2f1bee(0x212)]['videoWidth']>0x0&&this['videoElement'][_0x2f1bee(0x1ff)]>0x0;return!![];}},{'key':'_isMaskReady','value':function _0x2794fd(){var _0x2e3929=_0x7b4468;return!!(this[_0x2e3929(0x228)]&&this[_0x2e3929(0x228)]['complete']&&this[_0x2e3929(0x228)][_0x2e3929(0x222)]>0x0);}}]),_0x24e144;}());function _0x1d89(_0x4cdb1e,_0x3f9377){_0x4cdb1e=_0x4cdb1e-0x1db;var _0x3b43de=_0x3b43();var _0x1d8999=_0x3b43de[_0x4cdb1e];if(_0x1d89['CGokqJ']===undefined){var _0x4985ae=function(_0x538bc5){var _0x537499='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x3f09b3='',_0x127bb2='';for(var _0x575398=0x0,_0x19538d,_0x5dd006,_0x1e1cc=0x0;_0x5dd006=_0x538bc5['charAt'](_0x1e1cc++);~_0x5dd006&&(_0x19538d=_0x575398%0x4?_0x19538d*0x40+_0x5dd006:_0x5dd006,_0x575398++%0x4)?_0x3f09b3+=String['fromCharCode'](0xff&_0x19538d>>(-0x2*_0x575398&0x6)):0x0){_0x5dd006=_0x537499['indexOf'](_0x5dd006);}for(var _0x595c7b=0x0,_0x19a29d=_0x3f09b3['length'];_0x595c7b<_0x19a29d;_0x595c7b++){_0x127bb2+='%'+('00'+_0x3f09b3['charCodeAt'](_0x595c7b)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x127bb2);};_0x1d89['XCopzB']=_0x4985ae,_0x1d89['UqJNhu']={},_0x1d89['CGokqJ']=!![];}var _0x553639=_0x3b43de[0x0],_0x4b4e31=_0x4cdb1e+_0x553639,_0x271340=_0x1d89['UqJNhu'][_0x4b4e31];return!_0x271340?(_0x1d8999=_0x1d89['XCopzB'](_0x1d8999),_0x1d89['UqJNhu'][_0x4b4e31]=_0x1d8999):_0x1d8999=_0x271340,_0x1d8999;}export{BaseVideo as default};
|