@anov/3d-ability 0.0.140 → 0.0.142
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/business/Animation/motion/index.js +35 -56
- package/dist/business/Animation/motion/index.js.map +1 -1
- package/dist/business/Animation/type.js +2 -2
- package/dist/business/Area/Fence/FenceBase.js +146 -187
- package/dist/business/Area/Fence/FenceBase.js.map +1 -1
- package/dist/business/Area/Fence/fence_base_01.js +120 -112
- package/dist/business/Area/Fence/fence_base_01.js.map +1 -1
- package/dist/business/Area/Fence/fence_feeting_01.js +218 -130
- package/dist/business/Area/Fence/fence_feeting_01.js.map +1 -1
- package/dist/business/Area/Fence/fence_roll_01.js +140 -130
- package/dist/business/Area/Fence/fence_roll_01.js.map +1 -1
- package/dist/business/Area/FillArea/FillAreaBase.js +87 -126
- package/dist/business/Area/FillArea/FillAreaBase.js.map +1 -1
- package/dist/business/Area/FillArea/fillArea_face_01.js +72 -98
- package/dist/business/Area/FillArea/fillArea_face_01.js.map +1 -1
- package/dist/business/Area/FillArea/fillArea_line_01.js +66 -94
- package/dist/business/Area/FillArea/fillArea_line_01.js.map +1 -1
- package/dist/business/Area/index.js +267 -483
- package/dist/business/Area/index.js.map +1 -1
- package/dist/business/Area/tool.js +14 -26
- package/dist/business/Area/tool.js.map +1 -1
- package/dist/business/Base/ObjectLayer.js +21 -46
- package/dist/business/Base/ObjectLayer.js.map +1 -1
- package/dist/business/Batch/index.js +189 -234
- package/dist/business/Batch/index.js.map +1 -1
- package/dist/business/Box/index.js +52 -81
- package/dist/business/Box/index.js.map +1 -1
- package/dist/business/Cylinder/index.js +51 -79
- package/dist/business/Cylinder/index.js.map +1 -1
- package/dist/business/Flyline/bubble/CircleBubble.js +1 -9
- package/dist/business/Flyline/bubble/CircleBubble.js.map +1 -1
- package/dist/business/Flyline/bubble/index.js +7 -21
- package/dist/business/Flyline/bubble/index.js.map +1 -1
- package/dist/business/Flyline/index.js +96 -162
- package/dist/business/Flyline/index.js.map +1 -1
- package/dist/business/Flyline/line/ArcLine.js +208 -291
- package/dist/business/Flyline/line/ArcLine.js.map +1 -1
- package/dist/business/Flyline/line/index.js +8 -22
- package/dist/business/Flyline/line/index.js.map +1 -1
- package/dist/business/HeatMap/HeatMap.js +380 -467
- package/dist/business/HeatMap/HeatMap.js.map +1 -1
- package/dist/business/HeatMap/core.js +405 -525
- package/dist/business/HeatMap/core.js.map +1 -1
- package/dist/business/HeatMap/shader.js +69 -3
- package/dist/business/HeatMap/shader.js.map +1 -1
- package/dist/business/InfoPanel/index.js +201 -242
- package/dist/business/InfoPanel/index.js.map +1 -1
- package/dist/business/Line/index.js +55 -88
- package/dist/business/Line/index.js.map +1 -1
- package/dist/business/Mark/KeyframeAnimation.js +145 -176
- package/dist/business/Mark/KeyframeAnimation.js.map +1 -1
- package/dist/business/Mark/index.js +196 -294
- package/dist/business/Mark/index.js.map +1 -1
- package/dist/business/Mark/shader/tanhao.js +36 -3
- package/dist/business/Mark/shader/tanhao.js.map +1 -1
- package/dist/business/Mark/type.js +1 -1
- package/dist/business/MaterialSwitch/MaterialSwitchSystem.js +377 -551
- package/dist/business/MaterialSwitch/MaterialSwitchSystem.js.map +1 -1
- package/dist/business/MaterialSwitch/inject.js +92 -58
- package/dist/business/MaterialSwitch/inject.js.map +1 -1
- package/dist/business/MaterialSwitch/shader/finalFade.js +74 -2
- package/dist/business/MaterialSwitch/shader/finalFade.js.map +1 -1
- package/dist/business/MaterialSwitch/shader/ground.js +95 -16
- package/dist/business/MaterialSwitch/shader/ground.js.map +1 -1
- package/dist/business/MaterialSwitch/shader/groundBase64.js +9 -3
- package/dist/business/MaterialSwitch/shader/groundBase64.js.map +1 -1
- package/dist/business/MaterialSwitch/shader/realFade.js +48 -9
- package/dist/business/MaterialSwitch/shader/realFade.js.map +1 -1
- package/dist/business/Plane/index.js +51 -78
- package/dist/business/Plane/index.js.map +1 -1
- package/dist/business/Poi/index.d.ts +5 -0
- package/dist/business/Poi/index.js +256 -295
- package/dist/business/Poi/index.js.map +1 -1
- package/dist/business/Poi/link/Cylinder.js +56 -89
- package/dist/business/Poi/link/Cylinder.js.map +1 -1
- package/dist/business/Poi/link/Pyramid.js +104 -165
- package/dist/business/Poi/link/Pyramid.js.map +1 -1
- package/dist/business/Poi/link/index.d.ts +1 -1
- package/dist/business/Poi/link/index.js +54 -114
- package/dist/business/Poi/link/index.js.map +1 -1
- package/dist/business/Poi/panel/index.d.ts +124 -0
- package/dist/business/Poi/panel/index.js +474 -0
- package/dist/business/Poi/panel/index.js.map +1 -0
- package/dist/business/Poi/panel/interfaces.d.ts +67 -0
- package/dist/business/Poi/panel/interfaces.js +2 -0
- package/dist/business/Poi/panel/interfaces.js.map +1 -0
- package/dist/business/Poi/panel/utils.d.ts +72 -0
- package/dist/business/Poi/panel/utils.js +126 -0
- package/dist/business/Poi/panel/utils.js.map +1 -0
- package/dist/business/Poi/particle/DoubleCircle.js +71 -107
- package/dist/business/Poi/particle/DoubleCircle.js.map +1 -1
- package/dist/business/Poi/particle/DynamicCircle.js +75 -111
- package/dist/business/Poi/particle/DynamicCircle.js.map +1 -1
- package/dist/business/Poi/particle/SingleCircle.js +62 -98
- package/dist/business/Poi/particle/SingleCircle.js.map +1 -1
- package/dist/business/Poi/particle/index.js +49 -117
- package/dist/business/Poi/particle/index.js.map +1 -1
- package/dist/business/Poi/shader/circle.js +31 -3
- package/dist/business/Poi/shader/circle.js.map +1 -1
- package/dist/business/Poi/shader/cylinder.js +37 -3
- package/dist/business/Poi/shader/cylinder.js.map +1 -1
- package/dist/business/Poi/shader/doubleCircle.js +55 -3
- package/dist/business/Poi/shader/doubleCircle.js.map +1 -1
- package/dist/business/Poi/shader/dynamicCircle.js +67 -3
- package/dist/business/Poi/shader/dynamicCircle.js.map +1 -1
- package/dist/business/Poi/title/Border.js +7 -27
- package/dist/business/Poi/title/Border.js.map +1 -1
- package/dist/business/Poi/title/Ellipse.js +7 -27
- package/dist/business/Poi/title/Ellipse.js.map +1 -1
- package/dist/business/Poi/title/index.js +208 -292
- package/dist/business/Poi/title/index.js.map +1 -1
- package/dist/business/Poi/tools.js +22 -19
- package/dist/business/Poi/tools.js.map +1 -1
- package/dist/business/Poi/types.d.ts +3 -0
- package/dist/business/Poi/types.js.map +1 -1
- package/dist/business/Sphere/index.js +47 -72
- package/dist/business/Sphere/index.js.map +1 -1
- package/dist/business/Spline/index.js +190 -245
- package/dist/business/Spline/index.js.map +1 -1
- package/dist/business/SplitBuilding/index.js +327 -536
- package/dist/business/SplitBuilding/index.js.map +1 -1
- package/dist/business/SplitBuilding/type.js +2 -2
- package/dist/business/TrafficComponents/RealismTraffic/RealismTraffic.js +218 -275
- package/dist/business/TrafficComponents/RealismTraffic/RealismTraffic.js.map +1 -1
- package/dist/business/TrafficComponents/StreamerTraffic/StreamerTraffic.js +132 -177
- package/dist/business/TrafficComponents/StreamerTraffic/StreamerTraffic.js.map +1 -1
- package/dist/business/TrafficComponents/StreamerTraffic/fragmentShader.js +51 -1
- package/dist/business/TrafficComponents/StreamerTraffic/fragmentShader.js.map +1 -1
- package/dist/business/TrafficComponents/StreamerTraffic/vertexShader.js +6 -1
- package/dist/business/TrafficComponents/StreamerTraffic/vertexShader.js.map +1 -1
- package/dist/business/TrafficComponents/base.js +32 -55
- package/dist/business/TrafficComponents/base.js.map +1 -1
- package/dist/business/TrafficComponents/utils.d.ts +1 -1
- package/dist/business/TrafficComponents/utils.js +26 -25
- package/dist/business/TrafficComponents/utils.js.map +1 -1
- package/dist/business/Utils/Curve.js +40 -56
- package/dist/business/Utils/Curve.js.map +1 -1
- package/dist/business/Utils/constant.js +1 -1
- package/dist/business/Utils/constant.js.map +1 -1
- package/dist/business/Utils/defineProps.js +13 -14
- package/dist/business/Utils/defineProps.js.map +1 -1
- package/dist/business/Utils/round-curve.js +127 -153
- package/dist/business/Utils/round-curve.js.map +1 -1
- package/dist/business/VideoPanel/index.js +258 -319
- package/dist/business/VideoPanel/index.js.map +1 -1
- package/dist/business/Water/index.js +78 -108
- package/dist/business/Water/index.js.map +1 -1
- package/dist/business/Water/types.js +1 -1
- package/dist/business/Water/types.js.map +1 -1
- package/dist/core/Camera/PerspectiveCamera/CameraExpand.js +383 -449
- package/dist/core/Camera/PerspectiveCamera/CameraExpand.js.map +1 -1
- package/dist/core/Camera/PerspectiveCamera/FollowOrbitControls.js +107 -142
- package/dist/core/Camera/PerspectiveCamera/FollowOrbitControls.js.map +1 -1
- package/dist/core/Controls/FirstViewControl/index.js +84 -96
- package/dist/core/Controls/FirstViewControl/index.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/action/input.js +77 -98
- package/dist/core/Controls/ThirdViewControl/action/input.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/config/constants.js +1 -1
- package/dist/core/Controls/ThirdViewControl/config/constants.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/index.js +19 -28
- package/dist/core/Controls/ThirdViewControl/index.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/player/animation.js +126 -155
- package/dist/core/Controls/ThirdViewControl/player/animation.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/player/camera.js +47 -63
- package/dist/core/Controls/ThirdViewControl/player/camera.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/player/control.js +39 -49
- package/dist/core/Controls/ThirdViewControl/player/control.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/player.js +66 -91
- package/dist/core/Controls/ThirdViewControl/player.js.map +1 -1
- package/dist/core/Controls/base.js +14 -30
- package/dist/core/Controls/base.js.map +1 -1
- package/dist/core/Curve/RoundedCornersCurve/RoundedCornersCurve.js +92 -131
- package/dist/core/Curve/RoundedCornersCurve/RoundedCornersCurve.js.map +1 -1
- package/dist/core/Debug/PerformanceInfo/Performance.js +22 -47
- package/dist/core/Debug/PerformanceInfo/Performance.js.map +1 -1
- package/dist/core/Light/PointLight/PointLightExt.js +4 -21
- package/dist/core/Light/PointLight/PointLightExt.js.map +1 -1
- package/dist/core/Material/FinirMaterial/FinirMaterial.js +37 -57
- package/dist/core/Material/FinirMaterial/FinirMaterial.js.map +1 -1
- package/dist/core/Material/PristineGridMaterial/PristineGridMaterial.js +116 -153
- package/dist/core/Material/PristineGridMaterial/PristineGridMaterial.js.map +1 -1
- package/dist/core/Material/PristineGridMaterial/shader/fragment.js +95 -1
- package/dist/core/Material/PristineGridMaterial/shader/fragment.js.map +1 -1
- package/dist/core/Material/PristineGridMaterial/shader/vertex.js +26 -1
- package/dist/core/Material/PristineGridMaterial/shader/vertex.js.map +1 -1
- package/dist/core/Material/SurfaceMaterial/index.js +76 -172
- package/dist/core/Material/SurfaceMaterial/index.js.map +1 -1
- package/dist/core/Material/decorators.js +6 -11
- package/dist/core/Material/decorators.js.map +1 -1
- package/dist/core/PostEffects/addACESFilmicToneMappingPass.js +16 -12
- package/dist/core/PostEffects/addACESFilmicToneMappingPass.js.map +1 -1
- package/dist/core/PostEffects/addBrightnessContrastPass.js +17 -13
- package/dist/core/PostEffects/addBrightnessContrastPass.js.map +1 -1
- package/dist/core/PostEffects/bloomPass.js +17 -10
- package/dist/core/PostEffects/bloomPass.js.map +1 -1
- package/dist/core/PostEffects/bloomSelect.js +60 -43
- package/dist/core/PostEffects/bloomSelect.js.map +1 -1
- package/dist/core/PostEffects/colorifyPass.js +17 -13
- package/dist/core/PostEffects/colorifyPass.js.map +1 -1
- package/dist/core/PostEffects/index.js +28 -22
- package/dist/core/PostEffects/index.js.map +1 -1
- package/dist/core/PostEffects/outlinePass.js +37 -50
- package/dist/core/PostEffects/outlinePass.js.map +1 -1
- package/dist/core/PostEffects/postprocessing.js +14 -12
- package/dist/core/PostEffects/postprocessing.js.map +1 -1
- package/dist/core/PostEffects/saoPass.js +15 -10
- package/dist/core/PostEffects/saoPass.js.map +1 -1
- package/dist/core/PostEffects/shader/colorify.js +22 -3
- package/dist/core/PostEffects/shader/colorify.js.map +1 -1
- package/dist/core/PostEffects/shader/gammaCorrectionShader.js +27 -3
- package/dist/core/PostEffects/shader/gammaCorrectionShader.js.map +1 -1
- package/dist/core/PostEffects/shader/mapping.js +66 -3
- package/dist/core/PostEffects/shader/mapping.js.map +1 -1
- package/dist/core/PostEffects/shader/thermalMaging.js +28 -3
- package/dist/core/PostEffects/shader/thermalMaging.js.map +1 -1
- package/dist/core/SceneEffect/grow/grow.js +85 -101
- package/dist/core/SceneEffect/grow/grow.js.map +1 -1
- package/dist/core/SceneEffect/grow/style_down.js +60 -77
- package/dist/core/SceneEffect/grow/style_down.js.map +1 -1
- package/dist/core/SceneEffect/grow/style_up.js +64 -81
- package/dist/core/SceneEffect/grow/style_up.js.map +1 -1
- package/dist/core/SceneEffect/grow/type.js +2 -2
- package/dist/core/SceneEffect/grow/type.js.map +1 -1
- package/dist/core/WeatherSystem/DynamicWeatherSystem.js +51 -76
- package/dist/core/WeatherSystem/DynamicWeatherSystem.js.map +1 -1
- package/dist/core/WeatherSystem/hdr/index.js +69 -105
- package/dist/core/WeatherSystem/hdr/index.js.map +1 -1
- package/dist/core/WeatherSystem/index.js +77 -124
- package/dist/core/WeatherSystem/index.js.map +1 -1
- package/dist/core/WeatherSystem/objects/fog/index.js +52 -80
- package/dist/core/WeatherSystem/objects/fog/index.js.map +1 -1
- package/dist/core/WeatherSystem/objects/rain/index.js +72 -84
- package/dist/core/WeatherSystem/objects/rain/index.js.map +1 -1
- package/dist/core/WeatherSystem/objects/rain/lineRain.js +88 -118
- package/dist/core/WeatherSystem/objects/rain/lineRain.js.map +1 -1
- package/dist/core/WeatherSystem/objects/rain/plane.js +116 -146
- package/dist/core/WeatherSystem/objects/rain/plane.js.map +1 -1
- package/dist/core/WeatherSystem/objects/rain/point.js +100 -148
- package/dist/core/WeatherSystem/objects/rain/point.js.map +1 -1
- package/dist/core/WeatherSystem/objects/sky/cloud.js +71 -104
- package/dist/core/WeatherSystem/objects/sky/cloud.js.map +1 -1
- package/dist/core/WeatherSystem/objects/sky/index.js +66 -84
- package/dist/core/WeatherSystem/objects/sky/index.js.map +1 -1
- package/dist/core/WeatherSystem/objects/sky/outline.js +25 -45
- package/dist/core/WeatherSystem/objects/sky/outline.js.map +1 -1
- package/dist/core/WeatherSystem/shaders/cloud.js +74 -3
- package/dist/core/WeatherSystem/shaders/cloud.js.map +1 -1
- package/dist/core/WeatherSystem/shaders/fog.js +103 -3
- package/dist/core/WeatherSystem/shaders/fog.js.map +1 -1
- package/dist/core/WeatherSystem/shaders/rain.js +206 -7
- package/dist/core/WeatherSystem/shaders/rain.js.map +1 -1
- package/dist/core/WeatherSystem/shaders/sky.js +87 -3
- package/dist/core/WeatherSystem/shaders/sky.js.map +1 -1
- package/dist/core/WeatherSystem/sky/index.js +104 -135
- package/dist/core/WeatherSystem/sky/index.js.map +1 -1
- package/dist/core/WeatherSystem/utils/constant.js +44 -38
- package/dist/core/WeatherSystem/utils/constant.js.map +1 -1
- package/dist/core/WeatherSystem/utils/math.js +18 -25
- package/dist/core/WeatherSystem/utils/math.js.map +1 -1
- package/dist/core/WeatherSystem/utils/type.js +1 -1
- package/dist/core/WeatherSystem/utils/type.js.map +1 -1
- package/dist/core/WeatherSystem/weather/index.js +96 -141
- package/dist/core/WeatherSystem/weather/index.js.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,26 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
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); }
|
|
3
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
5
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
7
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
8
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
1
|
+
const _excluded = ["value"];
|
|
9
2
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
10
3
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
11
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
12
|
-
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); } }
|
|
13
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
14
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
15
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
16
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
17
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
18
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
19
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
20
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
21
4
|
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; }
|
|
22
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" ==
|
|
23
|
-
function _toPrimitive(t, r) { if ("object" !=
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
6
|
+
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); }
|
|
24
7
|
/**
|
|
25
8
|
* @file index.ts
|
|
26
9
|
* @description 视频面板
|
|
@@ -32,7 +15,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
32
15
|
import ObjectLayer from "../Base/ObjectLayer";
|
|
33
16
|
import _ from 'lodash';
|
|
34
17
|
import { Group, Vector3, createLabel } from '@anov/3d-core';
|
|
35
|
-
|
|
18
|
+
const DEFAULT_OPTION = {
|
|
36
19
|
position: [0, 0, 0],
|
|
37
20
|
width: 300,
|
|
38
21
|
height: 200,
|
|
@@ -49,316 +32,272 @@ var DEFAULT_OPTION = {
|
|
|
49
32
|
poster: '',
|
|
50
33
|
videoHeight: 150
|
|
51
34
|
};
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
_defineProperty(
|
|
60
|
-
_defineProperty(
|
|
61
|
-
_defineProperty(
|
|
62
|
-
_defineProperty(
|
|
63
|
-
_defineProperty(
|
|
64
|
-
_defineProperty(
|
|
65
|
-
_defineProperty(
|
|
66
|
-
_defineProperty(
|
|
67
|
-
_defineProperty(
|
|
68
|
-
_defineProperty(
|
|
69
|
-
_defineProperty(
|
|
70
|
-
_defineProperty(
|
|
71
|
-
_defineProperty(
|
|
72
|
-
_defineProperty(
|
|
73
|
-
_defineProperty(
|
|
74
|
-
_defineProperty(
|
|
75
|
-
_defineProperty(
|
|
76
|
-
_defineProperty(
|
|
77
|
-
_defineProperty(
|
|
78
|
-
_defineProperty(
|
|
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
|
-
_closeable: _closeable,
|
|
126
|
-
_onClose: _onClose
|
|
35
|
+
class VideoPanel extends ObjectLayer {
|
|
36
|
+
constructor(option) {
|
|
37
|
+
super();
|
|
38
|
+
_defineProperty(this, "_title", void 0);
|
|
39
|
+
_defineProperty(this, "_width", void 0);
|
|
40
|
+
_defineProperty(this, "_height", void 0);
|
|
41
|
+
_defineProperty(this, "_bgColor", void 0);
|
|
42
|
+
_defineProperty(this, "_position", void 0);
|
|
43
|
+
_defineProperty(this, "_borderRadius", 10);
|
|
44
|
+
_defineProperty(this, "_bgUrl", void 0);
|
|
45
|
+
_defineProperty(this, "_className", void 0);
|
|
46
|
+
_defineProperty(this, "_customStyle", void 0);
|
|
47
|
+
_defineProperty(this, "_closeable", void 0);
|
|
48
|
+
_defineProperty(this, "_padding", void 0);
|
|
49
|
+
_defineProperty(this, "_group", void 0);
|
|
50
|
+
_defineProperty(this, "_videoElement", void 0);
|
|
51
|
+
_defineProperty(this, "_src", void 0);
|
|
52
|
+
_defineProperty(this, "_autoplay", void 0);
|
|
53
|
+
_defineProperty(this, "_controls", void 0);
|
|
54
|
+
_defineProperty(this, "_loop", void 0);
|
|
55
|
+
_defineProperty(this, "_muted", void 0);
|
|
56
|
+
_defineProperty(this, "_poster", void 0);
|
|
57
|
+
_defineProperty(this, "_volume", void 0);
|
|
58
|
+
_defineProperty(this, "_videoHeight", void 0);
|
|
59
|
+
_defineProperty(this, "_videoWidth", void 0);
|
|
60
|
+
_defineProperty(this, "_onClose", void 0);
|
|
61
|
+
_defineProperty(this, "visible", false);
|
|
62
|
+
const params = _.mergeWith(_.cloneDeep(DEFAULT_OPTION), option);
|
|
63
|
+
const {
|
|
64
|
+
title: _title,
|
|
65
|
+
width: _width,
|
|
66
|
+
height: _height,
|
|
67
|
+
bgColor: _bgColor,
|
|
68
|
+
position: _position,
|
|
69
|
+
bgUrl: _bgUrl,
|
|
70
|
+
className: _className,
|
|
71
|
+
customStyle: _customStyle,
|
|
72
|
+
borderRadius: _borderRadius,
|
|
73
|
+
padding: _padding,
|
|
74
|
+
closeable: _closeable,
|
|
75
|
+
autoplay: _autoplay,
|
|
76
|
+
controls: _controls,
|
|
77
|
+
loop: _loop,
|
|
78
|
+
muted: _muted,
|
|
79
|
+
poster: _poster,
|
|
80
|
+
volume: _volume,
|
|
81
|
+
src: _src,
|
|
82
|
+
videoHeight: _videoHeight,
|
|
83
|
+
videoWidth: _videoWidth,
|
|
84
|
+
onClose: _onClose
|
|
85
|
+
} = params;
|
|
86
|
+
Object.assign(this, {
|
|
87
|
+
_videoWidth,
|
|
88
|
+
_videoHeight,
|
|
89
|
+
_title,
|
|
90
|
+
_autoplay,
|
|
91
|
+
_loop,
|
|
92
|
+
_muted,
|
|
93
|
+
_volume,
|
|
94
|
+
_poster,
|
|
95
|
+
_controls,
|
|
96
|
+
_src,
|
|
97
|
+
_width,
|
|
98
|
+
_height,
|
|
99
|
+
_bgColor,
|
|
100
|
+
_position,
|
|
101
|
+
_bgUrl,
|
|
102
|
+
_className,
|
|
103
|
+
_customStyle,
|
|
104
|
+
_borderRadius,
|
|
105
|
+
_padding,
|
|
106
|
+
_closeable,
|
|
107
|
+
_onClose
|
|
127
108
|
});
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
return _this;
|
|
109
|
+
this._videoElement = this.createVideoDom();
|
|
110
|
+
this._group = new Group();
|
|
111
|
+
this._group.visible = this.visible;
|
|
112
|
+
this.init();
|
|
133
113
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
var videoContainer = document.createElement('div');
|
|
147
|
-
if ((_this$_title = this._title) !== null && _this$_title !== void 0 && _this$_title.value || this._closeable) {
|
|
148
|
-
var headerDom = this.createHeaderDom(); //创建头部盒子
|
|
149
|
-
bgDom.appendChild(headerDom);
|
|
150
|
-
}
|
|
151
|
-
videoContainer.appendChild(this._videoElement);
|
|
152
|
-
bgDom.appendChild(videoContainer);
|
|
153
|
-
var bgObject = createLabel(bgDom);
|
|
154
|
-
bgObject.position.set(0, 0, 0);
|
|
155
|
-
bgObject.center.set(0.5, 0.5);
|
|
156
|
-
this._group.add(bgObject);
|
|
157
|
-
this.add(this._group);
|
|
158
|
-
this.applyPosition(); // 初始化自动定位
|
|
159
|
-
}
|
|
160
|
-
/** 创建背景 */
|
|
161
|
-
}, {
|
|
162
|
-
key: "createBgDom",
|
|
163
|
-
value: function createBgDom() {
|
|
164
|
-
//创建容器盒子
|
|
165
|
-
var bgDom = document.createElement('div');
|
|
166
|
-
Object.assign(bgDom.style, {
|
|
167
|
-
width: "".concat(this._width, "px"),
|
|
168
|
-
height: "".concat(this._height, "px"),
|
|
169
|
-
// left: `${this._position[0]}px`,
|
|
170
|
-
// top: `${this._position[1]}px`,
|
|
171
|
-
overflow: 'hidden',
|
|
172
|
-
padding: this._padding,
|
|
173
|
-
borderRadius: this._bgUrl ? '' : "".concat(this._borderRadius, "px"),
|
|
174
|
-
backgroundColor: this._bgUrl ? '' : this._bgColor,
|
|
175
|
-
backgroundImage: this._bgUrl ? "url(".concat(this._bgUrl, ")") : '',
|
|
176
|
-
backgroundSize: this._bgUrl ? 'contain' : '',
|
|
177
|
-
backgroundRepeat: this._bgUrl ? 'no-repeat' : '',
|
|
178
|
-
boxSizing: 'border-box',
|
|
179
|
-
display: 'flex'
|
|
180
|
-
});
|
|
181
|
-
if (this._className) bgDom.className = this._className;
|
|
182
|
-
if (this._customStyle) Object.assign(bgDom.style, this._customStyle);
|
|
183
|
-
return bgDom;
|
|
114
|
+
init() {
|
|
115
|
+
this.createBox();
|
|
116
|
+
}
|
|
117
|
+
createBox() {
|
|
118
|
+
var _this$_title;
|
|
119
|
+
// 使用 DocumentFragment 减少重排
|
|
120
|
+
// const fragment = document.createDocumentFragment();
|
|
121
|
+
const bgDom = this.createBgDom(); //创建容器盒子
|
|
122
|
+
const videoContainer = document.createElement('div');
|
|
123
|
+
if ((_this$_title = this._title) !== null && _this$_title !== void 0 && _this$_title.value || this._closeable) {
|
|
124
|
+
const headerDom = this.createHeaderDom(); //创建头部盒子
|
|
125
|
+
bgDom.appendChild(headerDom);
|
|
184
126
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
127
|
+
videoContainer.appendChild(this._videoElement);
|
|
128
|
+
bgDom.appendChild(videoContainer);
|
|
129
|
+
const bgObject = createLabel(bgDom);
|
|
130
|
+
bgObject.position.set(0, 0, 0);
|
|
131
|
+
bgObject.center.set(0.5, 0.5);
|
|
132
|
+
this._group.add(bgObject);
|
|
133
|
+
this.add(this._group);
|
|
134
|
+
this.applyPosition(); // 初始化自动定位
|
|
135
|
+
}
|
|
136
|
+
/** 创建背景 */
|
|
137
|
+
createBgDom() {
|
|
138
|
+
//创建容器盒子
|
|
139
|
+
const bgDom = document.createElement('div');
|
|
140
|
+
Object.assign(bgDom.style, {
|
|
141
|
+
width: `${this._width}px`,
|
|
142
|
+
height: `${this._height}px`,
|
|
143
|
+
// left: `${this._position[0]}px`,
|
|
144
|
+
// top: `${this._position[1]}px`,
|
|
145
|
+
overflow: 'hidden',
|
|
146
|
+
padding: this._padding,
|
|
147
|
+
borderRadius: this._bgUrl ? '' : `${this._borderRadius}px`,
|
|
148
|
+
backgroundColor: this._bgUrl ? '' : this._bgColor,
|
|
149
|
+
backgroundImage: this._bgUrl ? `url(${this._bgUrl})` : '',
|
|
150
|
+
backgroundSize: this._bgUrl ? 'contain' : '',
|
|
151
|
+
backgroundRepeat: this._bgUrl ? 'no-repeat' : '',
|
|
152
|
+
boxSizing: 'border-box',
|
|
153
|
+
display: 'flex'
|
|
154
|
+
});
|
|
155
|
+
if (this._className) bgDom.className = this._className;
|
|
156
|
+
if (this._customStyle) Object.assign(bgDom.style, this._customStyle);
|
|
157
|
+
return bgDom;
|
|
158
|
+
}
|
|
159
|
+
/** 创建头部 */
|
|
160
|
+
createHeaderDom() {
|
|
161
|
+
var _this$_title2;
|
|
162
|
+
const headerDom = document.createElement('div');
|
|
163
|
+
headerDom.className = 'video-panel-header';
|
|
164
|
+
headerDom.style.display = 'flex';
|
|
165
|
+
headerDom.style.alignItems = 'center';
|
|
166
|
+
headerDom.style.justifyContent = 'flex-end';
|
|
167
|
+
if ((_this$_title2 = this._title) !== null && _this$_title2 !== void 0 && _this$_title2.value) {
|
|
168
|
+
// 创建标题
|
|
169
|
+
const titleDom = document.createElement('p');
|
|
170
|
+
titleDom.className = 'panel-title';
|
|
171
|
+
titleDom.style.display = 'flex';
|
|
172
|
+
titleDom.style.flex = '1';
|
|
173
|
+
titleDom.textContent = this._title.value;
|
|
174
|
+
const _this$_title3 = this._title,
|
|
175
|
+
{
|
|
176
|
+
value: titleValue
|
|
177
|
+
} = _this$_title3,
|
|
178
|
+
titleStyle = _objectWithoutProperties(_this$_title3, _excluded);
|
|
179
|
+
// 正确设置样式的方式
|
|
180
|
+
Object.assign(titleDom.style, titleStyle); //待测试
|
|
211
181
|
|
|
212
|
-
|
|
213
|
-
if (this._closeable) {
|
|
214
|
-
var _this$_title4, _this$_title5;
|
|
215
|
-
var closeDom = document.createElement('div');
|
|
216
|
-
closeDom.className = 'panel-close';
|
|
217
|
-
closeDom.style.cursor = 'pointer';
|
|
218
|
-
closeDom.style.fontSize = (_this$_title4 = this._title) === null || _this$_title4 === void 0 ? void 0 : _this$_title4.fontSize;
|
|
219
|
-
closeDom.style.color = (_this$_title5 = this._title) === null || _this$_title5 === void 0 ? void 0 : _this$_title5.color;
|
|
220
|
-
closeDom.textContent = 'x';
|
|
221
|
-
closeDom.style.pointerEvents = 'auto';
|
|
222
|
-
closeDom.onclick = function () {
|
|
223
|
-
_this2.close();
|
|
224
|
-
};
|
|
225
|
-
headerDom.appendChild(closeDom);
|
|
226
|
-
}
|
|
227
|
-
return headerDom;
|
|
228
|
-
}
|
|
229
|
-
}, {
|
|
230
|
-
key: "createVideoDom",
|
|
231
|
-
value: function createVideoDom() {
|
|
232
|
-
var videoDom = document.createElement('video');
|
|
233
|
-
videoDom.style.width = this._videoWidth ? "".concat(this._videoWidth, "px") : '100%';
|
|
234
|
-
videoDom.style.height = this._videoHeight ? "".concat(this._videoHeight, "px") : '100%';
|
|
235
|
-
videoDom.style.objectFit = 'cover';
|
|
236
|
-
videoDom.src = this._src;
|
|
237
|
-
videoDom.autoplay = this._autoplay;
|
|
238
|
-
videoDom.controls = this._controls;
|
|
239
|
-
videoDom.loop = this._loop;
|
|
240
|
-
videoDom.muted = this._muted;
|
|
241
|
-
videoDom.volume = this._volume;
|
|
242
|
-
if (this._poster) videoDom.poster = this._poster;
|
|
243
|
-
return videoDom;
|
|
182
|
+
headerDom.appendChild(titleDom);
|
|
244
183
|
}
|
|
245
184
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
this.
|
|
258
|
-
}
|
|
185
|
+
// 创建关闭按钮
|
|
186
|
+
if (this._closeable) {
|
|
187
|
+
var _this$_title4, _this$_title5;
|
|
188
|
+
const closeDom = document.createElement('div');
|
|
189
|
+
closeDom.className = 'panel-close';
|
|
190
|
+
closeDom.style.cursor = 'pointer';
|
|
191
|
+
closeDom.style.fontSize = (_this$_title4 = this._title) === null || _this$_title4 === void 0 ? void 0 : _this$_title4.fontSize;
|
|
192
|
+
closeDom.style.color = (_this$_title5 = this._title) === null || _this$_title5 === void 0 ? void 0 : _this$_title5.color;
|
|
193
|
+
closeDom.textContent = 'x';
|
|
194
|
+
closeDom.style.pointerEvents = 'auto';
|
|
195
|
+
closeDom.onclick = () => {
|
|
196
|
+
this.close();
|
|
197
|
+
};
|
|
198
|
+
headerDom.appendChild(closeDom);
|
|
259
199
|
}
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
200
|
+
return headerDom;
|
|
201
|
+
}
|
|
202
|
+
createVideoDom() {
|
|
203
|
+
const videoDom = document.createElement('video');
|
|
204
|
+
videoDom.style.width = this._videoWidth ? `${this._videoWidth}px` : '100%';
|
|
205
|
+
videoDom.style.height = this._videoHeight ? `${this._videoHeight}px` : '100%';
|
|
206
|
+
videoDom.style.objectFit = 'cover';
|
|
207
|
+
videoDom.src = this._src;
|
|
208
|
+
videoDom.autoplay = this._autoplay;
|
|
209
|
+
videoDom.controls = this._controls;
|
|
210
|
+
videoDom.loop = this._loop;
|
|
211
|
+
videoDom.muted = this._muted;
|
|
212
|
+
videoDom.volume = this._volume;
|
|
213
|
+
if (this._poster) videoDom.poster = this._poster;
|
|
214
|
+
return videoDom;
|
|
215
|
+
}
|
|
265
216
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
//
|
|
270
|
-
|
|
271
|
-
|
|
217
|
+
/** 自动定位面板 */
|
|
218
|
+
applyPosition(offset = new Vector3(0, 0, 0)) {
|
|
219
|
+
if (Array.isArray(this._position)) {
|
|
220
|
+
// 如果是数组 [x, y]
|
|
221
|
+
const [x, y, z] = this._position;
|
|
222
|
+
this._group.position.set(x, -y, z); // 注意y轴取反
|
|
272
223
|
}
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
this._group.visible = false;
|
|
224
|
+
}
|
|
225
|
+
open() {
|
|
226
|
+
this.visible = true;
|
|
227
|
+
this._group.visible = true;
|
|
278
228
|
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
}, {
|
|
290
|
-
key: "update",
|
|
291
|
-
value: function update(option) {
|
|
292
|
-
if (option.src) {
|
|
293
|
-
this._src = option.src;
|
|
294
|
-
this._videoElement.src = option.src;
|
|
295
|
-
}
|
|
296
|
-
if (option.autoplay !== undefined) this._autoplay = option.autoplay;
|
|
297
|
-
if (option.controls !== undefined) this._videoElement.controls = option.controls;
|
|
298
|
-
if (option.loop !== undefined) this._videoElement.loop = option.loop;
|
|
299
|
-
if (option.muted !== undefined) this._videoElement.muted = option.muted;
|
|
300
|
-
if (option.volume !== undefined) this._videoElement.volume = option.volume;
|
|
301
|
-
if (option.poster) this._videoElement.poster = option.poster;
|
|
302
|
-
}
|
|
229
|
+
// 同步 DOM 节点显示
|
|
230
|
+
// this._group.children.forEach((child: any) => {
|
|
231
|
+
// if (child.element) {
|
|
232
|
+
// child.element.style.display = 'block';
|
|
233
|
+
// }
|
|
234
|
+
// });
|
|
235
|
+
}
|
|
236
|
+
close() {
|
|
237
|
+
this.visible = false;
|
|
238
|
+
this._group.visible = false;
|
|
303
239
|
|
|
304
|
-
//
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
value: function pause() {
|
|
313
|
-
this._videoElement.pause();
|
|
240
|
+
// 同步 DOM 节点隐藏
|
|
241
|
+
// this._group.children.forEach((child: any) => {
|
|
242
|
+
// if (child.element) {
|
|
243
|
+
// child.element.style.display = 'none';
|
|
244
|
+
// }
|
|
245
|
+
// });
|
|
246
|
+
if (this._onClose) {
|
|
247
|
+
this._onClose();
|
|
314
248
|
}
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
this.
|
|
319
|
-
|
|
320
|
-
}, {
|
|
321
|
-
key: "seek",
|
|
322
|
-
value: function seek(time) {
|
|
323
|
-
this._videoElement.currentTime = time;
|
|
324
|
-
}
|
|
325
|
-
}, {
|
|
326
|
-
key: "toggleMute",
|
|
327
|
-
value: function toggleMute() {
|
|
328
|
-
this._videoElement.muted = !this._videoElement.muted;
|
|
329
|
-
}
|
|
330
|
-
}, {
|
|
331
|
-
key: "duration",
|
|
332
|
-
get: function get() {
|
|
333
|
-
return this._videoElement.duration;
|
|
334
|
-
}
|
|
335
|
-
}, {
|
|
336
|
-
key: "currentTime",
|
|
337
|
-
get: function get() {
|
|
338
|
-
return this._videoElement.currentTime;
|
|
339
|
-
}
|
|
340
|
-
}, {
|
|
341
|
-
key: "isPlaying",
|
|
342
|
-
get: function get() {
|
|
343
|
-
return !this._videoElement.paused && !this._videoElement.ended;
|
|
344
|
-
}
|
|
345
|
-
}, {
|
|
346
|
-
key: "destroy",
|
|
347
|
-
value: function destroy() {
|
|
348
|
-
this._group.clear();
|
|
349
|
-
this.remove(this._group);
|
|
350
|
-
// 清理DOM引用
|
|
351
|
-
this._group.children.forEach(function (child) {
|
|
352
|
-
if (child.element && child.element.parentNode) {
|
|
353
|
-
child.element.parentNode.removeChild(child.element);
|
|
354
|
-
}
|
|
355
|
-
});
|
|
356
|
-
this._videoElement.pause();
|
|
357
|
-
this._videoElement.src = '';
|
|
358
|
-
this._videoElement.load(); // 清理视频资源
|
|
249
|
+
}
|
|
250
|
+
update(option) {
|
|
251
|
+
if (option.src) {
|
|
252
|
+
this._src = option.src;
|
|
253
|
+
this._videoElement.src = option.src;
|
|
359
254
|
}
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
255
|
+
if (option.autoplay !== undefined) this._autoplay = option.autoplay;
|
|
256
|
+
if (option.controls !== undefined) this._videoElement.controls = option.controls;
|
|
257
|
+
if (option.loop !== undefined) this._videoElement.loop = option.loop;
|
|
258
|
+
if (option.muted !== undefined) this._videoElement.muted = option.muted;
|
|
259
|
+
if (option.volume !== undefined) this._videoElement.volume = option.volume;
|
|
260
|
+
if (option.poster) this._videoElement.poster = option.poster;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
// 视频控制方法
|
|
264
|
+
play() {
|
|
265
|
+
this._videoElement.play();
|
|
266
|
+
}
|
|
267
|
+
pause() {
|
|
268
|
+
this._videoElement.pause();
|
|
269
|
+
}
|
|
270
|
+
setVolume(volume) {
|
|
271
|
+
this._videoElement.volume = Math.max(0, Math.min(1, volume));
|
|
272
|
+
}
|
|
273
|
+
seek(time) {
|
|
274
|
+
this._videoElement.currentTime = time;
|
|
275
|
+
}
|
|
276
|
+
toggleMute() {
|
|
277
|
+
this._videoElement.muted = !this._videoElement.muted;
|
|
278
|
+
}
|
|
279
|
+
get duration() {
|
|
280
|
+
return this._videoElement.duration;
|
|
281
|
+
}
|
|
282
|
+
get currentTime() {
|
|
283
|
+
return this._videoElement.currentTime;
|
|
284
|
+
}
|
|
285
|
+
get isPlaying() {
|
|
286
|
+
return !this._videoElement.paused && !this._videoElement.ended;
|
|
287
|
+
}
|
|
288
|
+
destroy() {
|
|
289
|
+
this._group.clear();
|
|
290
|
+
this.remove(this._group);
|
|
291
|
+
// 清理DOM引用
|
|
292
|
+
this._group.children.forEach(child => {
|
|
293
|
+
if (child.element && child.element.parentNode) {
|
|
294
|
+
child.element.parentNode.removeChild(child.element);
|
|
295
|
+
}
|
|
296
|
+
});
|
|
297
|
+
this._videoElement.pause();
|
|
298
|
+
this._videoElement.src = '';
|
|
299
|
+
this._videoElement.load(); // 清理视频资源
|
|
300
|
+
}
|
|
301
|
+
}
|
|
363
302
|
export { VideoPanel };
|
|
364
303
|
//# sourceMappingURL=index.js.map
|