@realsee/vreo 0.2.0-alpha.8 → 1.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/README.md +34 -3
- package/docs/assets/highlight.css +1 -1
- package/docs/assets/main.js +2 -2
- package/docs/assets/search.js +1 -1
- package/docs/assets/style.css +28 -2
- package/docs/classes/Player.AudioLike.html +52 -0
- package/docs/classes/Player.Controller.html +13 -13
- package/docs/classes/Player.Player-1.html +11 -11
- package/docs/classes/Player.VideoAgentMesh.html +53 -53
- package/docs/classes/Player.VideoAgentScene.html +1 -1
- package/docs/demo/assets/AppReact.d0ee843a.js +1 -0
- package/docs/demo/assets/default.63925584.js +3984 -0
- package/docs/demo/assets/default.f3f3ca8c.css +1 -0
- package/docs/demo/assets/dynamic.76506c2c.js +1 -0
- package/docs/demo/assets/examples.3d8323db.js +25 -0
- package/docs/demo/assets/examples.dac4a6fe.css +1 -0
- package/docs/demo/assets/index.7e31122c.js +1 -0
- package/docs/demo/assets/index.9331038f.css +1 -0
- package/docs/demo/assets/main.79b11b9d.js +1 -0
- package/docs/demo/assets/react.2ee8565f.css +1 -0
- package/docs/demo/assets/react.c1c07c14.js +25 -0
- package/docs/demo/assets/znRoyv06SZQeqA7m.0057e8ae.js +1 -0
- package/docs/demo/examples.html +17 -0
- package/docs/demo/index-react-dynamic.html +20 -0
- package/docs/demo/index-react.html +20 -0
- package/docs/demo/index.html +19 -0
- package/docs/enums/Player.InfoPanelStyleEnum.html +1 -1
- package/docs/enums/Player.InfoPanelTypeEnum.html +2 -2
- package/docs/enums/Player.PanoEffectEnum.html +2 -2
- package/docs/enums/Player.PanoTagEnum.html +2 -2
- package/docs/enums/Player.PanoTagStyleEnum.html +7 -0
- package/docs/enums/Player.VreoKeyframeEnum.html +12 -12
- package/docs/enums/fivePlugins.CameraMovementEffect.html +1 -1
- package/docs/enums/fivePlugins.Rotation.html +1 -1
- package/docs/index.html +13 -6
- package/docs/interfaces/Player.CustomVreoKeyframeProps.html +1 -1
- package/docs/interfaces/Player.PlayerConfigs.html +3 -3
- package/docs/interfaces/Player.Vertex.html +2 -2
- package/docs/interfaces/Player.VideoAgentMeshOptions.html +8 -1
- package/docs/interfaces/Player.VreoKeyframe.html +2 -2
- package/docs/interfaces/Player.VreoUnit.html +2 -2
- package/docs/interfaces/Player.VreoVideo.html +2 -2
- package/docs/interfaces/fivePlugins.CSS3DRenderPluginExportType.html +4 -0
- package/docs/interfaces/fivePlugins.CameraMovementOptsCallback.html +1 -1
- package/docs/interfaces/fivePlugins.CameraMovementPluginExportType.html +2 -2
- package/docs/interfaces/fivePlugins.CameraMovementPluginParameterType.html +1 -1
- package/docs/interfaces/fivePlugins.ModelTVVideoPluginData.html +1 -1
- package/docs/interfaces/fivePlugins.ModelTVVideoPluginExportType.html +1 -1
- package/docs/interfaces/fivePlugins.ModelTVVideoPluginParameterType.html +1 -1
- package/docs/interfaces/fivePlugins.Vector3Position.html +3 -0
- package/docs/interfaces/react.VreoActionCallbacks.html +15 -7
- package/docs/interfaces/react.VreoProviderProps.html +1 -1
- package/docs/modules/Player.html +21 -15
- package/docs/modules/custom.html +1 -1
- package/docs/modules/fivePlugins.html +5 -2
- package/docs/modules/react.html +1 -1
- package/docs/modules.html +1 -1
- package/lib/PlayController/index.js +3 -3
- package/lib/Player/App.js +5 -4
- package/lib/Player/Controller.d.ts +3 -1
- package/lib/Player/Controller.js +24 -5
- package/lib/Player/custom/SpatialScenePanel/index.js +3 -3
- package/lib/Player/index.d.ts +3 -2
- package/lib/Player/index.js +73 -42
- package/lib/Player/modules/Drawer/index.js +1 -1
- package/lib/Player/modules/PopUp/index.js +1 -1
- package/lib/Player/modules/VideoAgent/VideoAgentMesh.d.ts +17 -2
- package/lib/Player/modules/VideoAgent/VideoAgentMesh.js +113 -37
- package/lib/Player/modules/VideoAgent/VideoAgentScene.d.ts +5 -1
- package/lib/Player/modules/VideoAgent/VideoAgentScene.js +9 -4
- package/lib/Player/modules/VideoAgent/index.d.ts +2 -0
- package/lib/Player/modules/VideoAgent/index.js +2 -2
- package/lib/Player/modules/keyframes/BgMusic/index.js +1 -1
- package/lib/Player/modules/keyframes/CameraMovement/index.js +1 -1
- package/lib/Player/modules/keyframes/InfoPanel/index.js +2 -2
- package/lib/Player/modules/keyframes/ModelVideo/index.js +46 -9
- package/lib/Player/modules/keyframes/PanoEffect/index.js +1 -1
- package/lib/Player/modules/keyframes/PanoEffect/lineAnime.js +1 -1
- package/lib/Player/modules/keyframes/PanoTag/index.js +20 -7
- package/lib/Player/modules/keyframes/PanoTextLabel/index.d.ts +3 -0
- package/lib/Player/modules/keyframes/PanoTextLabel/index.js +97 -44
- package/lib/Player/modules/keyframes/Prompter/index.js +5 -19
- package/lib/Player/modules/keyframes/UpdateVRPanorama/index.js +10 -6
- package/lib/Player/modules/keyframes/VideoEffect/index.js +1 -1
- package/lib/Player/typings.d.ts +6 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/centerPoint.d.ts +2 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/centerPoint.js +12 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/createResizeObserver.d.ts +7 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/createResizeObserver.js +32 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/evenNumber.d.ts +3 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/evenNumber.js +11 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/index.d.ts +56 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/index.js +275 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.d.ts +7 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.js +18 -0
- package/lib/fivePlugins/CameraMovementPlugin/index.js +18 -14
- package/lib/fivePlugins/ModelTVVideoPlugin/index.js +1 -1
- package/lib/react/index.d.ts +7 -3
- package/lib/react/index.js +3 -3
- package/lib/shared-utils/AduioLike.d.ts +37 -0
- package/lib/shared-utils/AduioLike.js +165 -0
- package/lib/shared-utils/animationFrame/BetterTween.js +7 -3
- package/lib/shared-utils/animationFrame/tween.js +1 -1
- package/lib/shared-utils/createTransMatrix.d.ts +1 -0
- package/lib/shared-utils/createTransMatrix.js +43 -0
- package/lib/typings/VreoUnit.d.ts +33 -2
- package/lib/typings/VreoUnit.js +13 -1
- package/package.json +10 -10
- package/resources/PlayController/index.ts +0 -13
- package/resources/Player/App.tsx +7 -4
- package/resources/Player/Controller.ts +277 -146
- package/resources/Player/custom/SpatialScenePanel/index.tsx +5 -5
- package/resources/Player/hooks.ts +3 -5
- package/resources/Player/index.tsx +189 -141
- package/resources/Player/modules/ResizeObserver/index.tsx +23 -0
- package/resources/Player/modules/VideoAgent/VideoAgentMesh.ts +91 -34
- package/resources/Player/modules/VideoAgent/VideoAgentScene.ts +28 -25
- package/resources/Player/modules/VideoAgent/index.tsx +30 -13
- package/resources/Player/modules/Wave/index.tsx +18 -0
- package/resources/Player/modules/keyframes/InfoPanel/index.tsx +26 -11
- package/resources/Player/modules/keyframes/ModelVideo/index.tsx +36 -3
- package/resources/Player/modules/keyframes/PanoTag/index.tsx +53 -97
- package/resources/Player/modules/keyframes/PanoTextLabel/index.tsx +86 -34
- package/resources/Player/modules/keyframes/Prompter/index.tsx +6 -16
- package/resources/Player/modules/keyframes/UpdateVRPanorama/index.tsx +6 -2
- package/resources/Player/typings.ts +18 -1
- package/resources/fivePlugins/CSS3DRenderPlugin/centerPoint.ts +5 -0
- package/resources/fivePlugins/CSS3DRenderPlugin/createResizeObserver.ts +17 -0
- package/resources/fivePlugins/CSS3DRenderPlugin/evenNumber.ts +4 -0
- package/resources/fivePlugins/CSS3DRenderPlugin/index.ts +254 -0
- package/resources/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.ts +5 -0
- package/resources/fivePlugins/CameraMovementPlugin/index.ts +19 -12
- package/resources/react/index.tsx +7 -3
- package/resources/shared-utils/AduioLike.ts +109 -0
- package/resources/shared-utils/addResizeListener.ts +46 -0
- package/resources/shared-utils/createTransMatrix.ts +12 -0
- package/resources/shared-utils/getFileExpandedName.ts +6 -0
- package/resources/shared-utils/getMediaInfo.ts +52 -0
- package/resources/shared-utils/setElementDataset.ts +18 -0
- package/resources/typings/VreoUnit.ts +41 -3
- package/stylesheets/custom/SpatialScenePanel.css +2 -1
- package/stylesheets/default.css +348 -84
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = exports.AudioLike = void 0;
|
|
9
|
+
|
|
10
|
+
var _five = require("@realsee/five");
|
|
11
|
+
|
|
12
|
+
var _animationFrame = require("./animationFrame");
|
|
13
|
+
|
|
14
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
15
|
+
|
|
16
|
+
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, descriptor.key, descriptor); } }
|
|
17
|
+
|
|
18
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
19
|
+
|
|
20
|
+
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); }
|
|
21
|
+
|
|
22
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
23
|
+
|
|
24
|
+
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); }; }
|
|
25
|
+
|
|
26
|
+
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); }
|
|
27
|
+
|
|
28
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
29
|
+
|
|
30
|
+
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; } }
|
|
31
|
+
|
|
32
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
33
|
+
|
|
34
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* 模拟 `<Audio>` 功能:没有音频,但执行逻辑跟 `<Audio>` 相似。
|
|
38
|
+
*/
|
|
39
|
+
var AudioLike = /*#__PURE__*/function (_Subscribe) {
|
|
40
|
+
_inherits(AudioLike, _Subscribe);
|
|
41
|
+
|
|
42
|
+
var _super = _createSuper(AudioLike);
|
|
43
|
+
|
|
44
|
+
function AudioLike() {
|
|
45
|
+
var _this;
|
|
46
|
+
|
|
47
|
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
48
|
+
duration = _ref.duration;
|
|
49
|
+
|
|
50
|
+
_classCallCheck(this, AudioLike);
|
|
51
|
+
|
|
52
|
+
_this = _super.call(this);
|
|
53
|
+
|
|
54
|
+
_defineProperty(_assertThisInitialized(_this), "$timestamp", 0);
|
|
55
|
+
|
|
56
|
+
_defineProperty(_assertThisInitialized(_this), "$currentTime", 0);
|
|
57
|
+
|
|
58
|
+
_defineProperty(_assertThisInitialized(_this), "$duration", 0);
|
|
59
|
+
|
|
60
|
+
_defineProperty(_assertThisInitialized(_this), "muted", false);
|
|
61
|
+
|
|
62
|
+
_defineProperty(_assertThisInitialized(_this), "src", '');
|
|
63
|
+
|
|
64
|
+
if (duration) {
|
|
65
|
+
_this.$duration = duration;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return _this;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
_createClass(AudioLike, [{
|
|
72
|
+
key: "setAttribute",
|
|
73
|
+
value: function setAttribute(name, value) {// nothing todo
|
|
74
|
+
}
|
|
75
|
+
}, {
|
|
76
|
+
key: "play",
|
|
77
|
+
value: function play() {
|
|
78
|
+
var _this2 = this;
|
|
79
|
+
|
|
80
|
+
if (this.$timestamp === 0) {
|
|
81
|
+
this.$timestamp = performance.now();
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (this.$currentTime === this.$duration) {
|
|
85
|
+
this.$currentTime = 0;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
this.stopInterval = (0, _animationFrame.requestAnimationFrameInterval)(function () {
|
|
89
|
+
return _this2.requestAnimationFrameLoop();
|
|
90
|
+
});
|
|
91
|
+
this.emit('play');
|
|
92
|
+
}
|
|
93
|
+
}, {
|
|
94
|
+
key: "pause",
|
|
95
|
+
value: function pause() {
|
|
96
|
+
if (this.stopInterval) {
|
|
97
|
+
this.stopInterval();
|
|
98
|
+
this.emit('pause');
|
|
99
|
+
this.stopInterval = undefined;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
this.$timestamp = 0;
|
|
103
|
+
}
|
|
104
|
+
}, {
|
|
105
|
+
key: "requestAnimationFrameLoop",
|
|
106
|
+
value: function requestAnimationFrameLoop() {
|
|
107
|
+
var now = performance.now();
|
|
108
|
+
this.$currentTime = now - this.$timestamp;
|
|
109
|
+
this.emit('timeupdate');
|
|
110
|
+
|
|
111
|
+
if (this.$currentTime >= this.$duration - 10) {
|
|
112
|
+
this.$currentTime = this.$duration;
|
|
113
|
+
this.pause();
|
|
114
|
+
this.emit('ended');
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}, {
|
|
118
|
+
key: "currentTime",
|
|
119
|
+
get: function get() {
|
|
120
|
+
return this.$currentTime / 1000;
|
|
121
|
+
},
|
|
122
|
+
set: function set(time) {
|
|
123
|
+
this.$currentTime = time;
|
|
124
|
+
}
|
|
125
|
+
}, {
|
|
126
|
+
key: "duration",
|
|
127
|
+
get: function get() {
|
|
128
|
+
return this.$duration;
|
|
129
|
+
},
|
|
130
|
+
set: function set(duration) {
|
|
131
|
+
this.pause();
|
|
132
|
+
this.$duration = duration;
|
|
133
|
+
this.$timestamp = 0;
|
|
134
|
+
this.$currentTime = 0;
|
|
135
|
+
}
|
|
136
|
+
}, {
|
|
137
|
+
key: "ended",
|
|
138
|
+
get: function get() {
|
|
139
|
+
return this.$currentTime === this.$duration;
|
|
140
|
+
}
|
|
141
|
+
}, {
|
|
142
|
+
key: "paused",
|
|
143
|
+
get: function get() {
|
|
144
|
+
return !this.stopInterval;
|
|
145
|
+
}
|
|
146
|
+
}, {
|
|
147
|
+
key: "addEventListener",
|
|
148
|
+
value: function addEventListener(evtName, callback) {
|
|
149
|
+
var useCapture = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
150
|
+
this.on(evtName, callback);
|
|
151
|
+
}
|
|
152
|
+
}, {
|
|
153
|
+
key: "removeEventListener",
|
|
154
|
+
value: function removeEventListener(evtName, callback) {
|
|
155
|
+
var useCapture = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
156
|
+
this.off(evtName, callback);
|
|
157
|
+
}
|
|
158
|
+
}]);
|
|
159
|
+
|
|
160
|
+
return AudioLike;
|
|
161
|
+
}(_five.Subscribe);
|
|
162
|
+
|
|
163
|
+
exports.AudioLike = AudioLike;
|
|
164
|
+
var _default = AudioLike;
|
|
165
|
+
exports["default"] = _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -14,9 +14,13 @@ var _ = require(".");
|
|
|
14
14
|
|
|
15
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
16
16
|
|
|
17
|
+
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, descriptor.key, descriptor); } }
|
|
18
|
+
|
|
19
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
20
|
+
|
|
17
21
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
18
22
|
|
|
19
|
-
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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
23
|
+
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); }
|
|
20
24
|
|
|
21
25
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
22
26
|
|
|
@@ -84,7 +88,7 @@ var BetterTween = /*#__PURE__*/function (_TWEEN$Tween) {
|
|
|
84
88
|
return _this;
|
|
85
89
|
}
|
|
86
90
|
|
|
87
|
-
return BetterTween;
|
|
91
|
+
return _createClass(BetterTween);
|
|
88
92
|
}(_tween["default"].Tween);
|
|
89
93
|
|
|
90
94
|
exports.BetterTween = BetterTween;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createTransMatrix(arr1: number[]): (arr2: number[]) => number[];
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.createTransMatrix = createTransMatrix;
|
|
9
|
+
|
|
10
|
+
var THREE = _interopRequireWildcard(require("three"));
|
|
11
|
+
|
|
12
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
+
|
|
14
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
|
+
|
|
16
|
+
function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
|
|
17
|
+
|
|
18
|
+
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; } }
|
|
19
|
+
|
|
20
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
21
|
+
|
|
22
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
23
|
+
|
|
24
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
25
|
+
|
|
26
|
+
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); }
|
|
27
|
+
|
|
28
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
29
|
+
|
|
30
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
31
|
+
|
|
32
|
+
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; }
|
|
33
|
+
|
|
34
|
+
function createTransMatrix(arr1) {
|
|
35
|
+
var matrix4 = new THREE.Matrix4();
|
|
36
|
+
matrix4.fromArray(arr1);
|
|
37
|
+
return function (arr2) {
|
|
38
|
+
var vector3 = _construct(THREE.Vector3, _toConsumableArray(arr2));
|
|
39
|
+
|
|
40
|
+
vector3.applyMatrix4(matrix4);
|
|
41
|
+
return vector3.toArray();
|
|
42
|
+
};
|
|
43
|
+
}
|
|
@@ -98,6 +98,7 @@ export declare type VreoKeyframeEvent = {
|
|
|
98
98
|
paused: (ended?: boolean) => void;
|
|
99
99
|
playing: () => void;
|
|
100
100
|
unknownKeyframeType: (keyframe: Record<string, any>) => void;
|
|
101
|
+
ended: () => void;
|
|
101
102
|
};
|
|
102
103
|
/**
|
|
103
104
|
* 相机运动
|
|
@@ -147,9 +148,13 @@ export interface Vertex {
|
|
|
147
148
|
z: number;
|
|
148
149
|
}
|
|
149
150
|
/**
|
|
150
|
-
*
|
|
151
|
+
* 矩形顶点
|
|
151
152
|
*/
|
|
152
153
|
export declare type QuadrangleVertexs = [Vertex, Vertex, Vertex, Vertex];
|
|
154
|
+
/**
|
|
155
|
+
* 顶点数组
|
|
156
|
+
*/
|
|
157
|
+
export declare type Vertexs = Vertex[];
|
|
153
158
|
/**
|
|
154
159
|
* 视频广告
|
|
155
160
|
*/
|
|
@@ -165,7 +170,17 @@ export declare type ModelVideoData = {
|
|
|
165
170
|
/**
|
|
166
171
|
* 视频映射在模型中的顶点
|
|
167
172
|
*/
|
|
168
|
-
vertexs: QuadrangleVertexs;
|
|
173
|
+
vertexs: QuadrangleVertexs | Vertexs;
|
|
174
|
+
matrixWorld?: number[];
|
|
175
|
+
};
|
|
176
|
+
/**
|
|
177
|
+
* 四元数
|
|
178
|
+
*/
|
|
179
|
+
export declare type Quaternion = {
|
|
180
|
+
x: number;
|
|
181
|
+
y: number;
|
|
182
|
+
z: number;
|
|
183
|
+
w: number;
|
|
169
184
|
};
|
|
170
185
|
/**
|
|
171
186
|
* 全景文本标签
|
|
@@ -173,6 +188,8 @@ export declare type ModelVideoData = {
|
|
|
173
188
|
export declare type PanoTextLabelData = {
|
|
174
189
|
text: string;
|
|
175
190
|
vertex: Vertex;
|
|
191
|
+
normal?: Vertex;
|
|
192
|
+
quaternion?: Quaternion;
|
|
176
193
|
fontSize?: number;
|
|
177
194
|
};
|
|
178
195
|
/**
|
|
@@ -182,8 +199,22 @@ export declare enum PanoTagEnum {
|
|
|
182
199
|
Text = "Text",
|
|
183
200
|
Image = "Image"
|
|
184
201
|
}
|
|
202
|
+
/**
|
|
203
|
+
* 标签样式种类
|
|
204
|
+
*/
|
|
205
|
+
export declare enum PanoTagStyleEnum {
|
|
206
|
+
/**
|
|
207
|
+
* 生长动画:默认值
|
|
208
|
+
*/
|
|
209
|
+
Growth = "Growth",
|
|
210
|
+
/**
|
|
211
|
+
* 展开动画
|
|
212
|
+
*/
|
|
213
|
+
Expand = "Expand"
|
|
214
|
+
}
|
|
185
215
|
export declare type PanoTagData = {
|
|
186
216
|
type: PanoTagEnum;
|
|
217
|
+
style: PanoTagStyleEnum;
|
|
187
218
|
text: string;
|
|
188
219
|
vertex: Vertex;
|
|
189
220
|
imgUrl?: string;
|
package/lib/typings/VreoUnit.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.VreoKeyframeEnum = exports.PanoTagEnum = exports.PanoEffectEnum = exports.InfoPanelTypeEnum = exports.InfoPanelStyleEnum = void 0;
|
|
6
|
+
exports.VreoKeyframeEnum = exports.PanoTagStyleEnum = exports.PanoTagEnum = exports.PanoEffectEnum = exports.InfoPanelTypeEnum = exports.InfoPanelStyleEnum = void 0;
|
|
7
7
|
var VreoKeyframeEnum;
|
|
8
8
|
/**
|
|
9
9
|
* 支持自定义剧本关键帧配置项
|
|
@@ -30,6 +30,10 @@ exports.VreoKeyframeEnum = VreoKeyframeEnum;
|
|
|
30
30
|
* 全景标签枚举
|
|
31
31
|
*/
|
|
32
32
|
var PanoTagEnum;
|
|
33
|
+
/**
|
|
34
|
+
* 标签样式种类
|
|
35
|
+
*/
|
|
36
|
+
|
|
33
37
|
exports.PanoTagEnum = PanoTagEnum;
|
|
34
38
|
|
|
35
39
|
(function (PanoTagEnum) {
|
|
@@ -37,6 +41,14 @@ exports.PanoTagEnum = PanoTagEnum;
|
|
|
37
41
|
PanoTagEnum["Image"] = "Image";
|
|
38
42
|
})(PanoTagEnum || (exports.PanoTagEnum = PanoTagEnum = {}));
|
|
39
43
|
|
|
44
|
+
var PanoTagStyleEnum;
|
|
45
|
+
exports.PanoTagStyleEnum = PanoTagStyleEnum;
|
|
46
|
+
|
|
47
|
+
(function (PanoTagStyleEnum) {
|
|
48
|
+
PanoTagStyleEnum["Growth"] = "Growth";
|
|
49
|
+
PanoTagStyleEnum["Expand"] = "Expand";
|
|
50
|
+
})(PanoTagStyleEnum || (exports.PanoTagStyleEnum = PanoTagStyleEnum = {}));
|
|
51
|
+
|
|
40
52
|
/**
|
|
41
53
|
* 全景特效枚举
|
|
42
54
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@realsee/vreo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-alpha.1",
|
|
4
4
|
"description": "Vreo (VR Video 缩写) 是基于如视三维渲染引擎 Five 和 用户界面构建库 React 实现的如视 3D 空间剧本播放器。",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"realsee",
|
|
@@ -15,19 +15,20 @@
|
|
|
15
15
|
"resources",
|
|
16
16
|
"docs",
|
|
17
17
|
"stylesheets",
|
|
18
|
-
"LICENSE"
|
|
18
|
+
"LICENSE",
|
|
19
|
+
"CHANGELOG.md"
|
|
19
20
|
],
|
|
20
21
|
"scripts": {
|
|
21
22
|
"dev": "vite --port=3088 --host 0.0.0.0",
|
|
22
23
|
"build": "tsc && vite build",
|
|
23
24
|
"preview": "vite preview",
|
|
24
|
-
"docs": "npx typedoc",
|
|
25
|
+
"docs": "npx typedoc && yarn run build",
|
|
25
26
|
"packages": "node ./dev-tools/build-packages.js"
|
|
26
27
|
},
|
|
27
28
|
"peerDependencies": {
|
|
28
29
|
"@realsee/five": "^5.0.0-alpha.103",
|
|
29
|
-
"react": "^
|
|
30
|
-
"react-dom": "^
|
|
30
|
+
"react": "^17.0.0",
|
|
31
|
+
"react-dom": "^17.0.0"
|
|
31
32
|
},
|
|
32
33
|
"devDependencies": {
|
|
33
34
|
"@babel/cli": "^7.16.0",
|
|
@@ -35,8 +36,8 @@
|
|
|
35
36
|
"@babel/preset-env": "^7.16.4",
|
|
36
37
|
"@babel/preset-react": "^7.16.0",
|
|
37
38
|
"@babel/preset-typescript": "^7.16.0",
|
|
38
|
-
"@realsee/dnalogel": "^
|
|
39
|
-
"@realsee/five": "
|
|
39
|
+
"@realsee/dnalogel": "^2.1.0-alpha.17",
|
|
40
|
+
"@realsee/five": "5.0.0-alpha.149",
|
|
40
41
|
"@types/offscreencanvas": "^2019.6.4",
|
|
41
42
|
"@types/react": "^17.0.37",
|
|
42
43
|
"@types/react-dom": "^17.0.11",
|
|
@@ -47,14 +48,13 @@
|
|
|
47
48
|
"react-dom": "^16.0.0",
|
|
48
49
|
"three": "^0.117.1",
|
|
49
50
|
"typedoc": "^0.22.10",
|
|
50
|
-
"typescript": "
|
|
51
|
+
"typescript": "4.7.4",
|
|
51
52
|
"vite": "^2.6.14"
|
|
52
53
|
},
|
|
53
54
|
"dependencies": {
|
|
54
55
|
"@tweenjs/tween.js": "18.6.4",
|
|
55
56
|
"classnames": "^2.3.1",
|
|
56
57
|
"mobx": "^6.3.7",
|
|
57
|
-
"mobx-react": "^7.2.1"
|
|
58
|
-
"react-transition-group": "^4.4.2"
|
|
58
|
+
"mobx-react": "^7.2.1"
|
|
59
59
|
}
|
|
60
60
|
}
|
|
@@ -152,16 +152,3 @@ export class PlayController extends Subscribe<VreoKeyframeEvent> {
|
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
|
|
156
|
-
console.log(`
|
|
157
|
-
|
|
158
|
-
┏━━━┓━━━━━━━━━┏┓━━━━━━━━━━━━━
|
|
159
|
-
┃┏━┓┃━━━━━━━━━┃┃━━━━━━━━━━━━━
|
|
160
|
-
┃┗━┛┃┏━━┓┏━━┓━┃┃━┏━━┓┏━━┓┏━━┓
|
|
161
|
-
┃┏┓┏┛┃┏┓┃┗━┓┃━┃┃━┃━━┫┃┏┓┃┃┏┓┃
|
|
162
|
-
┃┃┃┗┓┃┃━┫┃┗┛┗┓┃┗┓┣━━┃┃┃━┫┃┃━┫
|
|
163
|
-
┗┛┗━┛┗━━┛┗━━━┛┗━┛┗━━┛┗━━┛┗━━┛
|
|
164
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
165
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
166
|
-
|
|
167
|
-
`)
|
package/resources/Player/App.tsx
CHANGED
|
@@ -2,8 +2,9 @@ import * as React from 'react'
|
|
|
2
2
|
import classNames from 'classnames'
|
|
3
3
|
import { observer } from 'mobx-react'
|
|
4
4
|
import { Controller } from './Controller'
|
|
5
|
-
import { useController
|
|
5
|
+
import { useController } from './hooks'
|
|
6
6
|
import { CameraMovement } from './modules/keyframes/CameraMovement'
|
|
7
|
+
import { ResizeObserver } from './modules/ResizeObserver'
|
|
7
8
|
import { InfoPanel } from './modules/keyframes/InfoPanel'
|
|
8
9
|
import { ModelVideo } from './modules/keyframes/ModelVideo'
|
|
9
10
|
import { PanoEffect } from './modules/keyframes/PanoEffect'
|
|
@@ -14,8 +15,10 @@ import { UpdateVRPanorama } from './modules/keyframes/UpdateVRPanorama'
|
|
|
14
15
|
import { VideoEffect } from './modules/keyframes/VideoEffect'
|
|
15
16
|
import { VideoAgent } from './modules/VideoAgent'
|
|
16
17
|
import { BgMusic } from './modules/keyframes/BgMusic'
|
|
18
|
+
import { Wave } from './modules/Wave'
|
|
17
19
|
|
|
18
20
|
const AppView = observer(({ controller }: { controller: Controller }) => {
|
|
21
|
+
|
|
19
22
|
return (
|
|
20
23
|
<div
|
|
21
24
|
className={classNames('vreo-panel', {
|
|
@@ -23,17 +26,16 @@ const AppView = observer(({ controller }: { controller: Controller }) => {
|
|
|
23
26
|
})}
|
|
24
27
|
>
|
|
25
28
|
<div className="vreo-panel-inner">
|
|
29
|
+
{controller.waveAppearance && <Wave appearance={controller.waveAppearance}/>}
|
|
26
30
|
<VideoAgent
|
|
27
31
|
onClick={() => {
|
|
28
|
-
if (controller.isAudio) {
|
|
29
|
-
return
|
|
30
|
-
}
|
|
31
32
|
if (controller.playing) {
|
|
32
33
|
controller.setPlaying(false)
|
|
33
34
|
} else {
|
|
34
35
|
controller.setPlaying(true)
|
|
35
36
|
}
|
|
36
37
|
}}
|
|
38
|
+
options={controller.configs?.videoAgentMeshOptions || {}}
|
|
37
39
|
/>
|
|
38
40
|
<Prompter />
|
|
39
41
|
{controller.configs?.customPanelChildren}
|
|
@@ -47,6 +49,7 @@ export function App() {
|
|
|
47
49
|
return (
|
|
48
50
|
<>
|
|
49
51
|
<>
|
|
52
|
+
<ResizeObserver />
|
|
50
53
|
<CameraMovement />
|
|
51
54
|
<ModelVideo />
|
|
52
55
|
<UpdateVRPanorama />
|