@realsee/vreo 2.6.4-alpha.5 → 3.0.0-webgpu-react18.8
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/CHANGELOG.md +7 -0
- package/README.md +6 -6
- package/lib/PlayController/createHTMLAudioElement.d.ts +1 -0
- package/lib/PlayController/createHTMLAudioElement.d.ts.map +1 -0
- package/lib/PlayController/index.d.ts +14 -24
- package/lib/PlayController/index.d.ts.map +1 -0
- package/lib/PlayController/index.js +74 -210
- package/lib/PlayController/index.js.map +1 -0
- package/lib/Player/App.d.ts +2 -2
- package/lib/Player/App.d.ts.map +1 -0
- package/lib/Player/Controller.d.ts +11 -6
- package/lib/Player/Controller.d.ts.map +1 -0
- package/lib/Player/PlaybackLifecycle.d.ts +1 -0
- package/lib/Player/PlaybackLifecycle.d.ts.map +1 -0
- package/lib/Player/custom/SpatialScenePanel/index.d.ts +2 -2
- package/lib/Player/custom/SpatialScenePanel/index.d.ts.map +1 -0
- package/lib/Player/hooks.d.ts +3 -2
- package/lib/Player/hooks.d.ts.map +1 -0
- package/lib/Player/index.d.ts +3 -2
- package/lib/Player/index.d.ts.map +1 -0
- package/lib/Player/index.js +1769 -430
- package/lib/Player/index.js.map +1 -0
- package/lib/Player/modules/Drawer/index.d.ts +2 -2
- package/lib/Player/modules/Drawer/index.d.ts.map +1 -0
- package/lib/Player/modules/PopUp/index.d.ts +2 -2
- package/lib/Player/modules/PopUp/index.d.ts.map +1 -0
- package/lib/Player/modules/ResizeObserver/index.d.ts +2 -2
- package/lib/Player/modules/ResizeObserver/index.d.ts.map +1 -0
- package/lib/Player/modules/VideoAgent/VideoAgentMesh.d.ts +5 -2
- package/lib/Player/modules/VideoAgent/VideoAgentMesh.d.ts.map +1 -0
- package/lib/Player/modules/VideoAgent/VideoAgentScene.d.ts +8 -5
- package/lib/Player/modules/VideoAgent/VideoAgentScene.d.ts.map +1 -0
- package/lib/Player/modules/VideoAgent/index.d.ts +11 -2
- package/lib/Player/modules/VideoAgent/index.d.ts.map +1 -0
- package/lib/Player/modules/Wave/index.d.ts +2 -2
- package/lib/Player/modules/Wave/index.d.ts.map +1 -0
- package/lib/Player/modules/keyframes/BgMusic/index.d.ts +2 -2
- package/lib/Player/modules/keyframes/BgMusic/index.d.ts.map +1 -0
- package/lib/Player/modules/keyframes/CameraMovement/index.d.ts +2 -2
- package/lib/Player/modules/keyframes/CameraMovement/index.d.ts.map +1 -0
- package/lib/Player/modules/keyframes/InfoPanel/index.d.ts +2 -2
- package/lib/Player/modules/keyframes/InfoPanel/index.d.ts.map +1 -0
- package/lib/Player/modules/keyframes/ModelVideo/index.d.ts +2 -2
- package/lib/Player/modules/keyframes/ModelVideo/index.d.ts.map +1 -0
- package/lib/Player/modules/keyframes/PanoEffect/index.d.ts +2 -2
- package/lib/Player/modules/keyframes/PanoEffect/index.d.ts.map +1 -0
- package/lib/Player/modules/keyframes/PanoEffect/lineAnime.d.ts +3 -2
- package/lib/Player/modules/keyframes/PanoEffect/lineAnime.d.ts.map +1 -0
- package/lib/Player/modules/keyframes/PanoTag/index.d.ts +1 -0
- package/lib/Player/modules/keyframes/PanoTag/index.d.ts.map +1 -0
- package/lib/Player/modules/keyframes/PanoTextLabel/index.d.ts +2 -2
- package/lib/Player/modules/keyframes/PanoTextLabel/index.d.ts.map +1 -0
- package/lib/Player/modules/keyframes/Prompter/index.d.ts +2 -2
- package/lib/Player/modules/keyframes/Prompter/index.d.ts.map +1 -0
- package/lib/Player/modules/keyframes/UpdateVRPanorama/index.d.ts +2 -2
- package/lib/Player/modules/keyframes/UpdateVRPanorama/index.d.ts.map +1 -0
- package/lib/Player/modules/keyframes/VideoEffect/index.d.ts +2 -2
- package/lib/Player/modules/keyframes/VideoEffect/index.d.ts.map +1 -0
- package/lib/Player/playback-types.d.ts +1 -0
- package/lib/Player/playback-types.d.ts.map +1 -0
- package/lib/Player/typings.d.ts +2 -1
- package/lib/Player/typings.d.ts.map +1 -0
- package/lib/chunks/index-BgPSzRSs.js +93 -0
- package/lib/chunks/index-BgPSzRSs.js.map +1 -0
- package/lib/chunks/index-CunyJn6H.js +51 -0
- package/lib/chunks/index-CunyJn6H.js.map +1 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/centerPoint.d.ts +2 -1
- package/lib/fivePlugins/CSS3DRenderPlugin/centerPoint.d.ts.map +1 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/createResizeObserver.d.ts +5 -6
- package/lib/fivePlugins/CSS3DRenderPlugin/createResizeObserver.d.ts.map +1 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/evenNumber.d.ts +1 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/evenNumber.d.ts.map +1 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/index.d.ts +5 -22
- package/lib/fivePlugins/CSS3DRenderPlugin/index.d.ts.map +1 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.d.ts +2 -1
- package/lib/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.d.ts.map +1 -0
- package/lib/fivePlugins/CameraMovementPlugin/index.d.ts +2 -1
- package/lib/fivePlugins/CameraMovementPlugin/index.d.ts.map +1 -0
- package/lib/fivePlugins/CameraMovementPlugin/typings.d.ts +2 -1
- package/lib/fivePlugins/CameraMovementPlugin/typings.d.ts.map +1 -0
- package/lib/fivePlugins/ModelTVVideoPlugin/index.d.ts +2 -1
- package/lib/fivePlugins/ModelTVVideoPlugin/index.d.ts.map +1 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +12 -1
- package/lib/index.js.map +1 -0
- package/lib/plugins/CSS3DRenderPlugin.js +115 -0
- package/lib/plugins/CSS3DRenderPlugin.js.map +1 -0
- package/lib/plugins/CameraMovementPlugin.js +6 -0
- package/lib/plugins/CameraMovementPlugin.js.map +1 -0
- package/lib/plugins/ModelTVVideoPlugin.js +162 -0
- package/lib/plugins/ModelTVVideoPlugin.js.map +1 -0
- package/lib/react/index.d.ts +5 -4
- package/lib/react/index.d.ts.map +1 -0
- package/lib/react/index.js +39 -226
- package/lib/react/index.js.map +1 -0
- package/lib/shared-utils/Audio.d.ts +3 -1
- package/lib/shared-utils/Audio.d.ts.map +1 -0
- package/lib/shared-utils/AudioLike.d.ts +2 -1
- package/lib/shared-utils/AudioLike.d.ts.map +1 -0
- package/lib/shared-utils/Preloader.d.ts +1 -0
- package/lib/shared-utils/Preloader.d.ts.map +1 -0
- package/lib/shared-utils/addResizeListener.d.ts +2 -1
- package/lib/shared-utils/addResizeListener.d.ts.map +1 -0
- package/lib/shared-utils/animationFrame/BetterTween.d.ts +1 -0
- package/lib/shared-utils/animationFrame/BetterTween.d.ts.map +1 -0
- package/lib/shared-utils/animationFrame/index.d.ts +5 -14
- package/lib/shared-utils/animationFrame/index.d.ts.map +1 -0
- package/lib/shared-utils/animationFrame/tween.d.ts +1 -0
- package/lib/shared-utils/animationFrame/tween.d.ts.map +1 -0
- package/lib/shared-utils/createTransMatrix.d.ts +3 -1
- package/lib/shared-utils/createTransMatrix.d.ts.map +1 -0
- package/lib/shared-utils/getFileExpandedName.d.ts +1 -0
- package/lib/shared-utils/getFileExpandedName.d.ts.map +1 -0
- package/lib/shared-utils/getMediaInfo.d.ts +1 -0
- package/lib/shared-utils/getMediaInfo.d.ts.map +1 -0
- package/lib/shared-utils/setElementDataset.d.ts +1 -0
- package/lib/shared-utils/setElementDataset.d.ts.map +1 -0
- package/lib/timeline/index.d.ts +18 -0
- package/lib/timeline/index.d.ts.map +1 -0
- package/lib/types/index.js +10 -0
- package/lib/types/index.js.map +1 -0
- package/lib/typings/VreoUnit.d.ts +2 -1
- package/lib/typings/VreoUnit.d.ts.map +1 -0
- package/lib/typings/index.d.ts +1 -0
- package/lib/typings/index.d.ts.map +1 -0
- package/package.json +51 -71
- package/lib/PlayController/createHTMLAudioElement.js +0 -30
- package/lib/Player/App.js +0 -52
- package/lib/Player/Controller.js +0 -530
- package/lib/Player/PlaybackLifecycle.js +0 -117
- package/lib/Player/custom/SpatialScenePanel/index.js +0 -263
- package/lib/Player/hooks.js +0 -22
- package/lib/Player/modules/Drawer/index.js +0 -39
- package/lib/Player/modules/PopUp/index.js +0 -23
- package/lib/Player/modules/ResizeObserver/index.js +0 -22
- package/lib/Player/modules/VideoAgent/VideoAgentMesh.js +0 -445
- package/lib/Player/modules/VideoAgent/VideoAgentScene.js +0 -53
- package/lib/Player/modules/VideoAgent/index.js +0 -72
- package/lib/Player/modules/Wave/index.js +0 -171
- package/lib/Player/modules/keyframes/BgMusic/index.js +0 -65
- package/lib/Player/modules/keyframes/CameraMovement/index.js +0 -73
- package/lib/Player/modules/keyframes/InfoPanel/index.js +0 -170
- package/lib/Player/modules/keyframes/ModelVideo/index.js +0 -126
- package/lib/Player/modules/keyframes/PanoEffect/index.js +0 -99
- package/lib/Player/modules/keyframes/PanoEffect/lineAnime.js +0 -30
- package/lib/Player/modules/keyframes/PanoTag/index.js +0 -110
- package/lib/Player/modules/keyframes/PanoTextLabel/index.js +0 -122
- package/lib/Player/modules/keyframes/Prompter/index.js +0 -56
- package/lib/Player/modules/keyframes/UpdateVRPanorama/index.js +0 -98
- package/lib/Player/modules/keyframes/VideoEffect/index.js +0 -152
- package/lib/Player/playback-types.js +0 -1
- package/lib/Player/typings.js +0 -1
- package/lib/fivePlugins/CSS3DRenderPlugin/centerPoint.js +0 -4
- package/lib/fivePlugins/CSS3DRenderPlugin/createResizeObserver.js +0 -25
- package/lib/fivePlugins/CSS3DRenderPlugin/evenNumber.js +0 -4
- package/lib/fivePlugins/CSS3DRenderPlugin/index.js +0 -226
- package/lib/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.js +0 -8
- package/lib/fivePlugins/CameraMovementPlugin/index.js +0 -238
- package/lib/fivePlugins/CameraMovementPlugin/typings.js +0 -15
- package/lib/fivePlugins/ModelTVVideoPlugin/index.js +0 -347
- package/lib/shared-utils/Audio.js +0 -147
- package/lib/shared-utils/AudioLike.js +0 -120
- package/lib/shared-utils/Preloader.js +0 -37
- package/lib/shared-utils/addResizeListener.js +0 -39
- package/lib/shared-utils/animationFrame/BetterTween.js +0 -56
- package/lib/shared-utils/animationFrame/index.js +0 -52
- package/lib/shared-utils/animationFrame/tween.js +0 -56
- package/lib/shared-utils/createTransMatrix.js +0 -12
- package/lib/shared-utils/getFileExpandedName.js +0 -6
- package/lib/shared-utils/getMediaInfo.js +0 -54
- package/lib/shared-utils/setElementDataset.js +0 -16
- package/lib/typings/VreoUnit.js +0 -171
- package/lib/typings/index.js +0 -1
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
var resizeObserverCache = new Map();
|
|
2
|
-
export function addResizeListener(element, resizeHandler) {
|
|
3
|
-
var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
4
|
-
if (!element) return function () {};
|
|
5
|
-
if (immediate) resizeHandler(element.clientWidth, element.clientHeight);
|
|
6
|
-
if (typeof ResizeObserver !== 'undefined' && ResizeObserver) {
|
|
7
|
-
var resizeObserver = new ResizeObserver(function () {
|
|
8
|
-
return resizeHandler(element.clientWidth, element.clientHeight);
|
|
9
|
-
});
|
|
10
|
-
resizeObserver.observe(element);
|
|
11
|
-
resizeObserverCache.set(element, resizeObserverCache.get(element) || 0 + 1);
|
|
12
|
-
return function () {
|
|
13
|
-
if (element) resizeObserver.unobserve(element);
|
|
14
|
-
if (resizeObserverCache.get(element) === 1) {
|
|
15
|
-
resizeObserverCache.delete(element);
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
} else {
|
|
19
|
-
var iframe = document.createElement('iframe');
|
|
20
|
-
iframe.style.cssText = 'position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;opacity:0;visibility:hidden;margin:0;border:0;padding:0;z-index:-1;';
|
|
21
|
-
iframe.classList.add('resize-sensor-iframe');
|
|
22
|
-
element.appendChild(iframe);
|
|
23
|
-
if (!iframe.contentWindow) return function () {};
|
|
24
|
-
iframe.contentWindow.addEventListener('resize', function () {
|
|
25
|
-
resizeHandler(iframe.clientWidth, iframe.clientHeight);
|
|
26
|
-
});
|
|
27
|
-
resizeObserverCache.set(element, resizeObserverCache.get(element) || 0 + 1);
|
|
28
|
-
return function () {
|
|
29
|
-
element.removeChild(iframe);
|
|
30
|
-
if (resizeObserverCache.get(element) === 1) {
|
|
31
|
-
resizeObserverCache.delete(element);
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
export function hasResizeListener(element) {
|
|
37
|
-
if (!element) return false;
|
|
38
|
-
return resizeObserverCache.get(element) || 0 > 0;
|
|
39
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
2
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
4
|
-
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
5
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
6
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
7
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
|
-
import * as TWEEN from '@tweenjs/tween.js';
|
|
10
|
-
import { requestAnimationFrameInterval } from "./index.js";
|
|
11
|
-
export var BetterTween = /*#__PURE__*/function (_TWEEN$Tween) {
|
|
12
|
-
function BetterTween() {
|
|
13
|
-
var _this;
|
|
14
|
-
_classCallCheck(this, BetterTween);
|
|
15
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
16
|
-
args[_key] = arguments[_key];
|
|
17
|
-
}
|
|
18
|
-
_this = _callSuper(this, BetterTween, [].concat(args));
|
|
19
|
-
_defineProperty(_this, "disposeMethods", []);
|
|
20
|
-
_defineProperty(_this, "onDispose", function (callback) {
|
|
21
|
-
_this.disposeMethods.push(callback);
|
|
22
|
-
return _this;
|
|
23
|
-
});
|
|
24
|
-
_defineProperty(_this, "play", function () {
|
|
25
|
-
_this.start();
|
|
26
|
-
_this.animationFrameDisposer = requestAnimationFrameInterval(function () {
|
|
27
|
-
return _this.update();
|
|
28
|
-
});
|
|
29
|
-
return _this;
|
|
30
|
-
});
|
|
31
|
-
_defineProperty(_this, "dispose", function () {
|
|
32
|
-
var _this$animationFrameD, _this2;
|
|
33
|
-
_this.stop();
|
|
34
|
-
(_this$animationFrameD = (_this2 = _this).animationFrameDisposer) === null || _this$animationFrameD === void 0 || _this$animationFrameD.call(_this2);
|
|
35
|
-
_this.disposeMethods.forEach(function (fn) {
|
|
36
|
-
return fn();
|
|
37
|
-
});
|
|
38
|
-
_this.disposeMethods = [];
|
|
39
|
-
TWEEN.remove(_this);
|
|
40
|
-
});
|
|
41
|
-
return _this;
|
|
42
|
-
}
|
|
43
|
-
_inherits(BetterTween, _TWEEN$Tween);
|
|
44
|
-
return _createClass(BetterTween);
|
|
45
|
-
}(TWEEN.Tween);
|
|
46
|
-
export function tweenProgress(duration) {
|
|
47
|
-
var easing = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TWEEN.Easing.Linear.None;
|
|
48
|
-
var tween = new BetterTween({
|
|
49
|
-
progress: 0
|
|
50
|
-
}).to({
|
|
51
|
-
progress: 1
|
|
52
|
-
});
|
|
53
|
-
if (duration !== undefined) tween.duration(duration);
|
|
54
|
-
if (easing !== undefined) tween.easing(easing);
|
|
55
|
-
return tween;
|
|
56
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
var _requestAnimationFrame = window.requestAnimationFrame || function (fn) {
|
|
2
|
-
return setTimeout(function () {
|
|
3
|
-
return fn(performance.now());
|
|
4
|
-
}, 16);
|
|
5
|
-
};
|
|
6
|
-
var _cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout;
|
|
7
|
-
export default _requestAnimationFrame;
|
|
8
|
-
export function nextFrame(fn) {
|
|
9
|
-
var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
10
|
-
if (delay <= 0) _requestAnimationFrame(fn);else _requestAnimationFrame(function () {
|
|
11
|
-
return nextFrame(fn, delay - 1);
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* 在每个 AnimationFrame 中调用传入的函数
|
|
17
|
-
* @param callback 每次 AnimationFrame 中调用的函数
|
|
18
|
-
* @param frame 每秒运行多少次
|
|
19
|
-
* @returns 返回一个函数,调用可以停止 AnimationFrameLoop
|
|
20
|
-
*/
|
|
21
|
-
export function requestAnimationFrameInterval(callback) {
|
|
22
|
-
var frame = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 60;
|
|
23
|
-
var index = -1;
|
|
24
|
-
var oldTime = 0;
|
|
25
|
-
var startTime = -1;
|
|
26
|
-
var minDeltaTime = 1000 / frame;
|
|
27
|
-
function loop(time) {
|
|
28
|
-
startTime === -1 && (startTime = time);
|
|
29
|
-
index = _requestAnimationFrame(loop);
|
|
30
|
-
var deltaTime = time - oldTime;
|
|
31
|
-
if (deltaTime < minDeltaTime) return;
|
|
32
|
-
oldTime = time;
|
|
33
|
-
callback && callback(time - startTime);
|
|
34
|
-
}
|
|
35
|
-
index = _requestAnimationFrame(loop);
|
|
36
|
-
return function stop() {
|
|
37
|
-
_cancelAnimationFrame(index);
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* 获取两个 AnimationFrame 间隔的时间
|
|
43
|
-
* @returns 返回一个 Promise,resolve 的结果是两个 AnimationFrame 间隔的时间
|
|
44
|
-
*/
|
|
45
|
-
export function getFrameTime() {
|
|
46
|
-
var start = Date.now();
|
|
47
|
-
return new Promise(function (resolve) {
|
|
48
|
-
_requestAnimationFrame(function () {
|
|
49
|
-
resolve(Date.now() - start);
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { Tween, Easing } from '@tweenjs/tween.js';
|
|
2
|
-
import { nextFrame, requestAnimationFrameInterval } from "./index.js";
|
|
3
|
-
var disposeMethods = [];
|
|
4
|
-
export var clear = function clear() {
|
|
5
|
-
disposeMethods.forEach(function (dispose) {
|
|
6
|
-
return dispose();
|
|
7
|
-
});
|
|
8
|
-
disposeMethods = [];
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* 对象变化的补间动画
|
|
13
|
-
* 1. 应用 requestAnimationFrameInterval 做 update
|
|
14
|
-
* 2. 在原生 tween 上新增 destroy 方法和 onDestroy 监听
|
|
15
|
-
* DOC: https://github.com/tweenjs/tween.js
|
|
16
|
-
* @param from 对象起始状态
|
|
17
|
-
* @param to 对象末尾状态
|
|
18
|
-
* @param duration 经历时间(s)
|
|
19
|
-
* @param easing 过程动画,默认是 Easing.Linear.None
|
|
20
|
-
*/
|
|
21
|
-
export default function tween(from, to, duration) {
|
|
22
|
-
var easing = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Easing.Linear.None;
|
|
23
|
-
var tween = new Tween(from).to(to, duration).easing(easing);
|
|
24
|
-
// 这里注意一下,因为 requestAnimationFrameInterval 给的时间是从 0 开始的,tween 动画也从 0 开始
|
|
25
|
-
nextFrame(function () {
|
|
26
|
-
return tween.start(0);
|
|
27
|
-
});
|
|
28
|
-
var cancelAnimationFrame = requestAnimationFrameInterval(function (time) {
|
|
29
|
-
if (tween.update(time) === false) cancelAnimationFrame();
|
|
30
|
-
});
|
|
31
|
-
var destroyMethods = [];
|
|
32
|
-
tween.onDestroy = function (fn) {
|
|
33
|
-
destroyMethods.push(fn);
|
|
34
|
-
return tween;
|
|
35
|
-
};
|
|
36
|
-
tween.destroy = function () {
|
|
37
|
-
this.stop();
|
|
38
|
-
Object.assign(tween, {
|
|
39
|
-
_onStartCallback: null,
|
|
40
|
-
_onUpdateCallback: null,
|
|
41
|
-
_onCompleteCallback: null,
|
|
42
|
-
_onStopCallbackL: null
|
|
43
|
-
});
|
|
44
|
-
var destroyMethod;
|
|
45
|
-
while (destroyMethod = destroyMethods.shift()) destroyMethod();
|
|
46
|
-
cancelAnimationFrame();
|
|
47
|
-
};
|
|
48
|
-
return tween;
|
|
49
|
-
}
|
|
50
|
-
export function tweenProgress(duration, easing) {
|
|
51
|
-
return tween({
|
|
52
|
-
progress: 0
|
|
53
|
-
}, {
|
|
54
|
-
progress: 1
|
|
55
|
-
}, duration, easing);
|
|
56
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import _construct from "@babel/runtime/helpers/esm/construct";
|
|
2
|
-
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
3
|
-
import * as THREE from 'three';
|
|
4
|
-
export function createTransMatrix(arr1) {
|
|
5
|
-
var matrix4 = new THREE.Matrix4();
|
|
6
|
-
matrix4.fromArray(arr1);
|
|
7
|
-
return function (arr2) {
|
|
8
|
-
var vector3 = _construct(THREE.Vector3, _toConsumableArray(arr2));
|
|
9
|
-
vector3.applyMatrix4(matrix4);
|
|
10
|
-
return vector3.toArray();
|
|
11
|
-
};
|
|
12
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import getFileExpandedName from "./getFileExpandedName.js";
|
|
2
|
-
export default function getMediaInfo(fileUrl) {
|
|
3
|
-
var type = getMediaType(fileUrl);
|
|
4
|
-
if (!type) return Promise.resolve({
|
|
5
|
-
error: '未知的文件类型: ' + fileUrl
|
|
6
|
-
});
|
|
7
|
-
var mediaElement = function () {
|
|
8
|
-
if (type === 'video') return document.createElement('video');
|
|
9
|
-
if (type === 'audio') return document.createElement('audio');
|
|
10
|
-
}();
|
|
11
|
-
if (!mediaElement) return Promise.resolve({
|
|
12
|
-
error: 'Unknown media element'
|
|
13
|
-
});
|
|
14
|
-
mediaElement.src = fileUrl;
|
|
15
|
-
return new Promise(function (resolve) {
|
|
16
|
-
mediaElement.onerror = function () {
|
|
17
|
-
return resolve({
|
|
18
|
-
error: 'onerror'
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
mediaElement.onloadedmetadata = function () {
|
|
22
|
-
resolve({
|
|
23
|
-
duration: mediaElement.duration * 1000,
|
|
24
|
-
type: type
|
|
25
|
-
}); // s => ms
|
|
26
|
-
};
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
export function getMediaType(url) {
|
|
30
|
-
var fileExpandedName = getFileExpandedName(url);
|
|
31
|
-
var type = getMediaTypeByExpandedName(fileExpandedName);
|
|
32
|
-
return type;
|
|
33
|
-
}
|
|
34
|
-
export function getMediaTypeByExpandedName(fileExpandedName) {
|
|
35
|
-
if (!fileExpandedName) return 'unknown';
|
|
36
|
-
if (/jpg|jpeg|png$/.test(fileExpandedName)) return 'image';
|
|
37
|
-
if (/mp3|wav$/.test(fileExpandedName)) return 'audio';
|
|
38
|
-
if (/avi|wmv|mpeg|mp4|m4v|mov|asf|flv|f4v|rmvb|rm|3gp|vob$/.test(fileExpandedName)) return 'video';
|
|
39
|
-
return 'unknown';
|
|
40
|
-
}
|
|
41
|
-
export function getMediaTypeByUrl(fileUrl) {
|
|
42
|
-
if (!fileUrl) return;
|
|
43
|
-
var fileExpandedName = getFileExpandedName(fileUrl);
|
|
44
|
-
return getMediaTypeByExpandedName(fileExpandedName);
|
|
45
|
-
}
|
|
46
|
-
export function getFileName(fileUrl) {
|
|
47
|
-
if (!fileUrl) return '';
|
|
48
|
-
var index1 = fileUrl.lastIndexOf('/');
|
|
49
|
-
var index2 = fileUrl.lastIndexOf('\\');
|
|
50
|
-
var index3 = fileUrl.lastIndexOf('\\\\');
|
|
51
|
-
var index = Math.max(index1, index2, index3);
|
|
52
|
-
var ext = fileUrl.substring(index + 1);
|
|
53
|
-
return ext;
|
|
54
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export default function setElementDataset(element, dataset) {
|
|
2
|
-
if (element) {
|
|
3
|
-
Object.keys(dataset).forEach(function (key) {
|
|
4
|
-
var value = dataset[key].toString();
|
|
5
|
-
if (element instanceof Element) {
|
|
6
|
-
element.setAttribute("data-".concat(key), value);
|
|
7
|
-
} else if (element instanceof Document) {
|
|
8
|
-
element.documentElement.setAttribute("data-".concat(key), value);
|
|
9
|
-
} else if (element instanceof HTMLElement) {
|
|
10
|
-
element.dataset[key] = value;
|
|
11
|
-
} else {
|
|
12
|
-
element.setAttribute("data-".concat(key), value);
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
}
|
package/lib/typings/VreoUnit.js
DELETED
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
export var VreoKeyframeEnum = /*#__PURE__*/function (VreoKeyframeEnum) {
|
|
2
|
-
/** 运镜 */
|
|
3
|
-
VreoKeyframeEnum["CameraMovement"] = "CameraMovement";
|
|
4
|
-
/**
|
|
5
|
-
* 全景标签
|
|
6
|
-
*/
|
|
7
|
-
VreoKeyframeEnum["PanoTag"] = "PanoTag";
|
|
8
|
-
/**
|
|
9
|
-
* 全景文本标签
|
|
10
|
-
*/
|
|
11
|
-
VreoKeyframeEnum["PanoTextLabel"] = "PanoTextLabel";
|
|
12
|
-
/**
|
|
13
|
-
* 提词器
|
|
14
|
-
*/
|
|
15
|
-
VreoKeyframeEnum["Prompter"] = "Prompter";
|
|
16
|
-
/**
|
|
17
|
-
* 更新 VR 全景
|
|
18
|
-
*/
|
|
19
|
-
VreoKeyframeEnum["UpdateVRPanorama"] = "UpdateVRPanorama";
|
|
20
|
-
/**
|
|
21
|
-
* 视频广告
|
|
22
|
-
*/
|
|
23
|
-
VreoKeyframeEnum["ModelVideo"] = "ModelVideo";
|
|
24
|
-
/**
|
|
25
|
-
* 全景特效
|
|
26
|
-
*/
|
|
27
|
-
VreoKeyframeEnum["PanoEffect"] = "PanoEffect";
|
|
28
|
-
/**
|
|
29
|
-
* 信息面板
|
|
30
|
-
*/
|
|
31
|
-
VreoKeyframeEnum["InfoPanel"] = "InfoPanel";
|
|
32
|
-
/**
|
|
33
|
-
* 视频特效
|
|
34
|
-
*/
|
|
35
|
-
VreoKeyframeEnum["VideoEffect"] = "VideoEffect";
|
|
36
|
-
/**
|
|
37
|
-
* 背景音乐
|
|
38
|
-
*/
|
|
39
|
-
VreoKeyframeEnum["BgMusic"] = "BgMusic";
|
|
40
|
-
/**
|
|
41
|
-
* 结束
|
|
42
|
-
*/
|
|
43
|
-
VreoKeyframeEnum["Exit"] = "Exit";
|
|
44
|
-
/**
|
|
45
|
-
* 自定义剧本帧
|
|
46
|
-
*/
|
|
47
|
-
VreoKeyframeEnum["Custom"] = "Custom";
|
|
48
|
-
return VreoKeyframeEnum;
|
|
49
|
-
}({});
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* 支持自定义剧本关键帧配置项
|
|
53
|
-
*/
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* 剧本关键帧
|
|
57
|
-
*/
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* 虚拟视频角色
|
|
61
|
-
*/
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* 剧本结构
|
|
65
|
-
*/
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* 剧本事件
|
|
69
|
-
*/
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* 相机运动
|
|
73
|
-
*/
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* 提词器
|
|
77
|
-
*/
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* VR 全景切换
|
|
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
|
-
export var PanoTagEnum = /*#__PURE__*/function (PanoTagEnum) {
|
|
111
|
-
PanoTagEnum["Text"] = "Text";
|
|
112
|
-
PanoTagEnum["Image"] = "Image";
|
|
113
|
-
return PanoTagEnum;
|
|
114
|
-
}({});
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* 标签样式种类
|
|
118
|
-
*/
|
|
119
|
-
export var PanoTagStyleEnum = /*#__PURE__*/function (PanoTagStyleEnum) {
|
|
120
|
-
/**
|
|
121
|
-
* 生长动画:默认值
|
|
122
|
-
*/
|
|
123
|
-
PanoTagStyleEnum["Growth"] = "Growth";
|
|
124
|
-
/**
|
|
125
|
-
* 展开动画
|
|
126
|
-
*/
|
|
127
|
-
PanoTagStyleEnum["Expand"] = "Expand";
|
|
128
|
-
return PanoTagStyleEnum;
|
|
129
|
-
}({});
|
|
130
|
-
/**
|
|
131
|
-
* 全景特效枚举
|
|
132
|
-
*/
|
|
133
|
-
export var PanoEffectEnum = /*#__PURE__*/function (PanoEffectEnum) {
|
|
134
|
-
/**
|
|
135
|
-
* 两点距离
|
|
136
|
-
*/
|
|
137
|
-
PanoEffectEnum["Distance"] = "Distance";
|
|
138
|
-
return PanoEffectEnum;
|
|
139
|
-
}({});
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* 全景特效
|
|
143
|
-
*/
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* 信息面板类型枚举
|
|
147
|
-
*/
|
|
148
|
-
export var InfoPanelTypeEnum = /*#__PURE__*/function (InfoPanelTypeEnum) {
|
|
149
|
-
InfoPanelTypeEnum["Image"] = "Image";
|
|
150
|
-
InfoPanelTypeEnum["Video"] = "Video";
|
|
151
|
-
return InfoPanelTypeEnum;
|
|
152
|
-
}({});
|
|
153
|
-
export var InfoPanelStyleEnum = /*#__PURE__*/function (InfoPanelStyleEnum) {
|
|
154
|
-
InfoPanelStyleEnum["Drawer"] = "Drawer";
|
|
155
|
-
InfoPanelStyleEnum["PopUp"] = "PopUp";
|
|
156
|
-
return InfoPanelStyleEnum;
|
|
157
|
-
}({});
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* 信息面板
|
|
161
|
-
*/
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* 视频特效
|
|
165
|
-
*/
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* 背景音乐
|
|
169
|
-
*/
|
|
170
|
-
|
|
171
|
-
/** 自定义序列帧 */
|
package/lib/typings/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./VreoUnit.js";
|