@realsee/vreo 0.1.0
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/LICENSE +21 -0
- package/README.md +465 -0
- package/docs/.nojekyll +1 -0
- package/docs/assets/custom.css +52 -0
- package/docs/assets/highlight.css +127 -0
- package/docs/assets/icons.css +1043 -0
- package/docs/assets/icons.png +0 -0
- package/docs/assets/icons@2x.png +0 -0
- package/docs/assets/main.js +52 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1388 -0
- package/docs/assets/widgets.png +0 -0
- package/docs/assets/widgets@2x.png +0 -0
- package/docs/classes/Player.Player-1.html +50 -0
- package/docs/enums/Player.InfoPanelTypeEnum.html +3 -0
- package/docs/enums/Player.PanoEffectEnum.html +5 -0
- package/docs/enums/Player.PanoTagEnum.html +3 -0
- package/docs/enums/Player.VreoKeyframeEnum.html +388 -0
- package/docs/enums/fivePlugins.CameraMovementEffect.html +1 -0
- package/docs/enums/fivePlugins.Rotation.html +1 -0
- package/docs/index.html +204 -0
- package/docs/interfaces/Player.PlayerConfigs.html +4 -0
- package/docs/interfaces/Player.Vertex.html +3 -0
- package/docs/interfaces/Player.VreoKeyframe.html +3 -0
- package/docs/interfaces/Player.VreoUnit.html +3 -0
- package/docs/interfaces/Player.VreoVideo.html +3 -0
- package/docs/interfaces/fivePlugins.CameraMovementOptsCallback.html +1 -0
- package/docs/interfaces/fivePlugins.CameraMovementPluginExportType.html +7 -0
- package/docs/interfaces/fivePlugins.CameraMovementPluginParameterType.html +1 -0
- package/docs/interfaces/fivePlugins.ModelTVVideoPluginData.html +1 -0
- package/docs/interfaces/fivePlugins.ModelTVVideoPluginExportType.html +1 -0
- package/docs/interfaces/fivePlugins.ModelTVVideoPluginParameterType.html +1 -0
- package/docs/interfaces/react.VreoActionCallbacks.html +15 -0
- package/docs/modules/Player.html +29 -0
- package/docs/modules/fivePlugins.html +3 -0
- package/docs/modules/react.html +1 -0
- package/docs/modules.html +1 -0
- package/lib/Player/App.d.ts +2 -0
- package/lib/Player/App.js +68 -0
- package/lib/Player/Controller.d.ts +39 -0
- package/lib/Player/Controller.js +226 -0
- package/lib/Player/hooks.d.ts +4 -0
- package/lib/Player/hooks.js +41 -0
- package/lib/Player/index.d.ts +15 -0
- package/lib/Player/index.js +191 -0
- package/lib/Player/modules/Drawer/index.d.ts +2 -0
- package/lib/Player/modules/Drawer/index.js +67 -0
- package/lib/Player/modules/VideoAgent/VideoAgentMesh.d.ts +30 -0
- package/lib/Player/modules/VideoAgent/VideoAgentMesh.js +324 -0
- package/lib/Player/modules/VideoAgent/VideoAgentScene.d.ts +10 -0
- package/lib/Player/modules/VideoAgent/VideoAgentScene.js +65 -0
- package/lib/Player/modules/VideoAgent/index.d.ts +4 -0
- package/lib/Player/modules/VideoAgent/index.js +44 -0
- package/lib/Player/modules/keyframes/CameraMovement/index.d.ts +2 -0
- package/lib/Player/modules/keyframes/CameraMovement/index.js +73 -0
- package/lib/Player/modules/keyframes/InfoPanel/index.d.ts +2 -0
- package/lib/Player/modules/keyframes/InfoPanel/index.js +89 -0
- package/lib/Player/modules/keyframes/ModelVideo/index.d.ts +2 -0
- package/lib/Player/modules/keyframes/ModelVideo/index.js +87 -0
- package/lib/Player/modules/keyframes/PanoEffect/index.d.ts +2 -0
- package/lib/Player/modules/keyframes/PanoEffect/index.js +142 -0
- package/lib/Player/modules/keyframes/PanoEffect/lineAnime.d.ts +5 -0
- package/lib/Player/modules/keyframes/PanoEffect/lineAnime.js +46 -0
- package/lib/Player/modules/keyframes/PanoTag/index.d.ts +2 -0
- package/lib/Player/modules/keyframes/PanoTag/index.js +168 -0
- package/lib/Player/modules/keyframes/PanoTextLabel/index.d.ts +2 -0
- package/lib/Player/modules/keyframes/PanoTextLabel/index.js +113 -0
- package/lib/Player/modules/keyframes/Prompter/index.d.ts +2 -0
- package/lib/Player/modules/keyframes/Prompter/index.js +105 -0
- package/lib/Player/modules/keyframes/UpdateVRPanorama/index.d.ts +2 -0
- package/lib/Player/modules/keyframes/UpdateVRPanorama/index.js +51 -0
- package/lib/Player/modules/keyframes/VideoEffect/index.d.ts +2 -0
- package/lib/Player/modules/keyframes/VideoEffect/index.js +176 -0
- package/lib/Player/typings.d.ts +14 -0
- package/lib/Player/typings.js +5 -0
- package/lib/fivePlugins/CameraMovementPlugin/index.d.ts +6 -0
- package/lib/fivePlugins/CameraMovementPlugin/index.js +307 -0
- package/lib/fivePlugins/CameraMovementPlugin/typings.d.ts +48 -0
- package/lib/fivePlugins/CameraMovementPlugin/typings.js +25 -0
- package/lib/fivePlugins/ModelTVVideoPlugin/index.d.ts +20 -0
- package/lib/fivePlugins/ModelTVVideoPlugin/index.js +305 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +13 -0
- package/lib/react/index.d.ts +42 -0
- package/lib/react/index.js +120 -0
- package/lib/shared-utils/Preloader.d.ts +6 -0
- package/lib/shared-utils/Preloader.js +51 -0
- package/lib/shared-utils/animationFrame/BetterTween.d.ts +11 -0
- package/lib/shared-utils/animationFrame/BetterTween.js +102 -0
- package/lib/shared-utils/animationFrame/index.d.ts +15 -0
- package/lib/shared-utils/animationFrame/index.js +68 -0
- package/lib/shared-utils/animationFrame/tween.d.ts +75 -0
- package/lib/shared-utils/animationFrame/tween.js +76 -0
- package/lib/typings/VreoUnit.d.ts +204 -0
- package/lib/typings/VreoUnit.js +65 -0
- package/package.json +55 -0
- package/resources/Player/App.tsx +57 -0
- package/resources/Player/Controller.ts +154 -0
- package/resources/Player/hooks.ts +28 -0
- package/resources/Player/index.tsx +115 -0
- package/resources/Player/modules/Drawer/index.tsx +40 -0
- package/resources/Player/modules/VideoAgent/VideoAgentMesh.ts +202 -0
- package/resources/Player/modules/VideoAgent/VideoAgentScene.ts +38 -0
- package/resources/Player/modules/VideoAgent/index.tsx +31 -0
- package/resources/Player/modules/keyframes/CameraMovement/index.tsx +33 -0
- package/resources/Player/modules/keyframes/InfoPanel/index.tsx +52 -0
- package/resources/Player/modules/keyframes/ModelVideo/index.tsx +44 -0
- package/resources/Player/modules/keyframes/PanoEffect/index.tsx +99 -0
- package/resources/Player/modules/keyframes/PanoEffect/lineAnime.ts +31 -0
- package/resources/Player/modules/keyframes/PanoTag/index.tsx +127 -0
- package/resources/Player/modules/keyframes/PanoTextLabel/index.tsx +65 -0
- package/resources/Player/modules/keyframes/Prompter/index.tsx +65 -0
- package/resources/Player/modules/keyframes/UpdateVRPanorama/index.tsx +36 -0
- package/resources/Player/modules/keyframes/VideoEffect/index.tsx +115 -0
- package/resources/Player/typings.ts +15 -0
- package/resources/fivePlugins/CameraMovementPlugin/index.ts +203 -0
- package/resources/fivePlugins/CameraMovementPlugin/typings.ts +57 -0
- package/resources/fivePlugins/ModelTVVideoPlugin/index.ts +278 -0
- package/resources/index.ts +1 -0
- package/resources/react/index.tsx +95 -0
- package/resources/shared-utils/Preloader.ts +35 -0
- package/resources/shared-utils/animationFrame/BetterTween.ts +33 -0
- package/resources/shared-utils/animationFrame/index.ts +48 -0
- package/resources/shared-utils/animationFrame/tween.ts +51 -0
- package/resources/typings/VreoUnit.ts +225 -0
- package/stylesheets/default.css +497 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Five, Subscribe } from '@realsee/five';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { VreoKeyframe, VreoKeyframeEnum, VreoKeyframeEvent, VreoUnit } from '../typings/VreoUnit';
|
|
4
|
+
import { VideoAgentScene } from './modules/VideoAgent/VideoAgentScene';
|
|
5
|
+
import { PlayerConfigs } from './typings';
|
|
6
|
+
/**
|
|
7
|
+
* 逻辑控制器:内部状态。
|
|
8
|
+
*/
|
|
9
|
+
export declare class Controller extends Subscribe<VreoKeyframeEvent> {
|
|
10
|
+
$five?: Five;
|
|
11
|
+
configs?: PlayerConfigs;
|
|
12
|
+
videoAgentScene?: VideoAgentScene;
|
|
13
|
+
vreoUnit?: VreoUnit;
|
|
14
|
+
stopInterval?: () => void;
|
|
15
|
+
playing: boolean;
|
|
16
|
+
visible: boolean;
|
|
17
|
+
drawerConfig?: {
|
|
18
|
+
content: string | JSX.Element;
|
|
19
|
+
height?: number | string;
|
|
20
|
+
};
|
|
21
|
+
setVisible(v: boolean): void;
|
|
22
|
+
setPlaying(playing: boolean): void;
|
|
23
|
+
openDrawer(drawerConfig?: false | {
|
|
24
|
+
content: string | JSX.Element;
|
|
25
|
+
height?: number | string;
|
|
26
|
+
}): void;
|
|
27
|
+
constructor();
|
|
28
|
+
get ready(): boolean;
|
|
29
|
+
get currentTime(): number;
|
|
30
|
+
get currentKeyframes(): VreoKeyframe[];
|
|
31
|
+
get videoInstance(): HTMLAudioElement | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* 逐帧任务
|
|
34
|
+
*/
|
|
35
|
+
requestAnimationFrameLoop(callback: (type: VreoKeyframeEnum, keyframe: VreoKeyframe) => void): void;
|
|
36
|
+
run(callback: (type: VreoKeyframeEnum, keyframe: VreoKeyframe) => void): void;
|
|
37
|
+
dispose(): void;
|
|
38
|
+
}
|
|
39
|
+
export declare const ControllerContext: React.Context<Controller | null>;
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.ControllerContext = exports.Controller = void 0;
|
|
9
|
+
|
|
10
|
+
var _five = require("@realsee/five");
|
|
11
|
+
|
|
12
|
+
var _mobx = require("mobx");
|
|
13
|
+
|
|
14
|
+
var React = _interopRequireWildcard(require("react"));
|
|
15
|
+
|
|
16
|
+
var _animationFrame = require("../shared-utils/animationFrame");
|
|
17
|
+
|
|
18
|
+
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); }
|
|
19
|
+
|
|
20
|
+
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; }
|
|
21
|
+
|
|
22
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
23
|
+
|
|
24
|
+
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); } }
|
|
25
|
+
|
|
26
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
27
|
+
|
|
28
|
+
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); }
|
|
29
|
+
|
|
30
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
31
|
+
|
|
32
|
+
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); }; }
|
|
33
|
+
|
|
34
|
+
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); }
|
|
35
|
+
|
|
36
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
37
|
+
|
|
38
|
+
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; } }
|
|
39
|
+
|
|
40
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
41
|
+
|
|
42
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* 逻辑控制器:内部状态。
|
|
46
|
+
*/
|
|
47
|
+
var Controller = /*#__PURE__*/function (_Subscribe) {
|
|
48
|
+
_inherits(Controller, _Subscribe);
|
|
49
|
+
|
|
50
|
+
var _super = _createSuper(Controller);
|
|
51
|
+
|
|
52
|
+
function Controller() {
|
|
53
|
+
var _this;
|
|
54
|
+
|
|
55
|
+
_classCallCheck(this, Controller);
|
|
56
|
+
|
|
57
|
+
_this = _super.call(this);
|
|
58
|
+
|
|
59
|
+
_defineProperty(_assertThisInitialized(_this), "playing", false);
|
|
60
|
+
|
|
61
|
+
_defineProperty(_assertThisInitialized(_this), "visible", false);
|
|
62
|
+
|
|
63
|
+
(0, _mobx.makeObservable)(_assertThisInitialized(_this), {
|
|
64
|
+
visible: _mobx.observable,
|
|
65
|
+
setVisible: _mobx.action,
|
|
66
|
+
playing: _mobx.observable,
|
|
67
|
+
setPlaying: _mobx.action,
|
|
68
|
+
drawerConfig: _mobx.observable.ref,
|
|
69
|
+
openDrawer: _mobx.action
|
|
70
|
+
}); // 监听播放情况:抛出触发时机
|
|
71
|
+
|
|
72
|
+
(0, _mobx.reaction)(function () {
|
|
73
|
+
return _this.playing;
|
|
74
|
+
}, function (playing) {
|
|
75
|
+
_this.emit(playing ? 'playing' : 'paused');
|
|
76
|
+
});
|
|
77
|
+
return _this;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
_createClass(Controller, [{
|
|
81
|
+
key: "setVisible",
|
|
82
|
+
value: function setVisible(v) {
|
|
83
|
+
this.visible = v;
|
|
84
|
+
}
|
|
85
|
+
}, {
|
|
86
|
+
key: "setPlaying",
|
|
87
|
+
value: function setPlaying(playing) {
|
|
88
|
+
this.playing = playing;
|
|
89
|
+
}
|
|
90
|
+
}, {
|
|
91
|
+
key: "openDrawer",
|
|
92
|
+
value: function openDrawer(drawerConfig) {
|
|
93
|
+
if (!drawerConfig) {
|
|
94
|
+
var _this$drawerConfig;
|
|
95
|
+
|
|
96
|
+
this.drawerConfig = {
|
|
97
|
+
content: '',
|
|
98
|
+
height: (_this$drawerConfig = this.drawerConfig) === null || _this$drawerConfig === void 0 ? void 0 : _this$drawerConfig.height
|
|
99
|
+
};
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
this.drawerConfig = drawerConfig;
|
|
104
|
+
}
|
|
105
|
+
}, {
|
|
106
|
+
key: "ready",
|
|
107
|
+
get: function get() {
|
|
108
|
+
return !!this.videoAgentScene;
|
|
109
|
+
}
|
|
110
|
+
}, {
|
|
111
|
+
key: "currentTime",
|
|
112
|
+
get: function get() {
|
|
113
|
+
var _this$videoAgentScene;
|
|
114
|
+
|
|
115
|
+
return ((_this$videoAgentScene = this.videoAgentScene) === null || _this$videoAgentScene === void 0 ? void 0 : _this$videoAgentScene.videoAgentMesh.currentTime) || 0;
|
|
116
|
+
}
|
|
117
|
+
}, {
|
|
118
|
+
key: "currentKeyframes",
|
|
119
|
+
get: function get() {
|
|
120
|
+
var _this2 = this;
|
|
121
|
+
|
|
122
|
+
if (!this.vreoUnit) return [];
|
|
123
|
+
var keyframes = this.vreoUnit.keyframes; // 没有被解析过且开始时间低于当前时间戳 100ms
|
|
124
|
+
|
|
125
|
+
return keyframes.filter(function (keyframe) {
|
|
126
|
+
if (keyframe.parsed) return false;
|
|
127
|
+
var dur = _this2.currentTime - keyframe.start;
|
|
128
|
+
return dur <= 100 && dur >= 0;
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
}, {
|
|
132
|
+
key: "videoInstance",
|
|
133
|
+
get: function get() {
|
|
134
|
+
var _this$videoAgentScene2;
|
|
135
|
+
|
|
136
|
+
return (_this$videoAgentScene2 = this.videoAgentScene) === null || _this$videoAgentScene2 === void 0 ? void 0 : _this$videoAgentScene2.videoAgentMesh.videoInstance;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* 逐帧任务
|
|
140
|
+
*/
|
|
141
|
+
|
|
142
|
+
}, {
|
|
143
|
+
key: "requestAnimationFrameLoop",
|
|
144
|
+
value: function requestAnimationFrameLoop(callback) {
|
|
145
|
+
var _this$videoInstance,
|
|
146
|
+
_this$videoInstance4,
|
|
147
|
+
_this3 = this;
|
|
148
|
+
|
|
149
|
+
if ((_this$videoInstance = this.videoInstance) !== null && _this$videoInstance !== void 0 && _this$videoInstance.ended) {
|
|
150
|
+
this.setPlaying(false);
|
|
151
|
+
this.videoInstance.pause();
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
if (!this.playing) {
|
|
156
|
+
var _this$videoInstance2;
|
|
157
|
+
|
|
158
|
+
if (!((_this$videoInstance2 = this.videoInstance) !== null && _this$videoInstance2 !== void 0 && _this$videoInstance2.paused)) {
|
|
159
|
+
var _this$videoInstance3;
|
|
160
|
+
|
|
161
|
+
(_this$videoInstance3 = this.videoInstance) === null || _this$videoInstance3 === void 0 ? void 0 : _this$videoInstance3.pause();
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
if ((_this$videoInstance4 = this.videoInstance) !== null && _this$videoInstance4 !== void 0 && _this$videoInstance4.paused && this.playing) {
|
|
168
|
+
this.videoInstance.play();
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
var currentKeyframes = this.currentKeyframes;
|
|
172
|
+
currentKeyframes.forEach(function (keyframe) {
|
|
173
|
+
if (keyframe.parsed) return;
|
|
174
|
+
keyframe.parsed = true;
|
|
175
|
+
|
|
176
|
+
_this3.emit(keyframe.type, keyframe);
|
|
177
|
+
|
|
178
|
+
if (callback) {
|
|
179
|
+
callback(keyframe.type, keyframe);
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
}, {
|
|
184
|
+
key: "run",
|
|
185
|
+
value: function run(callback) {
|
|
186
|
+
var _this4 = this;
|
|
187
|
+
|
|
188
|
+
if (this.stopInterval) return;
|
|
189
|
+
this.stopInterval = (0, _animationFrame.requestAnimationFrameInterval)(function () {
|
|
190
|
+
return _this4.requestAnimationFrameLoop(callback);
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
}, {
|
|
194
|
+
key: "dispose",
|
|
195
|
+
value: function dispose() {
|
|
196
|
+
this.setPlaying(false);
|
|
197
|
+
|
|
198
|
+
if (this.currentKeyframes) {
|
|
199
|
+
this.currentKeyframes.forEach(function (keyframe) {
|
|
200
|
+
return keyframe.parsed = false;
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* 清理掉数据
|
|
205
|
+
*/
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
this.vreoUnit = undefined;
|
|
209
|
+
|
|
210
|
+
if (this.videoInstance) {
|
|
211
|
+
this.videoInstance.currentTime = 0;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
if (this.stopInterval) {
|
|
215
|
+
this.stopInterval();
|
|
216
|
+
this.stopInterval = undefined;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}]);
|
|
220
|
+
|
|
221
|
+
return Controller;
|
|
222
|
+
}(_five.Subscribe);
|
|
223
|
+
|
|
224
|
+
exports.Controller = Controller;
|
|
225
|
+
var ControllerContext = /*#__PURE__*/React.createContext(null);
|
|
226
|
+
exports.ControllerContext = ControllerContext;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Vector3 } from 'three';
|
|
2
|
+
export declare function useController(): import("./Controller").Controller;
|
|
3
|
+
export declare function useFiveInstance(): import("@realsee/five").Five;
|
|
4
|
+
export declare function useFiveProject2d(): (vector: Vector3) => import("three").Vector2 | null;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useController = useController;
|
|
7
|
+
exports.useFiveInstance = useFiveInstance;
|
|
8
|
+
exports.useFiveProject2d = useFiveProject2d;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _Controller = require("./Controller");
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
+
|
|
16
|
+
function useController() {
|
|
17
|
+
var controller = _react["default"].useContext(_Controller.ControllerContext);
|
|
18
|
+
|
|
19
|
+
if (!controller) {
|
|
20
|
+
throw new Error('没有找到 "ControllerContext"');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return controller;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function useFiveInstance() {
|
|
27
|
+
var controller = useController();
|
|
28
|
+
|
|
29
|
+
if (!controller.$five) {
|
|
30
|
+
throw new Error('没有找到 "five" 实例');
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return controller.$five;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function useFiveProject2d() {
|
|
37
|
+
var five = useFiveInstance();
|
|
38
|
+
return function (vector) {
|
|
39
|
+
return five.project2d(vector, false);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Five, Subscribe } from '@realsee/five';
|
|
2
|
+
import { VreoKeyframeEvent, VreoUnit } from '../typings/VreoUnit';
|
|
3
|
+
import { PlayerConfigs } from './typings';
|
|
4
|
+
export declare class Player extends Subscribe<VreoKeyframeEvent> {
|
|
5
|
+
$five: Five;
|
|
6
|
+
configs: Readonly<PlayerConfigs>;
|
|
7
|
+
constructor(five: Five, configs?: Partial<PlayerConfigs>);
|
|
8
|
+
load(vreoUnit: VreoUnit, currentTime?: number): Promise<boolean>;
|
|
9
|
+
get paused(): boolean;
|
|
10
|
+
play(): boolean;
|
|
11
|
+
pause(): void;
|
|
12
|
+
show(): void;
|
|
13
|
+
hide(): void;
|
|
14
|
+
dispose(): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.Player = void 0;
|
|
9
|
+
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var ReactDOM = _interopRequireWildcard(require("react-dom"));
|
|
13
|
+
|
|
14
|
+
var _five = require("@realsee/five");
|
|
15
|
+
|
|
16
|
+
var _App = require("./App");
|
|
17
|
+
|
|
18
|
+
var _Controller = require("./Controller");
|
|
19
|
+
|
|
20
|
+
var _mobx = require("mobx");
|
|
21
|
+
|
|
22
|
+
var _Drawer = require("./modules/Drawer");
|
|
23
|
+
|
|
24
|
+
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); }
|
|
25
|
+
|
|
26
|
+
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; }
|
|
27
|
+
|
|
28
|
+
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); } }
|
|
29
|
+
|
|
30
|
+
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); }); }; }
|
|
31
|
+
|
|
32
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
33
|
+
|
|
34
|
+
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); } }
|
|
35
|
+
|
|
36
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
37
|
+
|
|
38
|
+
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); }
|
|
39
|
+
|
|
40
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
41
|
+
|
|
42
|
+
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); }; }
|
|
43
|
+
|
|
44
|
+
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); }
|
|
45
|
+
|
|
46
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
47
|
+
|
|
48
|
+
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; } }
|
|
49
|
+
|
|
50
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
51
|
+
|
|
52
|
+
var controller = new _Controller.Controller();
|
|
53
|
+
|
|
54
|
+
var Player = /*#__PURE__*/function (_Subscribe) {
|
|
55
|
+
_inherits(Player, _Subscribe);
|
|
56
|
+
|
|
57
|
+
var _super = _createSuper(Player);
|
|
58
|
+
|
|
59
|
+
function Player(five) {
|
|
60
|
+
var _this;
|
|
61
|
+
|
|
62
|
+
var configs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
63
|
+
|
|
64
|
+
_classCallCheck(this, Player);
|
|
65
|
+
|
|
66
|
+
_this = _super.call(this);
|
|
67
|
+
_this.$five = controller.$five = five;
|
|
68
|
+
|
|
69
|
+
if (!configs.containter) {
|
|
70
|
+
var containter = document.createElement('div');
|
|
71
|
+
containter.setAttribute('id', 'vreo-app');
|
|
72
|
+
configs.containter = containter;
|
|
73
|
+
document.body.append(containter);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
_this.configs = Object.freeze(Object.assign({
|
|
77
|
+
keyframeMap: {}
|
|
78
|
+
}, configs));
|
|
79
|
+
controller.configs = _this.configs;
|
|
80
|
+
ReactDOM.render( /*#__PURE__*/React.createElement(_Controller.ControllerContext.Provider, {
|
|
81
|
+
value: controller
|
|
82
|
+
}, /*#__PURE__*/React.createElement(_App.App, null), /*#__PURE__*/React.createElement(_Drawer.Drawer, null)), configs.containter); // 监听播放情况:抛出触发时机
|
|
83
|
+
|
|
84
|
+
(0, _mobx.reaction)(function () {
|
|
85
|
+
return controller.playing;
|
|
86
|
+
}, function (playing) {
|
|
87
|
+
_this.emit(playing ? 'playing' : 'paused');
|
|
88
|
+
});
|
|
89
|
+
return _this;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
_createClass(Player, [{
|
|
93
|
+
key: "load",
|
|
94
|
+
value: function () {
|
|
95
|
+
var _load = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(vreoUnit) {
|
|
96
|
+
var _controller$videoInst,
|
|
97
|
+
_this2 = this;
|
|
98
|
+
|
|
99
|
+
var currentTime,
|
|
100
|
+
_controller$videoAgen,
|
|
101
|
+
_controller$videoAgen2,
|
|
102
|
+
_args = arguments;
|
|
103
|
+
|
|
104
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
105
|
+
while (1) {
|
|
106
|
+
switch (_context.prev = _context.next) {
|
|
107
|
+
case 0:
|
|
108
|
+
currentTime = _args.length > 1 && _args[1] !== undefined ? _args[1] : 0;
|
|
109
|
+
|
|
110
|
+
if (controller.stopInterval) {
|
|
111
|
+
controller.stopInterval();
|
|
112
|
+
controller.stopInterval = undefined;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
controller.vreoUnit = vreoUnit;
|
|
116
|
+
(_controller$videoInst = controller.videoInstance) === null || _controller$videoInst === void 0 ? void 0 : _controller$videoInst.pause();
|
|
117
|
+
|
|
118
|
+
if (!vreoUnit.video.url) {
|
|
119
|
+
_context.next = 9;
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
if ((_controller$videoAgen = controller.videoAgentScene) !== null && _controller$videoAgen !== void 0 && _controller$videoAgen.videoAgentMesh.videoInstance) {
|
|
124
|
+
controller.videoAgentScene.videoAgentMesh.videoInstance.currentTime = currentTime / 1000;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
_context.next = 8;
|
|
128
|
+
return (_controller$videoAgen2 = controller.videoAgentScene) === null || _controller$videoAgen2 === void 0 ? void 0 : _controller$videoAgen2.videoAgentMesh.play(vreoUnit.video.url);
|
|
129
|
+
|
|
130
|
+
case 8:
|
|
131
|
+
this.play();
|
|
132
|
+
|
|
133
|
+
case 9:
|
|
134
|
+
controller.run(function (type, keyframe) {
|
|
135
|
+
return _this2.emit(type, keyframe);
|
|
136
|
+
});
|
|
137
|
+
return _context.abrupt("return", true);
|
|
138
|
+
|
|
139
|
+
case 11:
|
|
140
|
+
case "end":
|
|
141
|
+
return _context.stop();
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}, _callee, this);
|
|
145
|
+
}));
|
|
146
|
+
|
|
147
|
+
function load(_x) {
|
|
148
|
+
return _load.apply(this, arguments);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
return load;
|
|
152
|
+
}()
|
|
153
|
+
}, {
|
|
154
|
+
key: "paused",
|
|
155
|
+
get: function get() {
|
|
156
|
+
return !controller.playing;
|
|
157
|
+
}
|
|
158
|
+
}, {
|
|
159
|
+
key: "play",
|
|
160
|
+
value: function play() {
|
|
161
|
+
if (controller.playing) return true;
|
|
162
|
+
controller.setPlaying(true);
|
|
163
|
+
return true;
|
|
164
|
+
}
|
|
165
|
+
}, {
|
|
166
|
+
key: "pause",
|
|
167
|
+
value: function pause() {
|
|
168
|
+
controller.setPlaying(false);
|
|
169
|
+
}
|
|
170
|
+
}, {
|
|
171
|
+
key: "show",
|
|
172
|
+
value: function show() {
|
|
173
|
+
controller.setVisible(true);
|
|
174
|
+
}
|
|
175
|
+
}, {
|
|
176
|
+
key: "hide",
|
|
177
|
+
value: function hide() {
|
|
178
|
+
controller.setVisible(false);
|
|
179
|
+
}
|
|
180
|
+
}, {
|
|
181
|
+
key: "dispose",
|
|
182
|
+
value: function dispose() {
|
|
183
|
+
controller.dispose();
|
|
184
|
+
}
|
|
185
|
+
}]);
|
|
186
|
+
|
|
187
|
+
return Player;
|
|
188
|
+
}(_five.Subscribe);
|
|
189
|
+
|
|
190
|
+
exports.Player = Player;
|
|
191
|
+
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");
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.Drawer = Drawer;
|
|
9
|
+
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
14
|
+
var _mobxReact = require("mobx-react");
|
|
15
|
+
|
|
16
|
+
var _hooks = require("../../hooks");
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
+
|
|
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
|
+
|
|
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
|
+
|
|
24
|
+
var DrawerView = (0, _mobxReact.observer)(function (_ref) {
|
|
25
|
+
var _controller$drawerCon2;
|
|
26
|
+
|
|
27
|
+
var controller = _ref.controller;
|
|
28
|
+
var maxHeight = '540px';
|
|
29
|
+
|
|
30
|
+
var height = function () {
|
|
31
|
+
var _controller$drawerCon;
|
|
32
|
+
|
|
33
|
+
var height = (_controller$drawerCon = controller.drawerConfig) === null || _controller$drawerCon === void 0 ? void 0 : _controller$drawerCon.height;
|
|
34
|
+
|
|
35
|
+
if (!height) {
|
|
36
|
+
return 'max-content';
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (typeof height === 'number') {
|
|
40
|
+
return height + 'px';
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return height;
|
|
44
|
+
}();
|
|
45
|
+
|
|
46
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
47
|
+
className: (0, _classnames["default"])('vreo-drawer', {
|
|
48
|
+
'vreo-drawer-visible': controller.drawerConfig && controller.drawerConfig.content
|
|
49
|
+
}),
|
|
50
|
+
onClick: function onClick() {
|
|
51
|
+
return controller.openDrawer(false);
|
|
52
|
+
}
|
|
53
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
54
|
+
className: "vreo-drawer-inner",
|
|
55
|
+
style: {
|
|
56
|
+
height: height,
|
|
57
|
+
maxHeight: maxHeight
|
|
58
|
+
}
|
|
59
|
+
}, ((_controller$drawerCon2 = controller.drawerConfig) === null || _controller$drawerCon2 === void 0 ? void 0 : _controller$drawerCon2.content) || ''));
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
function Drawer() {
|
|
63
|
+
var controller = (0, _hooks.useController)();
|
|
64
|
+
return /*#__PURE__*/React.createElement(DrawerView, {
|
|
65
|
+
controller: controller
|
|
66
|
+
});
|
|
67
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
export interface VideoAgentMeshOptions {
|
|
3
|
+
videoInstance?: HTMLVideoElement;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* 视频经纪人MESH
|
|
7
|
+
*/
|
|
8
|
+
export declare class VideoAgentMesh extends THREE.Mesh {
|
|
9
|
+
options: VideoAgentMeshOptions;
|
|
10
|
+
videoUrl?: string;
|
|
11
|
+
freeze: boolean;
|
|
12
|
+
paused: boolean;
|
|
13
|
+
audioInstance: HTMLAudioElement;
|
|
14
|
+
get videoInstance(): HTMLAudioElement;
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @param width
|
|
18
|
+
* @param height
|
|
19
|
+
* @param widthSegments
|
|
20
|
+
* @param heightSegments
|
|
21
|
+
* @param options
|
|
22
|
+
*/
|
|
23
|
+
constructor(width: number, height: number, widthSegments: number, heightSegments: number, options?: VideoAgentMeshOptions);
|
|
24
|
+
private update;
|
|
25
|
+
play(videoUrl?: string): Promise<unknown>;
|
|
26
|
+
/**
|
|
27
|
+
* 转成毫秒,保障精准度
|
|
28
|
+
*/
|
|
29
|
+
get currentTime(): number;
|
|
30
|
+
}
|