@realsee/vreo 1.0.0-alpha.17 → 1.0.0-alpha.19
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 +6 -1
- package/docs/demo/assets/{AppReact.a3fc45d3.js → AppReact.20163f9a.js} +1 -1
- package/docs/demo/assets/default.5069891b.js +3988 -0
- package/docs/demo/assets/{dynamic.714b9eb8.js → dynamic.c8118cc9.js} +1 -1
- package/docs/demo/assets/{examples.1a6f5a2c.js → examples.5391fc1f.js} +1 -1
- package/docs/demo/assets/{index.0ca9e9d3.js → index.2272a9ef.js} +1 -1
- package/docs/demo/assets/main.b335b989.js +1 -0
- package/docs/demo/assets/{react.fca6a967.js → react.efea3f3f.js} +1 -1
- package/docs/demo/examples.html +2 -2
- package/docs/demo/index-react-dynamic.html +4 -4
- package/docs/demo/index-react.html +4 -4
- package/docs/demo/index.html +3 -3
- package/lib/PlayController/createHTMLAudioElement.js +11 -6
- package/lib/PlayController/index.js +81 -16
- package/lib/Player/App.js +24 -0
- package/lib/Player/Controller.d.ts +2 -2
- package/lib/Player/Controller.js +95 -19
- package/lib/Player/custom/SpatialScenePanel/index.js +68 -42
- package/lib/Player/hooks.js +10 -0
- package/lib/Player/index.js +85 -25
- package/lib/Player/modules/Drawer/index.js +17 -0
- package/lib/Player/modules/PopUp/index.js +10 -0
- package/lib/Player/modules/ResizeObserver/index.js +8 -0
- package/lib/Player/modules/VideoAgent/VideoAgentMesh.d.ts +2 -2
- package/lib/Player/modules/VideoAgent/VideoAgentMesh.js +114 -20
- package/lib/Player/modules/VideoAgent/VideoAgentScene.js +24 -2
- package/lib/Player/modules/VideoAgent/index.js +17 -0
- package/lib/Player/modules/Wave/index.js +32 -7
- package/lib/Player/modules/keyframes/BgMusic/index.js +44 -14
- package/lib/Player/modules/keyframes/CameraMovement/index.js +27 -3
- package/lib/Player/modules/keyframes/InfoPanel/index.js +25 -8
- package/lib/Player/modules/keyframes/ModelVideo/index.js +29 -3
- package/lib/Player/modules/keyframes/PanoEffect/index.js +43 -15
- package/lib/Player/modules/keyframes/PanoEffect/lineAnime.js +7 -0
- package/lib/Player/modules/keyframes/PanoTag/index.js +21 -4
- package/lib/Player/modules/keyframes/PanoTextLabel/index.js +47 -22
- package/lib/Player/modules/keyframes/Prompter/index.js +32 -10
- package/lib/Player/modules/keyframes/UpdateVRPanorama/index.js +25 -18
- package/lib/Player/modules/keyframes/VideoEffect/index.js +47 -12
- package/lib/fivePlugins/CSS3DRenderPlugin/centerPoint.js +2 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/createResizeObserver.js +1 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/evenNumber.js +1 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/index.js +60 -19
- package/lib/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.js +5 -2
- package/lib/fivePlugins/CameraMovementPlugin/index.js +75 -28
- package/lib/fivePlugins/CameraMovementPlugin/typings.js +4 -0
- package/lib/fivePlugins/ModelTVVideoPlugin/index.js +60 -11
- package/lib/index.js +1 -0
- package/lib/react/index.js +34 -7
- package/lib/shared-utils/{AduioLike.d.ts → AudioLike.d.ts} +0 -0
- package/lib/shared-utils/{AduioLike.js → AudioLike.js} +43 -11
- package/lib/shared-utils/Preloader.js +7 -0
- package/lib/shared-utils/addResizeListener.js +5 -0
- package/lib/shared-utils/animationFrame/BetterTween.js +38 -2
- package/lib/shared-utils/animationFrame/index.js +10 -2
- package/lib/shared-utils/animationFrame/tween.js +15 -2
- package/lib/shared-utils/createTransMatrix.js +17 -2
- package/lib/shared-utils/getFileExpandedName.js +1 -0
- package/lib/shared-utils/getMediaInfo.js +9 -0
- package/lib/shared-utils/setElementDataset.js +2 -0
- package/lib/typings/VreoUnit.d.ts +5 -5
- package/lib/typings/VreoUnit.js +15 -0
- package/package.json +1 -1
- package/resources/PlayController/index.ts +1 -1
- package/resources/Player/Controller.ts +3 -3
- package/resources/Player/index.tsx +1 -1
- package/resources/Player/modules/VideoAgent/VideoAgentMesh.ts +2 -2
- package/resources/Player/modules/keyframes/BgMusic/index.tsx +23 -14
- package/resources/Player/modules/keyframes/PanoTag/index.tsx +1 -0
- package/resources/shared-utils/{AduioLike.ts → AudioLike.ts} +4 -6
- package/resources/typings/VreoUnit.ts +5 -5
- package/docs/demo/assets/default.9985006b.js +0 -3988
- package/docs/demo/assets/main.7963f418.js +0 -1
package/lib/Player/index.js
CHANGED
|
@@ -1,59 +1,93 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
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
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.Player = void 0;
|
|
9
|
+
|
|
8
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
9
12
|
var ReactDOM = _interopRequireWildcard(require("react-dom"));
|
|
13
|
+
|
|
10
14
|
var _five = require("@realsee/five");
|
|
15
|
+
|
|
11
16
|
var _App = require("./App");
|
|
17
|
+
|
|
12
18
|
var _Controller = require("./Controller");
|
|
19
|
+
|
|
13
20
|
var _VreoUnit = require("../typings/VreoUnit");
|
|
21
|
+
|
|
14
22
|
var _mobx = require("mobx");
|
|
23
|
+
|
|
15
24
|
var _Drawer = require("./modules/Drawer");
|
|
25
|
+
|
|
16
26
|
var _PopUp = require("./modules/PopUp");
|
|
27
|
+
|
|
17
28
|
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); }
|
|
29
|
+
|
|
18
30
|
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; }
|
|
19
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
31
|
+
|
|
20
32
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
33
|
+
|
|
21
34
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
35
|
+
|
|
22
36
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
37
|
+
|
|
23
38
|
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); } }
|
|
39
|
+
|
|
24
40
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
41
|
+
|
|
25
42
|
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); }
|
|
26
|
-
|
|
43
|
+
|
|
44
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
45
|
+
|
|
27
46
|
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); }; }
|
|
47
|
+
|
|
28
48
|
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); }
|
|
49
|
+
|
|
29
50
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
51
|
+
|
|
30
52
|
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
|
-
|
|
53
|
+
|
|
54
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
55
|
+
|
|
32
56
|
var Player = /*#__PURE__*/function (_Subscribe) {
|
|
33
57
|
_inherits(Player, _Subscribe);
|
|
58
|
+
|
|
34
59
|
var _super = _createSuper(Player);
|
|
60
|
+
|
|
35
61
|
function Player(five) {
|
|
36
62
|
var _this;
|
|
63
|
+
|
|
37
64
|
var configs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
65
|
+
|
|
38
66
|
_classCallCheck(this, Player);
|
|
67
|
+
|
|
39
68
|
_this = _super.call(this);
|
|
40
69
|
_this.$five = five;
|
|
70
|
+
|
|
41
71
|
if (!configs.container) {
|
|
42
72
|
configs.container = configs.containter;
|
|
43
73
|
}
|
|
74
|
+
|
|
44
75
|
if (!configs.container) {
|
|
45
76
|
var _five$getElement;
|
|
77
|
+
|
|
46
78
|
var container = document.getElementById('vreo-app') || document.createElement('div');
|
|
47
79
|
ReactDOM.unmountComponentAtNode(container);
|
|
48
80
|
container.setAttribute('id', 'vreo-app');
|
|
49
81
|
configs.container = container;
|
|
50
82
|
var fiveCanvasDomParent = (_five$getElement = five.getElement()) === null || _five$getElement === void 0 ? void 0 : _five$getElement.parentNode;
|
|
83
|
+
|
|
51
84
|
if (fiveCanvasDomParent) {
|
|
52
85
|
fiveCanvasDomParent.append(container);
|
|
53
86
|
} else {
|
|
54
87
|
document.body.append(container);
|
|
55
88
|
}
|
|
56
89
|
}
|
|
90
|
+
|
|
57
91
|
if (!configs.container.classList.contains('vreo-app')) configs.container.classList.add('vreo-app');
|
|
58
92
|
_this.configs = Object.freeze(Object.assign({
|
|
59
93
|
keyframeMap: {}
|
|
@@ -81,9 +115,8 @@ var Player = /*#__PURE__*/function (_Subscribe) {
|
|
|
81
115
|
},
|
|
82
116
|
five: five
|
|
83
117
|
});
|
|
84
|
-
})), configs.container);
|
|
118
|
+
})), configs.container); // 监听播放情况:抛出触发时机
|
|
85
119
|
|
|
86
|
-
// 监听播放情况:抛出触发时机
|
|
87
120
|
(0, _mobx.reaction)(function () {
|
|
88
121
|
return _this.controller.ended;
|
|
89
122
|
}, function (ended) {
|
|
@@ -100,23 +133,25 @@ var Player = /*#__PURE__*/function (_Subscribe) {
|
|
|
100
133
|
});
|
|
101
134
|
return _this;
|
|
102
135
|
}
|
|
136
|
+
|
|
103
137
|
_createClass(Player, [{
|
|
104
138
|
key: "load",
|
|
105
139
|
value: function () {
|
|
106
|
-
var _load = _asyncToGenerator( /*#__PURE__*/
|
|
140
|
+
var _load = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(vreoUnit) {
|
|
107
141
|
var _this$controller$medi,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
142
|
+
_this$configs$imageOp,
|
|
143
|
+
_this$controller$vide,
|
|
144
|
+
_this$controller$vide2,
|
|
145
|
+
_this2 = this;
|
|
146
|
+
|
|
112
147
|
var currentTime,
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
return
|
|
148
|
+
preload,
|
|
149
|
+
force,
|
|
150
|
+
panoIndexMap,
|
|
151
|
+
panoIndexes,
|
|
152
|
+
i,
|
|
153
|
+
_args = arguments;
|
|
154
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
120
155
|
while (1) {
|
|
121
156
|
switch (_context.prev = _context.next) {
|
|
122
157
|
case 0:
|
|
@@ -124,87 +159,105 @@ var Player = /*#__PURE__*/function (_Subscribe) {
|
|
|
124
159
|
preload = _args.length > 2 && _args[2] !== undefined ? _args[2] : false;
|
|
125
160
|
force = _args.length > 3 && _args[3] !== undefined ? _args[3] : false;
|
|
126
161
|
this.controller.setLoading(true);
|
|
162
|
+
|
|
127
163
|
if (force) {
|
|
128
164
|
vreoUnit = JSON.parse(JSON.stringify(vreoUnit));
|
|
129
165
|
}
|
|
166
|
+
|
|
130
167
|
if (this.controller.visible) {
|
|
131
168
|
_context.next = 9;
|
|
132
169
|
break;
|
|
133
170
|
}
|
|
134
|
-
|
|
135
|
-
// 延迟 500ms 规避跟 DOM 动画冲突
|
|
171
|
+
|
|
172
|
+
this.controller.setVisible(true); // 延迟 500ms 规避跟 DOM 动画冲突
|
|
173
|
+
|
|
136
174
|
_context.next = 9;
|
|
137
175
|
return new Promise(function (resolve) {
|
|
138
176
|
setTimeout(function () {
|
|
139
177
|
return resolve(true);
|
|
140
178
|
}, 500);
|
|
141
179
|
});
|
|
180
|
+
|
|
142
181
|
case 9:
|
|
143
182
|
if (this.controller.stopInterval) {
|
|
144
183
|
this.controller.stopInterval();
|
|
145
184
|
this.controller.stopInterval = undefined;
|
|
146
185
|
}
|
|
147
|
-
this.controller.vreoUnit = vreoUnit;
|
|
148
|
-
(_this$controller$medi = this.controller.mediaInstance) === null || _this$controller$medi === void 0 ? void 0 : _this$controller$medi.pause();
|
|
149
186
|
|
|
150
|
-
|
|
187
|
+
this.controller.vreoUnit = vreoUnit;
|
|
188
|
+
(_this$controller$medi = this.controller.mediaInstance) === null || _this$controller$medi === void 0 ? void 0 : _this$controller$medi.pause(); // 预载逻辑
|
|
151
189
|
// 是否降低图片分辨率
|
|
190
|
+
|
|
152
191
|
if (this.$five.imageOptions.size && (_this$configs$imageOp = this.configs.imageOptions) !== null && _this$configs$imageOp !== void 0 && _this$configs$imageOp.size && this.$five.imageOptions.size > this.configs.imageOptions.size) {
|
|
153
192
|
this.$five.imageOptions.size = this.configs.imageOptions.size;
|
|
154
|
-
}
|
|
193
|
+
} // 预载数据中的点位
|
|
194
|
+
|
|
155
195
|
|
|
156
|
-
// 预载数据中的点位
|
|
157
196
|
if (!(preload || preload === undefined && this.configs.autoPreload)) {
|
|
158
197
|
_context.next = 23;
|
|
159
198
|
break;
|
|
160
199
|
}
|
|
200
|
+
|
|
161
201
|
panoIndexMap = vreoUnit.keyframes.filter(function (vreoKeyframe) {
|
|
162
202
|
if (vreoKeyframe.type !== _VreoUnit.VreoKeyframeEnum.CameraMovement) {
|
|
163
203
|
return false;
|
|
164
204
|
}
|
|
205
|
+
|
|
165
206
|
var data = vreoKeyframe.data;
|
|
207
|
+
|
|
166
208
|
if (data.panoIndex === undefined) {
|
|
167
209
|
return false;
|
|
168
210
|
}
|
|
211
|
+
|
|
169
212
|
return true;
|
|
170
213
|
}).reduce(function (accu, curr) {
|
|
171
214
|
var panoIndex = curr.data.panoIndex;
|
|
215
|
+
|
|
172
216
|
if (!accu[panoIndex]) {
|
|
173
217
|
accu[panoIndex] = true;
|
|
174
218
|
}
|
|
219
|
+
|
|
175
220
|
return accu;
|
|
176
221
|
}, {});
|
|
177
222
|
panoIndexes = Object.keys(panoIndexMap);
|
|
178
223
|
i = 0;
|
|
224
|
+
|
|
179
225
|
case 17:
|
|
180
226
|
if (!(i < panoIndexes.length)) {
|
|
181
227
|
_context.next = 23;
|
|
182
228
|
break;
|
|
183
229
|
}
|
|
230
|
+
|
|
184
231
|
_context.next = 20;
|
|
185
232
|
return this.$five.preloadPano(Number(panoIndexes[i]));
|
|
233
|
+
|
|
186
234
|
case 20:
|
|
187
235
|
i++;
|
|
188
236
|
_context.next = 17;
|
|
189
237
|
break;
|
|
238
|
+
|
|
190
239
|
case 23:
|
|
191
240
|
// 新数据载入就绪
|
|
192
241
|
this.emit('loaded', vreoUnit);
|
|
193
242
|
this.controller.emit('loaded', vreoUnit);
|
|
243
|
+
|
|
194
244
|
if ((_this$controller$vide = this.controller.videoAgentScene) !== null && _this$controller$vide !== void 0 && _this$controller$vide.videoAgentMesh.mediaInstance) {
|
|
195
245
|
this.controller.videoAgentScene.videoAgentMesh.mediaInstance.currentTime = currentTime / 1000;
|
|
196
246
|
}
|
|
247
|
+
|
|
197
248
|
this.controller.setAvatar(vreoUnit.video.avatar);
|
|
198
249
|
_context.next = 29;
|
|
199
250
|
return (_this$controller$vide2 = this.controller.videoAgentScene) === null || _this$controller$vide2 === void 0 ? void 0 : _this$controller$vide2.videoAgentMesh.play(vreoUnit.video.url, currentTime / 1000, vreoUnit.video.duration);
|
|
251
|
+
|
|
200
252
|
case 29:
|
|
201
253
|
this.controller.setEnded(false);
|
|
202
254
|
this.play();
|
|
203
255
|
this.controller.run(function (type, keyframe) {
|
|
204
|
-
return _this2.emit(type, keyframe);
|
|
256
|
+
return _this2.emit(type, keyframe, _this2.controller.currentTime);
|
|
205
257
|
});
|
|
206
258
|
this.controller.setLoading(false);
|
|
207
259
|
return _context.abrupt("return", true);
|
|
260
|
+
|
|
208
261
|
case 34:
|
|
209
262
|
case "end":
|
|
210
263
|
return _context.stop();
|
|
@@ -212,9 +265,11 @@ var Player = /*#__PURE__*/function (_Subscribe) {
|
|
|
212
265
|
}
|
|
213
266
|
}, _callee, this);
|
|
214
267
|
}));
|
|
268
|
+
|
|
215
269
|
function load(_x) {
|
|
216
270
|
return _load.apply(this, arguments);
|
|
217
271
|
}
|
|
272
|
+
|
|
218
273
|
return load;
|
|
219
274
|
}()
|
|
220
275
|
}, {
|
|
@@ -226,9 +281,11 @@ var Player = /*#__PURE__*/function (_Subscribe) {
|
|
|
226
281
|
key: "play",
|
|
227
282
|
value: function play(currentTime) {
|
|
228
283
|
if (this.controller.playing) return true;
|
|
284
|
+
|
|
229
285
|
if (currentTime && this.controller.mediaInstance) {
|
|
230
286
|
this.controller.mediaInstance.currentTime = currentTime / 1000;
|
|
231
287
|
}
|
|
288
|
+
|
|
232
289
|
Object.assign(window, {
|
|
233
290
|
$vreoController: this.controller
|
|
234
291
|
});
|
|
@@ -265,12 +322,15 @@ var Player = /*#__PURE__*/function (_Subscribe) {
|
|
|
265
322
|
value: function dispose() {
|
|
266
323
|
this.pause();
|
|
267
324
|
this.controller.dispose();
|
|
325
|
+
|
|
268
326
|
if (this.configs.container) {
|
|
269
327
|
ReactDOM.unmountComponentAtNode(this.configs.container);
|
|
270
328
|
}
|
|
271
329
|
}
|
|
272
330
|
}]);
|
|
331
|
+
|
|
273
332
|
return Player;
|
|
274
333
|
}(_five.Subscribe);
|
|
334
|
+
|
|
275
335
|
exports.Player = Player;
|
|
276
336
|
console.log("\n\n\u250F\u2501\u2501\u2501\u2513\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u250F\u2513\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\n\u2503\u250F\u2501\u2513\u2503\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2503\u2503\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\n\u2503\u2517\u2501\u251B\u2503\u250F\u2501\u2501\u2513\u250F\u2501\u2501\u2513\u2501\u2503\u2503\u2501\u250F\u2501\u2501\u2513\u250F\u2501\u2501\u2513\u250F\u2501\u2501\u2513\n\u2503\u250F\u2513\u250F\u251B\u2503\u250F\u2513\u2503\u2517\u2501\u2513\u2503\u2501\u2503\u2503\u2501\u2503\u2501\u2501\u252B\u2503\u250F\u2513\u2503\u2503\u250F\u2513\u2503\n\u2503\u2503\u2503\u2517\u2513\u2503\u2503\u2501\u252B\u2503\u2517\u251B\u2517\u2513\u2503\u2517\u2513\u2523\u2501\u2501\u2503\u2503\u2503\u2501\u252B\u2503\u2503\u2501\u252B\n\u2517\u251B\u2517\u2501\u251B\u2517\u2501\u2501\u251B\u2517\u2501\u2501\u2501\u251B\u2517\u2501\u251B\u2517\u2501\u2501\u251B\u2517\u2501\u2501\u251B\u2517\u2501\u2501\u251B\n\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\n\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\n\n");
|
|
@@ -1,32 +1,48 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
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
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.Drawer = Drawer;
|
|
9
|
+
|
|
8
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
9
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
10
14
|
var _mobxReact = require("mobx-react");
|
|
15
|
+
|
|
11
16
|
var _hooks = require("../../hooks");
|
|
17
|
+
|
|
12
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
+
|
|
13
20
|
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); }
|
|
21
|
+
|
|
14
22
|
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; }
|
|
23
|
+
|
|
15
24
|
var DrawerView = (0, _mobxReact.observer)(function (_ref) {
|
|
16
25
|
var _controller$drawerCon2;
|
|
26
|
+
|
|
17
27
|
var controller = _ref.controller;
|
|
18
28
|
var maxHeight = '400px';
|
|
29
|
+
|
|
19
30
|
var height = function () {
|
|
20
31
|
var _controller$drawerCon;
|
|
32
|
+
|
|
21
33
|
var height = (_controller$drawerCon = controller.drawerConfig) === null || _controller$drawerCon === void 0 ? void 0 : _controller$drawerCon.height;
|
|
34
|
+
|
|
22
35
|
if (!height) {
|
|
23
36
|
return 'max-content';
|
|
24
37
|
}
|
|
38
|
+
|
|
25
39
|
if (typeof height === 'number') {
|
|
26
40
|
return height + 'px';
|
|
27
41
|
}
|
|
42
|
+
|
|
28
43
|
return height;
|
|
29
44
|
}();
|
|
45
|
+
|
|
30
46
|
return /*#__PURE__*/React.createElement("div", {
|
|
31
47
|
className: (0, _classnames["default"])('vreo-drawer', {
|
|
32
48
|
'vreo-drawer-visible': controller.drawerConfig && controller.drawerConfig.content
|
|
@@ -42,6 +58,7 @@ var DrawerView = (0, _mobxReact.observer)(function (_ref) {
|
|
|
42
58
|
}
|
|
43
59
|
}, ((_controller$drawerCon2 = controller.drawerConfig) === null || _controller$drawerCon2 === void 0 ? void 0 : _controller$drawerCon2.content) || ''));
|
|
44
60
|
});
|
|
61
|
+
|
|
45
62
|
function Drawer() {
|
|
46
63
|
var controller = (0, _hooks.useController)();
|
|
47
64
|
return /*#__PURE__*/React.createElement(DrawerView, {
|
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
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
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.PopUp = PopUp;
|
|
9
|
+
|
|
8
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
9
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
10
14
|
var _mobxReact = require("mobx-react");
|
|
15
|
+
|
|
11
16
|
var _hooks = require("../../hooks");
|
|
17
|
+
|
|
12
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
+
|
|
13
20
|
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); }
|
|
21
|
+
|
|
14
22
|
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; }
|
|
23
|
+
|
|
15
24
|
var PopUpView = (0, _mobxReact.observer)(function (_ref) {
|
|
16
25
|
var controller = _ref.controller;
|
|
17
26
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -25,6 +34,7 @@ var PopUpView = (0, _mobxReact.observer)(function (_ref) {
|
|
|
25
34
|
className: "vreo-PopUp-inner"
|
|
26
35
|
}, controller.popUp || ''));
|
|
27
36
|
});
|
|
37
|
+
|
|
28
38
|
function PopUp() {
|
|
29
39
|
var controller = (0, _hooks.useController)();
|
|
30
40
|
return /*#__PURE__*/React.createElement(PopUpView, {
|
|
@@ -4,13 +4,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.ResizeObserver = ResizeObserver;
|
|
7
|
+
|
|
7
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
8
10
|
var _addResizeListener = require("../../../shared-utils/addResizeListener");
|
|
11
|
+
|
|
9
12
|
var _hooks = require("../../hooks");
|
|
13
|
+
|
|
10
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
+
|
|
11
16
|
function ResizeObserver() {
|
|
12
17
|
var ref = _react["default"].useRef(null);
|
|
18
|
+
|
|
13
19
|
var controller = (0, _hooks.useController)();
|
|
20
|
+
|
|
14
21
|
_react["default"].useEffect(function () {
|
|
15
22
|
if (!ref.current) return;
|
|
16
23
|
var resizeElement = controller.container.parentElement;
|
|
@@ -22,6 +29,7 @@ function ResizeObserver() {
|
|
|
22
29
|
dispose();
|
|
23
30
|
};
|
|
24
31
|
}, []);
|
|
32
|
+
|
|
25
33
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
26
34
|
className: "resizeObserver-element",
|
|
27
35
|
ref: ref
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
|
-
import AudioLike from '../../../shared-utils/
|
|
2
|
+
import AudioLike from '../../../shared-utils/AudioLike';
|
|
3
3
|
export interface VideoAgentMeshOptions {
|
|
4
4
|
/**
|
|
5
5
|
* 自定义视频实例。
|
|
@@ -40,7 +40,7 @@ export declare class VideoAgentMesh extends THREE.Mesh {
|
|
|
40
40
|
private update;
|
|
41
41
|
play(videoUrl?: string, currentTime?: number, duration?: number): Promise<unknown>;
|
|
42
42
|
/**
|
|
43
|
-
*
|
|
43
|
+
* 秒转成毫秒,保障精准度
|
|
44
44
|
*/
|
|
45
45
|
get currentTime(): number;
|
|
46
46
|
dispose(): void;
|