@realsee/vreo 2.6.4 → 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/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 -220
- 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 +1770 -437
- 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 -34
- package/lib/Player/App.js +0 -52
- package/lib/Player/Controller.js +0 -536
- package/lib/Player/PlaybackLifecycle.js +0 -118
- package/lib/Player/custom/SpatialScenePanel/index.js +0 -240
- package/lib/Player/hooks.js +0 -22
- package/lib/Player/modules/Drawer/index.js +0 -40
- 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 -456
- 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 -75
- package/lib/Player/modules/keyframes/InfoPanel/index.js +0 -170
- package/lib/Player/modules/keyframes/ModelVideo/index.js +0 -128
- 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 -154
- 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 -245
- package/lib/fivePlugins/CameraMovementPlugin/typings.js +0 -15
- package/lib/fivePlugins/ModelTVVideoPlugin/index.js +0 -349
- package/lib/shared-utils/Audio.js +0 -151
- package/lib/shared-utils/AudioLike.js +0 -123
- package/lib/shared-utils/Preloader.js +0 -37
- package/lib/shared-utils/addResizeListener.js +0 -39
- package/lib/shared-utils/animationFrame/BetterTween.js +0 -58
- package/lib/shared-utils/animationFrame/index.js +0 -52
- package/lib/shared-utils/animationFrame/tween.js +0 -58
- package/lib/shared-utils/createTransMatrix.js +0 -12
- package/lib/shared-utils/getFileExpandedName.js +0 -6
- package/lib/shared-utils/getMediaInfo.js +0 -55
- package/lib/shared-utils/setElementDataset.js +0 -16
- package/lib/typings/VreoUnit.js +0 -64
- 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,58 +0,0 @@
|
|
|
1
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
2
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
6
|
-
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
7
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
8
|
-
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); }; }
|
|
9
|
-
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; } }
|
|
10
|
-
import * as TWEEN from '@tweenjs/tween.js';
|
|
11
|
-
import { requestAnimationFrameInterval } from "./index.js";
|
|
12
|
-
export var BetterTween = /*#__PURE__*/function (_TWEEN$Tween) {
|
|
13
|
-
_inherits(BetterTween, _TWEEN$Tween);
|
|
14
|
-
var _super = _createSuper(BetterTween);
|
|
15
|
-
function BetterTween() {
|
|
16
|
-
var _this;
|
|
17
|
-
_classCallCheck(this, BetterTween);
|
|
18
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
19
|
-
args[_key] = arguments[_key];
|
|
20
|
-
}
|
|
21
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
22
|
-
_defineProperty(_assertThisInitialized(_this), "disposeMethods", []);
|
|
23
|
-
_defineProperty(_assertThisInitialized(_this), "onDispose", function (callback) {
|
|
24
|
-
_this.disposeMethods.push(callback);
|
|
25
|
-
return _assertThisInitialized(_this);
|
|
26
|
-
});
|
|
27
|
-
_defineProperty(_assertThisInitialized(_this), "play", function () {
|
|
28
|
-
_this.start();
|
|
29
|
-
_this.animationFrameDisposer = requestAnimationFrameInterval(function () {
|
|
30
|
-
return _this.update();
|
|
31
|
-
});
|
|
32
|
-
return _assertThisInitialized(_this);
|
|
33
|
-
});
|
|
34
|
-
_defineProperty(_assertThisInitialized(_this), "dispose", function () {
|
|
35
|
-
var _this$animationFrameD, _this2;
|
|
36
|
-
_this.stop();
|
|
37
|
-
(_this$animationFrameD = (_this2 = _this).animationFrameDisposer) === null || _this$animationFrameD === void 0 ? void 0 : _this$animationFrameD.call(_this2);
|
|
38
|
-
_this.disposeMethods.forEach(function (fn) {
|
|
39
|
-
return fn();
|
|
40
|
-
});
|
|
41
|
-
_this.disposeMethods = [];
|
|
42
|
-
TWEEN.remove(_assertThisInitialized(_this));
|
|
43
|
-
});
|
|
44
|
-
return _this;
|
|
45
|
-
}
|
|
46
|
-
return _createClass(BetterTween);
|
|
47
|
-
}(TWEEN.Tween);
|
|
48
|
-
export function tweenProgress(duration) {
|
|
49
|
-
var easing = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TWEEN.Easing.Linear.None;
|
|
50
|
-
var tween = new BetterTween({
|
|
51
|
-
progress: 0
|
|
52
|
-
}).to({
|
|
53
|
-
progress: 1
|
|
54
|
-
});
|
|
55
|
-
if (duration !== undefined) tween.duration(duration);
|
|
56
|
-
if (easing !== undefined) tween.easing(easing);
|
|
57
|
-
return tween;
|
|
58
|
-
}
|
|
@@ -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,58 +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()) {
|
|
46
|
-
destroyMethod();
|
|
47
|
-
}
|
|
48
|
-
cancelAnimationFrame();
|
|
49
|
-
};
|
|
50
|
-
return tween;
|
|
51
|
-
}
|
|
52
|
-
export function tweenProgress(duration, easing) {
|
|
53
|
-
return tween({
|
|
54
|
-
progress: 0
|
|
55
|
-
}, {
|
|
56
|
-
progress: 1
|
|
57
|
-
}, duration, easing);
|
|
58
|
-
}
|
|
@@ -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,55 +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
|
-
|
|
30
|
-
export function getMediaType(url) {
|
|
31
|
-
var fileExpandedName = getFileExpandedName(url);
|
|
32
|
-
var type = getMediaTypeByExpandedName(fileExpandedName);
|
|
33
|
-
return type;
|
|
34
|
-
}
|
|
35
|
-
export function getMediaTypeByExpandedName(fileExpandedName) {
|
|
36
|
-
if (!fileExpandedName) return 'unknown';
|
|
37
|
-
if (/jpg|jpeg|png$/.test(fileExpandedName)) return 'image';
|
|
38
|
-
if (/mp3|wav$/.test(fileExpandedName)) return 'audio';
|
|
39
|
-
if (/avi|wmv|mpeg|mp4|m4v|mov|asf|flv|f4v|rmvb|rm|3gp|vob$/.test(fileExpandedName)) return 'video';
|
|
40
|
-
return 'unknown';
|
|
41
|
-
}
|
|
42
|
-
export function getMediaTypeByUrl(fileUrl) {
|
|
43
|
-
if (!fileUrl) return;
|
|
44
|
-
var fileExpandedName = getFileExpandedName(fileUrl);
|
|
45
|
-
return getMediaTypeByExpandedName(fileExpandedName);
|
|
46
|
-
}
|
|
47
|
-
export function getFileName(fileUrl) {
|
|
48
|
-
if (!fileUrl) return '';
|
|
49
|
-
var index1 = fileUrl.lastIndexOf('/');
|
|
50
|
-
var index2 = fileUrl.lastIndexOf('\\');
|
|
51
|
-
var index3 = fileUrl.lastIndexOf('\\\\');
|
|
52
|
-
var index = Math.max(index1, index2, index3);
|
|
53
|
-
var ext = fileUrl.substring(index + 1);
|
|
54
|
-
return ext;
|
|
55
|
-
}
|
|
@@ -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,64 +0,0 @@
|
|
|
1
|
-
export var VreoKeyframeEnum;
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* 支持自定义剧本关键帧配置项
|
|
5
|
-
*/
|
|
6
|
-
(function (VreoKeyframeEnum) {
|
|
7
|
-
VreoKeyframeEnum["CameraMovement"] = "CameraMovement";
|
|
8
|
-
VreoKeyframeEnum["PanoTag"] = "PanoTag";
|
|
9
|
-
VreoKeyframeEnum["PanoTextLabel"] = "PanoTextLabel";
|
|
10
|
-
VreoKeyframeEnum["Prompter"] = "Prompter";
|
|
11
|
-
VreoKeyframeEnum["UpdateVRPanorama"] = "UpdateVRPanorama";
|
|
12
|
-
VreoKeyframeEnum["ModelVideo"] = "ModelVideo";
|
|
13
|
-
VreoKeyframeEnum["PanoEffect"] = "PanoEffect";
|
|
14
|
-
VreoKeyframeEnum["InfoPanel"] = "InfoPanel";
|
|
15
|
-
VreoKeyframeEnum["VideoEffect"] = "VideoEffect";
|
|
16
|
-
VreoKeyframeEnum["BgMusic"] = "BgMusic";
|
|
17
|
-
VreoKeyframeEnum["Exit"] = "Exit";
|
|
18
|
-
VreoKeyframeEnum["Custom"] = "Custom";
|
|
19
|
-
})(VreoKeyframeEnum || (VreoKeyframeEnum = {}));
|
|
20
|
-
/**
|
|
21
|
-
* 全景标签枚举
|
|
22
|
-
*/
|
|
23
|
-
export var PanoTagEnum;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* 标签样式种类
|
|
27
|
-
*/
|
|
28
|
-
(function (PanoTagEnum) {
|
|
29
|
-
PanoTagEnum["Text"] = "Text";
|
|
30
|
-
PanoTagEnum["Image"] = "Image";
|
|
31
|
-
})(PanoTagEnum || (PanoTagEnum = {}));
|
|
32
|
-
export var PanoTagStyleEnum;
|
|
33
|
-
(function (PanoTagStyleEnum) {
|
|
34
|
-
PanoTagStyleEnum["Growth"] = "Growth";
|
|
35
|
-
PanoTagStyleEnum["Expand"] = "Expand";
|
|
36
|
-
})(PanoTagStyleEnum || (PanoTagStyleEnum = {}));
|
|
37
|
-
/**
|
|
38
|
-
* 全景特效枚举
|
|
39
|
-
*/
|
|
40
|
-
export var PanoEffectEnum;
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* 全景特效
|
|
44
|
-
*/
|
|
45
|
-
(function (PanoEffectEnum) {
|
|
46
|
-
PanoEffectEnum["Distance"] = "Distance";
|
|
47
|
-
})(PanoEffectEnum || (PanoEffectEnum = {}));
|
|
48
|
-
/**
|
|
49
|
-
* 信息面板类型枚举
|
|
50
|
-
*/
|
|
51
|
-
export var InfoPanelTypeEnum;
|
|
52
|
-
(function (InfoPanelTypeEnum) {
|
|
53
|
-
InfoPanelTypeEnum["Image"] = "Image";
|
|
54
|
-
InfoPanelTypeEnum["Video"] = "Video";
|
|
55
|
-
})(InfoPanelTypeEnum || (InfoPanelTypeEnum = {}));
|
|
56
|
-
export var InfoPanelStyleEnum;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* 信息面板
|
|
60
|
-
*/
|
|
61
|
-
(function (InfoPanelStyleEnum) {
|
|
62
|
-
InfoPanelStyleEnum["Drawer"] = "Drawer";
|
|
63
|
-
InfoPanelStyleEnum["PopUp"] = "PopUp";
|
|
64
|
-
})(InfoPanelStyleEnum || (InfoPanelStyleEnum = {}));
|
package/lib/typings/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./VreoUnit.js";
|