@realsee/vreo 0.2.0-alpha.9 → 1.0.0-alpha.10
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 +16 -5
- 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.ea8cbdb3.js +1 -0
- package/docs/demo/assets/default.1dd2b2d4.js +3988 -0
- package/docs/demo/assets/default.bc4c715d.css +1 -0
- package/docs/demo/assets/dynamic.cd7d1da6.js +1 -0
- package/docs/demo/assets/examples.98aaf9e2.js +25 -0
- package/docs/demo/assets/examples.dac4a6fe.css +1 -0
- package/docs/demo/assets/index.9331038f.css +1 -0
- package/docs/demo/assets/index.a3d7bd8a.js +1 -0
- package/docs/demo/assets/main.f0c47cae.js +1 -0
- package/docs/demo/assets/react.2ee8565f.css +1 -0
- package/docs/demo/assets/react.5f3bcfc5.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 +4 -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/createHTMLAudioElement.js +6 -11
- package/lib/PlayController/index.js +19 -85
- package/lib/Player/App.js +7 -29
- package/lib/Player/Controller.d.ts +29 -8
- package/lib/Player/Controller.js +185 -87
- package/lib/Player/custom/SpatialScenePanel/index.js +47 -72
- package/lib/Player/hooks.js +2 -12
- package/lib/Player/index.d.ts +5 -3
- package/lib/Player/index.js +108 -122
- package/lib/Player/modules/Drawer/index.js +1 -18
- package/lib/Player/modules/PopUp/index.js +1 -11
- package/lib/Player/modules/ResizeObserver/index.d.ts +2 -0
- package/lib/Player/modules/ResizeObserver/index.js +29 -0
- package/lib/Player/modules/VideoAgent/VideoAgentMesh.d.ts +16 -2
- package/lib/Player/modules/VideoAgent/VideoAgentMesh.js +124 -145
- package/lib/Player/modules/VideoAgent/VideoAgentScene.d.ts +3 -6
- package/lib/Player/modules/VideoAgent/VideoAgentScene.js +25 -52
- package/lib/Player/modules/VideoAgent/index.js +46 -22
- package/lib/Player/modules/Wave/index.d.ts +5 -0
- package/lib/Player/modules/Wave/index.js +77 -0
- package/lib/Player/modules/keyframes/BgMusic/index.js +3 -16
- package/lib/Player/modules/keyframes/CameraMovement/index.js +4 -28
- package/lib/Player/modules/keyframes/InfoPanel/index.js +30 -35
- package/lib/Player/modules/keyframes/ModelVideo/index.js +40 -29
- package/lib/Player/modules/keyframes/PanoEffect/index.js +16 -44
- package/lib/Player/modules/keyframes/PanoEffect/lineAnime.js +1 -8
- package/lib/Player/modules/keyframes/PanoTag/index.d.ts +1 -2
- package/lib/Player/modules/keyframes/PanoTag/index.js +75 -132
- package/lib/Player/modules/keyframes/PanoTextLabel/index.d.ts +3 -0
- package/lib/Player/modules/keyframes/PanoTextLabel/index.js +93 -66
- package/lib/Player/modules/keyframes/Prompter/index.js +18 -53
- package/lib/Player/modules/keyframes/UpdateVRPanorama/index.js +22 -25
- package/lib/Player/modules/keyframes/VideoEffect/index.js +13 -48
- package/lib/Player/typings.d.ts +12 -1
- package/lib/fivePlugins/CSS3DRenderPlugin/centerPoint.d.ts +2 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/centerPoint.js +10 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/createResizeObserver.d.ts +7 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/createResizeObserver.js +31 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/evenNumber.d.ts +3 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/evenNumber.js +10 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/index.d.ts +56 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/index.js +234 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.d.ts +7 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.js +15 -0
- package/lib/fivePlugins/CameraMovementPlugin/index.js +36 -82
- package/lib/fivePlugins/CameraMovementPlugin/typings.js +0 -4
- package/lib/fivePlugins/ModelTVVideoPlugin/index.js +12 -61
- package/lib/index.js +0 -1
- package/lib/react/index.d.ts +8 -4
- package/lib/react/index.js +10 -37
- package/lib/shared-utils/AduioLike.d.ts +37 -0
- package/lib/shared-utils/AduioLike.js +132 -0
- package/lib/shared-utils/Preloader.js +0 -7
- package/lib/shared-utils/addResizeListener.d.ts +4 -0
- package/lib/shared-utils/addResizeListener.js +46 -0
- package/lib/shared-utils/animationFrame/BetterTween.js +7 -39
- package/lib/shared-utils/animationFrame/index.js +2 -10
- package/lib/shared-utils/animationFrame/tween.js +3 -16
- package/lib/shared-utils/createTransMatrix.d.ts +1 -0
- package/lib/shared-utils/createTransMatrix.js +28 -0
- package/lib/shared-utils/getFileExpandedName.d.ts +1 -0
- package/lib/shared-utils/getFileExpandedName.js +12 -0
- package/lib/shared-utils/getMediaInfo.d.ts +9 -0
- package/lib/shared-utils/getMediaInfo.js +66 -0
- package/lib/shared-utils/setElementDataset.d.ts +1 -0
- package/lib/shared-utils/setElementDataset.js +22 -0
- package/lib/typings/VreoUnit.d.ts +37 -2
- package/lib/typings/VreoUnit.js +10 -13
- package/package.json +10 -10
- package/resources/PlayController/index.ts +0 -13
- package/resources/Player/App.tsx +5 -4
- package/resources/Player/Controller.ts +274 -146
- package/resources/Player/custom/SpatialScenePanel/index.tsx +5 -5
- package/resources/Player/hooks.ts +3 -5
- package/resources/Player/index.tsx +190 -140
- package/resources/Player/modules/ResizeObserver/index.tsx +23 -0
- package/resources/Player/modules/VideoAgent/VideoAgentMesh.ts +87 -31
- package/resources/Player/modules/VideoAgent/VideoAgentScene.ts +27 -24
- package/resources/Player/modules/VideoAgent/index.tsx +28 -12
- package/resources/Player/modules/Wave/index.tsx +64 -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 +52 -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 +15 -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 +350 -84
package/lib/Player/index.js
CHANGED
|
@@ -1,86 +1,68 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
4
|
-
|
|
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); }
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.Player = void 0;
|
|
9
|
-
|
|
10
8
|
var React = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var ReactDOM = _interopRequireWildcard(require("react-dom"));
|
|
13
|
-
|
|
14
10
|
var _five = require("@realsee/five");
|
|
15
|
-
|
|
16
11
|
var _App = require("./App");
|
|
17
|
-
|
|
18
12
|
var _Controller = require("./Controller");
|
|
19
|
-
|
|
20
13
|
var _VreoUnit = require("../typings/VreoUnit");
|
|
21
|
-
|
|
22
14
|
var _mobx = require("mobx");
|
|
23
|
-
|
|
24
15
|
var _Drawer = require("./modules/Drawer");
|
|
25
|
-
|
|
26
16
|
var _PopUp = require("./modules/PopUp");
|
|
27
|
-
|
|
28
17
|
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
|
-
|
|
30
18
|
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; }
|
|
31
|
-
|
|
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; }
|
|
32
20
|
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
|
-
|
|
34
21
|
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
|
-
|
|
36
22
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
37
|
-
|
|
38
23
|
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
|
-
|
|
40
|
-
function
|
|
41
|
-
|
|
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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
43
|
-
|
|
44
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
45
|
-
|
|
24
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
25
|
+
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
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
46
27
|
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
|
-
|
|
48
28
|
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
|
-
|
|
50
29
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
51
|
-
|
|
52
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; } }
|
|
53
|
-
|
|
54
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
55
|
-
|
|
31
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
56
32
|
var Player = /*#__PURE__*/function (_Subscribe) {
|
|
57
33
|
_inherits(Player, _Subscribe);
|
|
58
|
-
|
|
59
34
|
var _super = _createSuper(Player);
|
|
60
|
-
|
|
61
35
|
function Player(five) {
|
|
62
36
|
var _this;
|
|
63
|
-
|
|
64
37
|
var configs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
65
|
-
|
|
66
38
|
_classCallCheck(this, Player);
|
|
67
|
-
|
|
68
39
|
_this = _super.call(this);
|
|
69
|
-
_this
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
if (!configs.containter) {
|
|
73
|
-
var containter = document.querySelector('#vreo-app') || document.createElement('div');
|
|
74
|
-
ReactDOM.unmountComponentAtNode(containter);
|
|
75
|
-
containter.setAttribute('id', 'vreo-app');
|
|
76
|
-
configs.containter = containter;
|
|
77
|
-
document.body.append(containter);
|
|
40
|
+
_this.$five = five;
|
|
41
|
+
if (!configs.container) {
|
|
42
|
+
configs.container = configs.containter;
|
|
78
43
|
}
|
|
79
|
-
|
|
44
|
+
if (!configs.container) {
|
|
45
|
+
var _five$getElement;
|
|
46
|
+
var container = document.getElementById('vreo-app') || document.createElement('div');
|
|
47
|
+
ReactDOM.unmountComponentAtNode(container);
|
|
48
|
+
container.setAttribute('id', 'vreo-app');
|
|
49
|
+
configs.container = container;
|
|
50
|
+
var fiveCanvasDomParent = (_five$getElement = five.getElement()) === null || _five$getElement === void 0 ? void 0 : _five$getElement.parentNode;
|
|
51
|
+
if (fiveCanvasDomParent) {
|
|
52
|
+
fiveCanvasDomParent.append(container);
|
|
53
|
+
} else {
|
|
54
|
+
document.body.append(container);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (!configs.container.classList.contains('vreo-app')) configs.container.classList.add('vreo-app');
|
|
80
58
|
_this.configs = Object.freeze(Object.assign({
|
|
81
59
|
keyframeMap: {}
|
|
82
60
|
}, configs));
|
|
83
|
-
_this.controller
|
|
61
|
+
_this.controller = new _Controller.Controller({
|
|
62
|
+
five: five,
|
|
63
|
+
container: configs.container,
|
|
64
|
+
configs: _this.configs
|
|
65
|
+
});
|
|
84
66
|
ReactDOM.render( /*#__PURE__*/React.createElement(_Controller.ControllerContext.Provider, {
|
|
85
67
|
value: _this.controller
|
|
86
68
|
}, /*#__PURE__*/React.createElement(_App.App, null), /*#__PURE__*/React.createElement(_Drawer.Drawer, null), /*#__PURE__*/React.createElement(_PopUp.PopUp, null), _this.configs.customKeyframes && _this.configs.customKeyframes.map(function (CustomCmpt, key) {
|
|
@@ -99,149 +81,140 @@ var Player = /*#__PURE__*/function (_Subscribe) {
|
|
|
99
81
|
},
|
|
100
82
|
five: five
|
|
101
83
|
});
|
|
102
|
-
})), configs.
|
|
84
|
+
})), configs.container);
|
|
103
85
|
|
|
86
|
+
// 监听播放情况:抛出触发时机
|
|
87
|
+
(0, _mobx.reaction)(function () {
|
|
88
|
+
return _this.controller.ended;
|
|
89
|
+
}, function (ended) {
|
|
90
|
+
if (ended) {
|
|
91
|
+
_this.emit('paused', true);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
104
94
|
(0, _mobx.reaction)(function () {
|
|
105
95
|
return _this.controller.playing;
|
|
106
96
|
}, function (playing) {
|
|
107
|
-
_this.
|
|
97
|
+
if (!_this.controller.ended) {
|
|
98
|
+
_this.emit(playing ? 'playing' : 'paused');
|
|
99
|
+
}
|
|
108
100
|
});
|
|
109
101
|
return _this;
|
|
110
102
|
}
|
|
111
|
-
|
|
112
103
|
_createClass(Player, [{
|
|
113
104
|
key: "load",
|
|
114
105
|
value: function () {
|
|
115
|
-
var _load = _asyncToGenerator( /*#__PURE__*/
|
|
116
|
-
var _this$controller$
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
106
|
+
var _load = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(vreoUnit) {
|
|
107
|
+
var _this$controller$medi,
|
|
108
|
+
_this$configs$imageOp,
|
|
109
|
+
_this$controller$vide,
|
|
110
|
+
_this$controller$vide2,
|
|
111
|
+
_this2 = this;
|
|
120
112
|
var currentTime,
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
113
|
+
preload,
|
|
114
|
+
force,
|
|
115
|
+
panoIndexMap,
|
|
116
|
+
panoIndexes,
|
|
117
|
+
i,
|
|
118
|
+
_args = arguments;
|
|
119
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
130
120
|
while (1) {
|
|
131
121
|
switch (_context.prev = _context.next) {
|
|
132
122
|
case 0:
|
|
133
123
|
currentTime = _args.length > 1 && _args[1] !== undefined ? _args[1] : 0;
|
|
134
124
|
preload = _args.length > 2 && _args[2] !== undefined ? _args[2] : false;
|
|
135
|
-
|
|
125
|
+
force = _args.length > 3 && _args[3] !== undefined ? _args[3] : false;
|
|
126
|
+
this.controller.setLoading(true);
|
|
127
|
+
if (force) {
|
|
128
|
+
vreoUnit = JSON.parse(JSON.stringify(vreoUnit));
|
|
129
|
+
}
|
|
136
130
|
if (this.controller.visible) {
|
|
137
|
-
_context.next =
|
|
131
|
+
_context.next = 9;
|
|
138
132
|
break;
|
|
139
133
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
_context.next = 6;
|
|
134
|
+
this.controller.setVisible(true);
|
|
135
|
+
// 延迟 500ms 规避跟 DOM 动画冲突
|
|
136
|
+
_context.next = 9;
|
|
144
137
|
return new Promise(function (resolve) {
|
|
145
138
|
setTimeout(function () {
|
|
146
139
|
return resolve(true);
|
|
147
140
|
}, 500);
|
|
148
141
|
});
|
|
149
|
-
|
|
150
|
-
case 6:
|
|
142
|
+
case 9:
|
|
151
143
|
if (this.controller.stopInterval) {
|
|
152
144
|
this.controller.stopInterval();
|
|
153
145
|
this.controller.stopInterval = undefined;
|
|
154
146
|
}
|
|
155
|
-
|
|
156
147
|
this.controller.vreoUnit = vreoUnit;
|
|
157
|
-
(_this$controller$
|
|
158
|
-
// 是否降低图片分辨率
|
|
148
|
+
(_this$controller$medi = this.controller.mediaInstance) === null || _this$controller$medi === void 0 ? void 0 : _this$controller$medi.pause();
|
|
159
149
|
|
|
150
|
+
// 预载逻辑
|
|
151
|
+
// 是否降低图片分辨率
|
|
160
152
|
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) {
|
|
161
153
|
this.$five.imageOptions.size = this.configs.imageOptions.size;
|
|
162
|
-
}
|
|
163
|
-
|
|
154
|
+
}
|
|
164
155
|
|
|
156
|
+
// 预载数据中的点位
|
|
165
157
|
if (!(preload || preload === undefined && this.configs.autoPreload)) {
|
|
166
|
-
_context.next =
|
|
158
|
+
_context.next = 23;
|
|
167
159
|
break;
|
|
168
160
|
}
|
|
169
|
-
|
|
170
161
|
panoIndexMap = vreoUnit.keyframes.filter(function (vreoKeyframe) {
|
|
171
162
|
if (vreoKeyframe.type !== _VreoUnit.VreoKeyframeEnum.CameraMovement) {
|
|
172
163
|
return false;
|
|
173
164
|
}
|
|
174
|
-
|
|
175
165
|
var data = vreoKeyframe.data;
|
|
176
|
-
|
|
177
166
|
if (data.panoIndex === undefined) {
|
|
178
167
|
return false;
|
|
179
168
|
}
|
|
180
|
-
|
|
181
169
|
return true;
|
|
182
170
|
}).reduce(function (accu, curr) {
|
|
183
171
|
var panoIndex = curr.data.panoIndex;
|
|
184
|
-
|
|
185
172
|
if (!accu[panoIndex]) {
|
|
186
173
|
accu[panoIndex] = true;
|
|
187
174
|
}
|
|
188
|
-
|
|
189
175
|
return accu;
|
|
190
176
|
}, {});
|
|
191
|
-
|
|
177
|
+
panoIndexes = Object.keys(panoIndexMap);
|
|
192
178
|
i = 0;
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
_context.next = 20;
|
|
179
|
+
case 17:
|
|
180
|
+
if (!(i < panoIndexes.length)) {
|
|
181
|
+
_context.next = 23;
|
|
197
182
|
break;
|
|
198
183
|
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
case 17:
|
|
184
|
+
_context.next = 20;
|
|
185
|
+
return this.$five.preloadPano(Number(panoIndexes[i]));
|
|
186
|
+
case 20:
|
|
204
187
|
i++;
|
|
205
|
-
_context.next =
|
|
188
|
+
_context.next = 17;
|
|
206
189
|
break;
|
|
207
|
-
|
|
208
|
-
case 20:
|
|
190
|
+
case 23:
|
|
209
191
|
// 新数据载入就绪
|
|
210
192
|
this.emit('loaded', vreoUnit);
|
|
211
|
-
|
|
212
|
-
if (
|
|
213
|
-
|
|
214
|
-
break;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
if ((_this$controller$vide2 = this.controller.videoAgentScene) !== null && _this$controller$vide2 !== void 0 && _this$controller$vide2.videoAgentMesh.videoInstance) {
|
|
218
|
-
this.controller.videoAgentScene.videoAgentMesh.videoInstance.currentTime = currentTime / 1000;
|
|
193
|
+
this.controller.emit('loaded', vreoUnit);
|
|
194
|
+
if ((_this$controller$vide = this.controller.videoAgentScene) !== null && _this$controller$vide !== void 0 && _this$controller$vide.videoAgentMesh.mediaInstance) {
|
|
195
|
+
this.controller.videoAgentScene.videoAgentMesh.mediaInstance.currentTime = currentTime / 1000;
|
|
219
196
|
}
|
|
220
|
-
|
|
221
|
-
_context.next =
|
|
222
|
-
return (_this$controller$
|
|
223
|
-
|
|
224
|
-
|
|
197
|
+
this.controller.setAvatar(vreoUnit.video.avatar);
|
|
198
|
+
_context.next = 29;
|
|
199
|
+
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);
|
|
200
|
+
case 29:
|
|
201
|
+
this.controller.setEnded(false);
|
|
225
202
|
this.play();
|
|
226
|
-
|
|
227
|
-
case 26:
|
|
228
203
|
this.controller.run(function (type, keyframe) {
|
|
229
204
|
return _this2.emit(type, keyframe);
|
|
230
205
|
});
|
|
206
|
+
this.controller.setLoading(false);
|
|
231
207
|
return _context.abrupt("return", true);
|
|
232
|
-
|
|
233
|
-
case 28:
|
|
208
|
+
case 34:
|
|
234
209
|
case "end":
|
|
235
210
|
return _context.stop();
|
|
236
211
|
}
|
|
237
212
|
}
|
|
238
213
|
}, _callee, this);
|
|
239
214
|
}));
|
|
240
|
-
|
|
241
215
|
function load(_x) {
|
|
242
216
|
return _load.apply(this, arguments);
|
|
243
217
|
}
|
|
244
|
-
|
|
245
218
|
return load;
|
|
246
219
|
}()
|
|
247
220
|
}, {
|
|
@@ -251,11 +224,22 @@ var Player = /*#__PURE__*/function (_Subscribe) {
|
|
|
251
224
|
}
|
|
252
225
|
}, {
|
|
253
226
|
key: "play",
|
|
254
|
-
value: function play() {
|
|
227
|
+
value: function play(currentTime) {
|
|
255
228
|
if (this.controller.playing) return true;
|
|
229
|
+
if (currentTime && this.controller.mediaInstance) {
|
|
230
|
+
this.controller.mediaInstance.currentTime = currentTime / 1000;
|
|
231
|
+
}
|
|
232
|
+
Object.assign(window, {
|
|
233
|
+
$vreoController: this.controller
|
|
234
|
+
});
|
|
256
235
|
this.controller.setPlaying(true);
|
|
257
236
|
return true;
|
|
258
237
|
}
|
|
238
|
+
}, {
|
|
239
|
+
key: "setAppearance",
|
|
240
|
+
value: function setAppearance(appearance) {
|
|
241
|
+
this.controller.setAppearance(appearance);
|
|
242
|
+
}
|
|
259
243
|
}, {
|
|
260
244
|
key: "pause",
|
|
261
245
|
value: function pause() {
|
|
@@ -271,20 +255,22 @@ var Player = /*#__PURE__*/function (_Subscribe) {
|
|
|
271
255
|
value: function hide() {
|
|
272
256
|
this.controller.setVisible(false);
|
|
273
257
|
}
|
|
258
|
+
}, {
|
|
259
|
+
key: "getCurrentTime",
|
|
260
|
+
value: function getCurrentTime() {
|
|
261
|
+
return this.controller.currentTime;
|
|
262
|
+
}
|
|
274
263
|
}, {
|
|
275
264
|
key: "dispose",
|
|
276
265
|
value: function dispose() {
|
|
277
266
|
this.pause();
|
|
278
267
|
this.controller.dispose();
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
ReactDOM.unmountComponentAtNode(this.configs.containter);
|
|
268
|
+
if (this.configs.container) {
|
|
269
|
+
ReactDOM.unmountComponentAtNode(this.configs.container);
|
|
282
270
|
}
|
|
283
271
|
}
|
|
284
272
|
}]);
|
|
285
|
-
|
|
286
273
|
return Player;
|
|
287
274
|
}(_five.Subscribe);
|
|
288
|
-
|
|
289
275
|
exports.Player = Player;
|
|
290
|
-
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
|
|
276
|
+
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,48 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
4
|
-
|
|
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); }
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.Drawer = Drawer;
|
|
9
|
-
|
|
10
8
|
var React = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
-
|
|
14
10
|
var _mobxReact = require("mobx-react");
|
|
15
|
-
|
|
16
11
|
var _hooks = require("../../hooks");
|
|
17
|
-
|
|
18
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
-
|
|
20
13
|
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
|
-
|
|
22
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; }
|
|
23
|
-
|
|
24
15
|
var DrawerView = (0, _mobxReact.observer)(function (_ref) {
|
|
25
16
|
var _controller$drawerCon2;
|
|
26
|
-
|
|
27
17
|
var controller = _ref.controller;
|
|
28
18
|
var maxHeight = '400px';
|
|
29
|
-
|
|
30
19
|
var height = function () {
|
|
31
20
|
var _controller$drawerCon;
|
|
32
|
-
|
|
33
21
|
var height = (_controller$drawerCon = controller.drawerConfig) === null || _controller$drawerCon === void 0 ? void 0 : _controller$drawerCon.height;
|
|
34
|
-
|
|
35
22
|
if (!height) {
|
|
36
23
|
return 'max-content';
|
|
37
24
|
}
|
|
38
|
-
|
|
39
25
|
if (typeof height === 'number') {
|
|
40
26
|
return height + 'px';
|
|
41
27
|
}
|
|
42
|
-
|
|
43
28
|
return height;
|
|
44
29
|
}();
|
|
45
|
-
|
|
46
30
|
return /*#__PURE__*/React.createElement("div", {
|
|
47
31
|
className: (0, _classnames["default"])('vreo-drawer', {
|
|
48
32
|
'vreo-drawer-visible': controller.drawerConfig && controller.drawerConfig.content
|
|
@@ -58,7 +42,6 @@ var DrawerView = (0, _mobxReact.observer)(function (_ref) {
|
|
|
58
42
|
}
|
|
59
43
|
}, ((_controller$drawerCon2 = controller.drawerConfig) === null || _controller$drawerCon2 === void 0 ? void 0 : _controller$drawerCon2.content) || ''));
|
|
60
44
|
});
|
|
61
|
-
|
|
62
45
|
function Drawer() {
|
|
63
46
|
var controller = (0, _hooks.useController)();
|
|
64
47
|
return /*#__PURE__*/React.createElement(DrawerView, {
|
|
@@ -1,26 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
4
|
-
|
|
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); }
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.PopUp = PopUp;
|
|
9
|
-
|
|
10
8
|
var React = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
-
|
|
14
10
|
var _mobxReact = require("mobx-react");
|
|
15
|
-
|
|
16
11
|
var _hooks = require("../../hooks");
|
|
17
|
-
|
|
18
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
-
|
|
20
13
|
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
|
-
|
|
22
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; }
|
|
23
|
-
|
|
24
15
|
var PopUpView = (0, _mobxReact.observer)(function (_ref) {
|
|
25
16
|
var controller = _ref.controller;
|
|
26
17
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -34,7 +25,6 @@ var PopUpView = (0, _mobxReact.observer)(function (_ref) {
|
|
|
34
25
|
className: "vreo-PopUp-inner"
|
|
35
26
|
}, controller.popUp || ''));
|
|
36
27
|
});
|
|
37
|
-
|
|
38
28
|
function PopUp() {
|
|
39
29
|
var controller = (0, _hooks.useController)();
|
|
40
30
|
return /*#__PURE__*/React.createElement(PopUpView, {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ResizeObserver = ResizeObserver;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _addResizeListener = require("../../../shared-utils/addResizeListener");
|
|
9
|
+
var _hooks = require("../../hooks");
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
+
function ResizeObserver() {
|
|
12
|
+
var ref = _react["default"].useRef(null);
|
|
13
|
+
var controller = (0, _hooks.useController)();
|
|
14
|
+
_react["default"].useEffect(function () {
|
|
15
|
+
if (!ref.current) return;
|
|
16
|
+
var resizeElement = controller.container.parentElement;
|
|
17
|
+
if ((0, _addResizeListener.hasResizeListener)(resizeElement)) return;
|
|
18
|
+
var dispose = (0, _addResizeListener.addResizeListener)(resizeElement, function (width, height) {
|
|
19
|
+
controller.setContainerSize(width, height);
|
|
20
|
+
});
|
|
21
|
+
return function () {
|
|
22
|
+
dispose();
|
|
23
|
+
};
|
|
24
|
+
}, []);
|
|
25
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
26
|
+
className: "resizeObserver-element",
|
|
27
|
+
ref: ref
|
|
28
|
+
});
|
|
29
|
+
}
|
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
|
+
import AudioLike from '../../../shared-utils/AduioLike';
|
|
2
3
|
export interface VideoAgentMeshOptions {
|
|
4
|
+
/**
|
|
5
|
+
* 自定义视频实例。
|
|
6
|
+
*/
|
|
3
7
|
videoInstance?: HTMLVideoElement;
|
|
8
|
+
/**
|
|
9
|
+
* 自定义音频实例。
|
|
10
|
+
*/
|
|
4
11
|
audioInstance?: HTMLAudioElement;
|
|
12
|
+
/**
|
|
13
|
+
* 是否开启音频预载能力。**仅对`.mp3`有效**。
|
|
14
|
+
*
|
|
15
|
+
* @description 开启预载能力后会通过 `Fetch/XHR` 方式将音频文件下载转成二进制 [`Blob`](https://developer.mozilla.org/zh-CN/docs/Web/API/Blob) 提供给多媒体实例。这样的好处是 **能够保障音视频播放过程中不卡顿**。 但在部分 iOS 系统中会存在兼容问题——播 25s 之后会静音(`muted` 为 `false`,但是没有声音)。
|
|
16
|
+
*/
|
|
17
|
+
preload?: boolean;
|
|
5
18
|
}
|
|
6
19
|
/**
|
|
7
20
|
* 视频经纪人MESH
|
|
@@ -12,8 +25,9 @@ export declare class VideoAgentMesh extends THREE.Mesh {
|
|
|
12
25
|
freeze: boolean;
|
|
13
26
|
paused: boolean;
|
|
14
27
|
audioInstance: HTMLAudioElement;
|
|
28
|
+
audioLikeInstance: AudioLike;
|
|
15
29
|
$removeEventListener: () => void;
|
|
16
|
-
get
|
|
30
|
+
get mediaInstance(): HTMLAudioElement | HTMLVideoElement | AudioLike;
|
|
17
31
|
/**
|
|
18
32
|
*
|
|
19
33
|
* @param width
|
|
@@ -24,7 +38,7 @@ export declare class VideoAgentMesh extends THREE.Mesh {
|
|
|
24
38
|
*/
|
|
25
39
|
constructor(width: number, height: number, widthSegments: number, heightSegments: number, options?: VideoAgentMeshOptions);
|
|
26
40
|
private update;
|
|
27
|
-
play(videoUrl?: string): Promise<unknown>;
|
|
41
|
+
play(videoUrl?: string, currentTime?: number, duration?: number): Promise<unknown>;
|
|
28
42
|
/**
|
|
29
43
|
* 转成毫秒,保障精准度
|
|
30
44
|
*/
|