@realsee/vreo 2.6.4 → 3.0.0-webgpu-react18.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/lib/PlayController/createHTMLAudioElement.d.ts +1 -0
- package/lib/PlayController/createHTMLAudioElement.d.ts.map +1 -0
- package/lib/PlayController/index.d.ts +14 -24
- package/lib/PlayController/index.d.ts.map +1 -0
- package/lib/PlayController/index.js +74 -220
- package/lib/PlayController/index.js.map +1 -0
- package/lib/Player/App.d.ts +2 -2
- package/lib/Player/App.d.ts.map +1 -0
- package/lib/Player/Controller.d.ts +11 -6
- package/lib/Player/Controller.d.ts.map +1 -0
- package/lib/Player/PlaybackLifecycle.d.ts +1 -0
- package/lib/Player/PlaybackLifecycle.d.ts.map +1 -0
- package/lib/Player/custom/SpatialScenePanel/index.d.ts +2 -2
- package/lib/Player/custom/SpatialScenePanel/index.d.ts.map +1 -0
- package/lib/Player/hooks.d.ts +3 -2
- package/lib/Player/hooks.d.ts.map +1 -0
- package/lib/Player/index.d.ts +3 -2
- package/lib/Player/index.d.ts.map +1 -0
- package/lib/Player/index.js +1770 -437
- package/lib/Player/index.js.map +1 -0
- package/lib/Player/modules/Drawer/index.d.ts +2 -2
- package/lib/Player/modules/Drawer/index.d.ts.map +1 -0
- package/lib/Player/modules/PopUp/index.d.ts +2 -2
- package/lib/Player/modules/PopUp/index.d.ts.map +1 -0
- package/lib/Player/modules/ResizeObserver/index.d.ts +2 -2
- package/lib/Player/modules/ResizeObserver/index.d.ts.map +1 -0
- package/lib/Player/modules/VideoAgent/VideoAgentMesh.d.ts +5 -2
- package/lib/Player/modules/VideoAgent/VideoAgentMesh.d.ts.map +1 -0
- package/lib/Player/modules/VideoAgent/VideoAgentScene.d.ts +8 -5
- package/lib/Player/modules/VideoAgent/VideoAgentScene.d.ts.map +1 -0
- package/lib/Player/modules/VideoAgent/index.d.ts +11 -2
- package/lib/Player/modules/VideoAgent/index.d.ts.map +1 -0
- package/lib/Player/modules/Wave/index.d.ts +2 -2
- package/lib/Player/modules/Wave/index.d.ts.map +1 -0
- package/lib/Player/modules/keyframes/BgMusic/index.d.ts +2 -2
- package/lib/Player/modules/keyframes/BgMusic/index.d.ts.map +1 -0
- package/lib/Player/modules/keyframes/CameraMovement/index.d.ts +2 -2
- package/lib/Player/modules/keyframes/CameraMovement/index.d.ts.map +1 -0
- package/lib/Player/modules/keyframes/InfoPanel/index.d.ts +2 -2
- package/lib/Player/modules/keyframes/InfoPanel/index.d.ts.map +1 -0
- package/lib/Player/modules/keyframes/ModelVideo/index.d.ts +2 -2
- package/lib/Player/modules/keyframes/ModelVideo/index.d.ts.map +1 -0
- package/lib/Player/modules/keyframes/PanoEffect/index.d.ts +2 -2
- package/lib/Player/modules/keyframes/PanoEffect/index.d.ts.map +1 -0
- package/lib/Player/modules/keyframes/PanoEffect/lineAnime.d.ts +3 -2
- package/lib/Player/modules/keyframes/PanoEffect/lineAnime.d.ts.map +1 -0
- package/lib/Player/modules/keyframes/PanoTag/index.d.ts +1 -0
- package/lib/Player/modules/keyframes/PanoTag/index.d.ts.map +1 -0
- package/lib/Player/modules/keyframes/PanoTextLabel/index.d.ts +2 -2
- package/lib/Player/modules/keyframes/PanoTextLabel/index.d.ts.map +1 -0
- package/lib/Player/modules/keyframes/Prompter/index.d.ts +2 -2
- package/lib/Player/modules/keyframes/Prompter/index.d.ts.map +1 -0
- package/lib/Player/modules/keyframes/UpdateVRPanorama/index.d.ts +2 -2
- package/lib/Player/modules/keyframes/UpdateVRPanorama/index.d.ts.map +1 -0
- package/lib/Player/modules/keyframes/VideoEffect/index.d.ts +2 -2
- package/lib/Player/modules/keyframes/VideoEffect/index.d.ts.map +1 -0
- package/lib/Player/playback-types.d.ts +1 -0
- package/lib/Player/playback-types.d.ts.map +1 -0
- package/lib/Player/typings.d.ts +2 -1
- package/lib/Player/typings.d.ts.map +1 -0
- package/lib/chunks/index-BgPSzRSs.js +93 -0
- package/lib/chunks/index-BgPSzRSs.js.map +1 -0
- package/lib/chunks/index-CunyJn6H.js +51 -0
- package/lib/chunks/index-CunyJn6H.js.map +1 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/centerPoint.d.ts +2 -1
- package/lib/fivePlugins/CSS3DRenderPlugin/centerPoint.d.ts.map +1 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/createResizeObserver.d.ts +5 -6
- package/lib/fivePlugins/CSS3DRenderPlugin/createResizeObserver.d.ts.map +1 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/evenNumber.d.ts +1 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/evenNumber.d.ts.map +1 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/index.d.ts +5 -22
- package/lib/fivePlugins/CSS3DRenderPlugin/index.d.ts.map +1 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.d.ts +2 -1
- package/lib/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.d.ts.map +1 -0
- package/lib/fivePlugins/CameraMovementPlugin/index.d.ts +2 -1
- package/lib/fivePlugins/CameraMovementPlugin/index.d.ts.map +1 -0
- package/lib/fivePlugins/CameraMovementPlugin/typings.d.ts +2 -1
- package/lib/fivePlugins/CameraMovementPlugin/typings.d.ts.map +1 -0
- package/lib/fivePlugins/ModelTVVideoPlugin/index.d.ts +2 -1
- package/lib/fivePlugins/ModelTVVideoPlugin/index.d.ts.map +1 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +12 -1
- package/lib/index.js.map +1 -0
- package/lib/plugins/CSS3DRenderPlugin.js +115 -0
- package/lib/plugins/CSS3DRenderPlugin.js.map +1 -0
- package/lib/plugins/CameraMovementPlugin.js +6 -0
- package/lib/plugins/CameraMovementPlugin.js.map +1 -0
- package/lib/plugins/ModelTVVideoPlugin.js +162 -0
- package/lib/plugins/ModelTVVideoPlugin.js.map +1 -0
- package/lib/react/index.d.ts +5 -4
- package/lib/react/index.d.ts.map +1 -0
- package/lib/react/index.js +39 -226
- package/lib/react/index.js.map +1 -0
- package/lib/shared-utils/Audio.d.ts +3 -1
- package/lib/shared-utils/Audio.d.ts.map +1 -0
- package/lib/shared-utils/AudioLike.d.ts +2 -1
- package/lib/shared-utils/AudioLike.d.ts.map +1 -0
- package/lib/shared-utils/Preloader.d.ts +1 -0
- package/lib/shared-utils/Preloader.d.ts.map +1 -0
- package/lib/shared-utils/addResizeListener.d.ts +2 -1
- package/lib/shared-utils/addResizeListener.d.ts.map +1 -0
- package/lib/shared-utils/animationFrame/BetterTween.d.ts +1 -0
- package/lib/shared-utils/animationFrame/BetterTween.d.ts.map +1 -0
- package/lib/shared-utils/animationFrame/index.d.ts +5 -14
- package/lib/shared-utils/animationFrame/index.d.ts.map +1 -0
- package/lib/shared-utils/animationFrame/tween.d.ts +1 -0
- package/lib/shared-utils/animationFrame/tween.d.ts.map +1 -0
- package/lib/shared-utils/createTransMatrix.d.ts +3 -1
- package/lib/shared-utils/createTransMatrix.d.ts.map +1 -0
- package/lib/shared-utils/getFileExpandedName.d.ts +1 -0
- package/lib/shared-utils/getFileExpandedName.d.ts.map +1 -0
- package/lib/shared-utils/getMediaInfo.d.ts +1 -0
- package/lib/shared-utils/getMediaInfo.d.ts.map +1 -0
- package/lib/shared-utils/setElementDataset.d.ts +1 -0
- package/lib/shared-utils/setElementDataset.d.ts.map +1 -0
- package/lib/timeline/index.d.ts +18 -0
- package/lib/timeline/index.d.ts.map +1 -0
- package/lib/types/index.js +10 -0
- package/lib/types/index.js.map +1 -0
- package/lib/typings/VreoUnit.d.ts +2 -1
- package/lib/typings/VreoUnit.d.ts.map +1 -0
- package/lib/typings/index.d.ts +1 -0
- package/lib/typings/index.d.ts.map +1 -0
- package/package.json +51 -71
- package/lib/PlayController/createHTMLAudioElement.js +0 -34
- package/lib/Player/App.js +0 -52
- package/lib/Player/Controller.js +0 -536
- package/lib/Player/PlaybackLifecycle.js +0 -118
- package/lib/Player/custom/SpatialScenePanel/index.js +0 -240
- package/lib/Player/hooks.js +0 -22
- package/lib/Player/modules/Drawer/index.js +0 -40
- package/lib/Player/modules/PopUp/index.js +0 -23
- package/lib/Player/modules/ResizeObserver/index.js +0 -22
- package/lib/Player/modules/VideoAgent/VideoAgentMesh.js +0 -456
- package/lib/Player/modules/VideoAgent/VideoAgentScene.js +0 -53
- package/lib/Player/modules/VideoAgent/index.js +0 -72
- package/lib/Player/modules/Wave/index.js +0 -171
- package/lib/Player/modules/keyframes/BgMusic/index.js +0 -65
- package/lib/Player/modules/keyframes/CameraMovement/index.js +0 -75
- package/lib/Player/modules/keyframes/InfoPanel/index.js +0 -170
- package/lib/Player/modules/keyframes/ModelVideo/index.js +0 -128
- package/lib/Player/modules/keyframes/PanoEffect/index.js +0 -99
- package/lib/Player/modules/keyframes/PanoEffect/lineAnime.js +0 -30
- package/lib/Player/modules/keyframes/PanoTag/index.js +0 -110
- package/lib/Player/modules/keyframes/PanoTextLabel/index.js +0 -122
- package/lib/Player/modules/keyframes/Prompter/index.js +0 -56
- package/lib/Player/modules/keyframes/UpdateVRPanorama/index.js +0 -98
- package/lib/Player/modules/keyframes/VideoEffect/index.js +0 -154
- package/lib/Player/playback-types.js +0 -1
- package/lib/Player/typings.js +0 -1
- package/lib/fivePlugins/CSS3DRenderPlugin/centerPoint.js +0 -4
- package/lib/fivePlugins/CSS3DRenderPlugin/createResizeObserver.js +0 -25
- package/lib/fivePlugins/CSS3DRenderPlugin/evenNumber.js +0 -4
- package/lib/fivePlugins/CSS3DRenderPlugin/index.js +0 -226
- package/lib/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.js +0 -8
- package/lib/fivePlugins/CameraMovementPlugin/index.js +0 -245
- package/lib/fivePlugins/CameraMovementPlugin/typings.js +0 -15
- package/lib/fivePlugins/ModelTVVideoPlugin/index.js +0 -349
- package/lib/shared-utils/Audio.js +0 -151
- package/lib/shared-utils/AudioLike.js +0 -123
- package/lib/shared-utils/Preloader.js +0 -37
- package/lib/shared-utils/addResizeListener.js +0 -39
- package/lib/shared-utils/animationFrame/BetterTween.js +0 -58
- package/lib/shared-utils/animationFrame/index.js +0 -52
- package/lib/shared-utils/animationFrame/tween.js +0 -58
- package/lib/shared-utils/createTransMatrix.js +0 -12
- package/lib/shared-utils/getFileExpandedName.js +0 -6
- package/lib/shared-utils/getMediaInfo.js +0 -55
- package/lib/shared-utils/setElementDataset.js +0 -16
- package/lib/typings/VreoUnit.js +0 -64
- package/lib/typings/index.js +0 -1
package/lib/Player/Controller.js
DELETED
|
@@ -1,536 +0,0 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
-
import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
|
|
5
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
6
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
7
|
-
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
8
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
9
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11
|
-
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); }; }
|
|
12
|
-
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; } }
|
|
13
|
-
import { PlaybackLifecycle } from "./PlaybackLifecycle.js";
|
|
14
|
-
import { Subscribe } from '@realsee/five';
|
|
15
|
-
import { action, makeObservable, observable, reaction } from 'mobx';
|
|
16
|
-
import * as React from 'react';
|
|
17
|
-
import { requestAnimationFrameInterval } from "../shared-utils/animationFrame/index.js";
|
|
18
|
-
import { VreoKeyframeEnum } from "../typings/VreoUnit.js";
|
|
19
|
-
import setElementDataset from "../shared-utils/setElementDataset.js";
|
|
20
|
-
import { getMediaType } from "../shared-utils/getMediaInfo.js";
|
|
21
|
-
/**
|
|
22
|
-
* Vreo 播放器逻辑控制器
|
|
23
|
-
*
|
|
24
|
-
* 负责管理播放器的内部状态、事件处理、UI 控制和剧本执行。
|
|
25
|
-
* 提供播放控制、外观设置、弹窗管理、抽屉控制等功能。
|
|
26
|
-
*
|
|
27
|
-
* @example
|
|
28
|
-
* ```typescript
|
|
29
|
-
* const controller = new Controller({
|
|
30
|
-
* five: fiveInstance,
|
|
31
|
-
* container: document.getElementById('container'),
|
|
32
|
-
* configs: playerConfigs
|
|
33
|
-
* })
|
|
34
|
-
*
|
|
35
|
-
* // 设置播放状态
|
|
36
|
-
* controller.setPlaying(true)
|
|
37
|
-
*
|
|
38
|
-
* // 打开弹窗
|
|
39
|
-
* controller.openPopUp('弹窗内容')
|
|
40
|
-
*
|
|
41
|
-
* // 打开抽屉
|
|
42
|
-
* controller.openDrawer({ content: '抽屉内容', height: 300 })
|
|
43
|
-
* ```
|
|
44
|
-
*/
|
|
45
|
-
export var Controller = /*#__PURE__*/function (_Subscribe) {
|
|
46
|
-
_inherits(Controller, _Subscribe);
|
|
47
|
-
var _super = _createSuper(Controller);
|
|
48
|
-
function Controller(_ref) {
|
|
49
|
-
var _this;
|
|
50
|
-
var five = _ref.five,
|
|
51
|
-
container = _ref.container,
|
|
52
|
-
configs = _ref.configs;
|
|
53
|
-
_classCallCheck(this, Controller);
|
|
54
|
-
_this = _super.call(this);
|
|
55
|
-
_defineProperty(_assertThisInitialized(_this), "playing", false);
|
|
56
|
-
_defineProperty(_assertThisInitialized(_this), "ended", false);
|
|
57
|
-
_defineProperty(_assertThisInitialized(_this), "loading", false);
|
|
58
|
-
_defineProperty(_assertThisInitialized(_this), "containerSize", {
|
|
59
|
-
width: 0,
|
|
60
|
-
height: 0
|
|
61
|
-
});
|
|
62
|
-
_defineProperty(_assertThisInitialized(_this), "waveAppearance", null);
|
|
63
|
-
_defineProperty(_assertThisInitialized(_this), "appearance", {
|
|
64
|
-
waveStyle: 'wave'
|
|
65
|
-
});
|
|
66
|
-
_defineProperty(_assertThisInitialized(_this), "avatar", {});
|
|
67
|
-
_defineProperty(_assertThisInitialized(_this), "waitingForBgMusic", false);
|
|
68
|
-
_defineProperty(_assertThisInitialized(_this), "visible", false);
|
|
69
|
-
_defineProperty(_assertThisInitialized(_this), "popUp", null);
|
|
70
|
-
_defineProperty(_assertThisInitialized(_this), "drawerConfig", null);
|
|
71
|
-
_defineProperty(_assertThisInitialized(_this), "resumeGeneration", 0);
|
|
72
|
-
_defineProperty(_assertThisInitialized(_this), "disposers", []);
|
|
73
|
-
_this.playback = new PlaybackLifecycle(configs.mediaManager, function () {
|
|
74
|
-
var _this$videoAgentScene;
|
|
75
|
-
_this.resuming = undefined;
|
|
76
|
-
++_this.resumeGeneration;
|
|
77
|
-
_this.setPlaying(false);
|
|
78
|
-
(_this$videoAgentScene = _this.videoAgentScene) === null || _this$videoAgentScene === void 0 ? void 0 : _this$videoAgentScene.videoAgentMesh.stop();
|
|
79
|
-
_this.setWaitingForBgMusic(false);
|
|
80
|
-
});
|
|
81
|
-
_this.configs = configs;
|
|
82
|
-
_this.container = container;
|
|
83
|
-
_this.five = five;
|
|
84
|
-
_this.appSize = configs.appSize;
|
|
85
|
-
_this.appearance = _objectSpread(_objectSpread({}, _this.appearance), configs.appearance);
|
|
86
|
-
makeObservable(_assertThisInitialized(_this), {
|
|
87
|
-
visible: observable,
|
|
88
|
-
setVisible: action,
|
|
89
|
-
playing: observable,
|
|
90
|
-
setPlaying: action,
|
|
91
|
-
loading: observable,
|
|
92
|
-
// videoAgentScene: observable.ref,
|
|
93
|
-
setLoading: action,
|
|
94
|
-
popUp: observable.ref,
|
|
95
|
-
openPopUp: action,
|
|
96
|
-
drawerConfig: observable.ref,
|
|
97
|
-
openDrawer: action,
|
|
98
|
-
ended: observable,
|
|
99
|
-
waveAppearance: observable,
|
|
100
|
-
avatar: observable,
|
|
101
|
-
containerSize: observable,
|
|
102
|
-
setContainerSize: action,
|
|
103
|
-
appearance: observable,
|
|
104
|
-
setAppearance: action,
|
|
105
|
-
configs: observable.ref,
|
|
106
|
-
setEnded: action,
|
|
107
|
-
setAvatar: action,
|
|
108
|
-
waitingForBgMusic: observable,
|
|
109
|
-
setWaitingForBgMusic: action
|
|
110
|
-
});
|
|
111
|
-
_this.disposers.push(reaction(function () {
|
|
112
|
-
return [_this.appearance.waveStyle, _this.loading];
|
|
113
|
-
}, function (_ref2) {
|
|
114
|
-
var _ref3 = _slicedToArray(_ref2, 2),
|
|
115
|
-
waveStyle = _ref3[0],
|
|
116
|
-
loading = _ref3[1];
|
|
117
|
-
if (loading === null) {
|
|
118
|
-
_this.waveAppearance = null;
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
if (waveStyle === 'wave') {
|
|
122
|
-
switch (loading) {
|
|
123
|
-
case true:
|
|
124
|
-
_this.waveAppearance = 'double';
|
|
125
|
-
break;
|
|
126
|
-
case false:
|
|
127
|
-
_this.waveAppearance = 'solid';
|
|
128
|
-
break;
|
|
129
|
-
}
|
|
130
|
-
} else if (waveStyle === 'solid') {
|
|
131
|
-
switch (loading) {
|
|
132
|
-
case true:
|
|
133
|
-
_this.waveAppearance = 'swap';
|
|
134
|
-
break;
|
|
135
|
-
case false:
|
|
136
|
-
_this.waveAppearance = 'expand';
|
|
137
|
-
break;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}, {
|
|
141
|
-
fireImmediately: true
|
|
142
|
-
}));
|
|
143
|
-
if (!_this.appSize) {
|
|
144
|
-
_this.disposers.push(reaction(function () {
|
|
145
|
-
return _this.containerSize;
|
|
146
|
-
}, function (containerSize) {
|
|
147
|
-
if (!(containerSize !== null && containerSize !== void 0 && containerSize.width)) return;
|
|
148
|
-
var width = containerSize.width;
|
|
149
|
-
var height = containerSize.height;
|
|
150
|
-
var size = function () {
|
|
151
|
-
if (width <= 500) return 'S';
|
|
152
|
-
if (width <= 1024) return 'M';
|
|
153
|
-
if (width <= 2048) return 'L';
|
|
154
|
-
return 'XL';
|
|
155
|
-
}();
|
|
156
|
-
var orientation = function () {
|
|
157
|
-
if (height > width) return 'portrait';
|
|
158
|
-
return 'landscape';
|
|
159
|
-
}();
|
|
160
|
-
setElementDataset(_this.container, {
|
|
161
|
-
size: size
|
|
162
|
-
});
|
|
163
|
-
setElementDataset(_this.container, {
|
|
164
|
-
orientation: orientation
|
|
165
|
-
});
|
|
166
|
-
}, {
|
|
167
|
-
fireImmediately: true
|
|
168
|
-
}));
|
|
169
|
-
} else {
|
|
170
|
-
setElementDataset(_this.container, {
|
|
171
|
-
size: _this.appSize
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
// 监听播放情况:抛出触发时机
|
|
176
|
-
_this.disposers.push(reaction(function () {
|
|
177
|
-
return _this.ended;
|
|
178
|
-
}, function (ended) {
|
|
179
|
-
if (ended) {
|
|
180
|
-
_this.emit('paused', true);
|
|
181
|
-
}
|
|
182
|
-
}));
|
|
183
|
-
_this.disposers.push(reaction(function () {
|
|
184
|
-
return _this.playing;
|
|
185
|
-
}, function (playing) {
|
|
186
|
-
if (!_this.ended) {
|
|
187
|
-
_this.emit(playing ? 'playing' : 'paused');
|
|
188
|
-
}
|
|
189
|
-
}));
|
|
190
|
-
return _this;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
/**
|
|
194
|
-
* 获取播放器是否准备就绪
|
|
195
|
-
* @returns 是否有可用的视频代理场景
|
|
196
|
-
*/
|
|
197
|
-
_createClass(Controller, [{
|
|
198
|
-
key: "agentType",
|
|
199
|
-
get:
|
|
200
|
-
// null 表示加载失败
|
|
201
|
-
|
|
202
|
-
/**
|
|
203
|
-
* 是否正在等待背景音乐加载
|
|
204
|
-
* 当此状态为 true 时,播放流程会暂停,等待音频加载完成
|
|
205
|
-
*/
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* 获取当前播放媒体的类型
|
|
209
|
-
* @returns 'video' | 'avatar' | 'none' - 媒体类型
|
|
210
|
-
*/
|
|
211
|
-
function get() {
|
|
212
|
-
var _this$videoAgentScene2, _this$avatar;
|
|
213
|
-
var type = getMediaType((_this$videoAgentScene2 = this.videoAgentScene) === null || _this$videoAgentScene2 === void 0 ? void 0 : _this$videoAgentScene2.videoAgentMesh.videoUrl);
|
|
214
|
-
if ((_this$avatar = this.avatar) !== null && _this$avatar !== void 0 && _this$avatar.force) return 'avatar';
|
|
215
|
-
if (type === 'video') return 'video';
|
|
216
|
-
return 'none';
|
|
217
|
-
}
|
|
218
|
-
}, {
|
|
219
|
-
key: "openPopUp",
|
|
220
|
-
value:
|
|
221
|
-
/**
|
|
222
|
-
* 打开或关闭弹窗
|
|
223
|
-
* @param popUp - 弹窗内容,可以是字符串、JSX元素或false(关闭弹窗)
|
|
224
|
-
*/
|
|
225
|
-
function openPopUp(popUp) {
|
|
226
|
-
if (!popUp) {
|
|
227
|
-
this.popUp = null;
|
|
228
|
-
return;
|
|
229
|
-
}
|
|
230
|
-
this.popUp = popUp;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
/**
|
|
234
|
-
* 设置加载状态
|
|
235
|
-
* @param loading - 加载状态:true(加载中)、false(加载完成)、null(加载失败)
|
|
236
|
-
*/
|
|
237
|
-
}, {
|
|
238
|
-
key: "setLoading",
|
|
239
|
-
value: function setLoading(loading) {
|
|
240
|
-
this.loading = loading;
|
|
241
|
-
}
|
|
242
|
-
}, {
|
|
243
|
-
key: "setAvatar",
|
|
244
|
-
value:
|
|
245
|
-
/**
|
|
246
|
-
* 设置虚拟形象配置
|
|
247
|
-
* @param avatar - 虚拟形象配置对象
|
|
248
|
-
*/
|
|
249
|
-
function setAvatar(avatar) {
|
|
250
|
-
this.avatar = avatar;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
/**
|
|
254
|
-
* 设置容器尺寸
|
|
255
|
-
* @param width - 容器宽度
|
|
256
|
-
* @param height - 容器高度
|
|
257
|
-
*/
|
|
258
|
-
}, {
|
|
259
|
-
key: "setContainerSize",
|
|
260
|
-
value: function setContainerSize(width, height) {
|
|
261
|
-
this.containerSize = {
|
|
262
|
-
width: width,
|
|
263
|
-
height: height
|
|
264
|
-
};
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
/**
|
|
268
|
-
* 设置播放器可见性
|
|
269
|
-
* @param v - 是否可见
|
|
270
|
-
*/
|
|
271
|
-
}, {
|
|
272
|
-
key: "setVisible",
|
|
273
|
-
value: function setVisible(v) {
|
|
274
|
-
this.visible = v;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
/**
|
|
278
|
-
* 设置播放状态
|
|
279
|
-
* @param playing - 是否正在播放
|
|
280
|
-
*/
|
|
281
|
-
}, {
|
|
282
|
-
key: "setPlaying",
|
|
283
|
-
value: function setPlaying(playing) {
|
|
284
|
-
if (playing && !this.playback.active) return;
|
|
285
|
-
this.playing = playing;
|
|
286
|
-
if (playing) this.resumeMedia();
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
/**
|
|
290
|
-
* 设置结束状态
|
|
291
|
-
* @param ended - 是否已结束
|
|
292
|
-
*/
|
|
293
|
-
}, {
|
|
294
|
-
key: "setEnded",
|
|
295
|
-
value: function setEnded(ended) {
|
|
296
|
-
this.ended = ended;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
/**
|
|
300
|
-
* 设置是否正在等待背景音乐加载
|
|
301
|
-
* @param waiting - 是否正在等待
|
|
302
|
-
*/
|
|
303
|
-
}, {
|
|
304
|
-
key: "setWaitingForBgMusic",
|
|
305
|
-
value: function setWaitingForBgMusic(waiting) {
|
|
306
|
-
this.waitingForBgMusic = waiting;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
/**
|
|
310
|
-
* 设置播放器外观
|
|
311
|
-
* @param appearance - 外观配置对象
|
|
312
|
-
*/
|
|
313
|
-
}, {
|
|
314
|
-
key: "setAppearance",
|
|
315
|
-
value: function setAppearance(appearance) {
|
|
316
|
-
this.appearance = _objectSpread(_objectSpread({}, this.appearance), appearance);
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
/**
|
|
320
|
-
* 打开或关闭抽屉
|
|
321
|
-
* @param drawerConfig - 抽屉配置对象,false表示关闭抽屉
|
|
322
|
-
*/
|
|
323
|
-
}, {
|
|
324
|
-
key: "openDrawer",
|
|
325
|
-
value: function openDrawer(drawerConfig) {
|
|
326
|
-
if (!drawerConfig) {
|
|
327
|
-
var _this$drawerConfig;
|
|
328
|
-
this.drawerConfig = {
|
|
329
|
-
content: '',
|
|
330
|
-
height: (_this$drawerConfig = this.drawerConfig) === null || _this$drawerConfig === void 0 ? void 0 : _this$drawerConfig.height
|
|
331
|
-
};
|
|
332
|
-
return;
|
|
333
|
-
}
|
|
334
|
-
this.drawerConfig = drawerConfig;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
/**
|
|
338
|
-
* 创建 Controller 实例
|
|
339
|
-
* @param params - 构造参数对象
|
|
340
|
-
* @param params.five - Five 渲染引擎实例
|
|
341
|
-
* @param params.container - DOM 容器元素
|
|
342
|
-
* @param params.configs - 播放器配置
|
|
343
|
-
*/
|
|
344
|
-
}, {
|
|
345
|
-
key: "ready",
|
|
346
|
-
get: function get() {
|
|
347
|
-
return !!this.videoAgentScene;
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
/**
|
|
351
|
-
* 获取当前播放时间(毫秒)
|
|
352
|
-
* @returns 当前播放时间戳
|
|
353
|
-
*/
|
|
354
|
-
}, {
|
|
355
|
-
key: "currentTime",
|
|
356
|
-
get: function get() {
|
|
357
|
-
var _this$videoAgentScene3;
|
|
358
|
-
return ((_this$videoAgentScene3 = this.videoAgentScene) === null || _this$videoAgentScene3 === void 0 ? void 0 : _this$videoAgentScene3.videoAgentMesh.currentTime) || 0;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
/**
|
|
362
|
-
* 获取当前时间点应该触发的关键帧
|
|
363
|
-
* @returns 当前应该执行的关键帧数组
|
|
364
|
-
*/
|
|
365
|
-
}, {
|
|
366
|
-
key: "currentKeyframes",
|
|
367
|
-
get: function get() {
|
|
368
|
-
var _this2 = this;
|
|
369
|
-
if (!this.vreoUnit) return [];
|
|
370
|
-
var keyframes = this.vreoUnit.keyframes;
|
|
371
|
-
// 没有被解析过且开始时间低于当前时间戳 100ms
|
|
372
|
-
return keyframes.filter(function (keyframe) {
|
|
373
|
-
if (keyframe.parsed) return false;
|
|
374
|
-
// 检测结束时间
|
|
375
|
-
if (keyframe.end < _this2.currentTime) return false;
|
|
376
|
-
// 检测开始时间
|
|
377
|
-
if (keyframe.start > _this2.currentTime) return false;
|
|
378
|
-
if (keyframe.type === VreoKeyframeEnum.BgMusic) return true;
|
|
379
|
-
// 开始时间低于当前时间戳 100ms
|
|
380
|
-
var dur = _this2.currentTime - keyframe.start;
|
|
381
|
-
return dur <= 100 && dur >= 0;
|
|
382
|
-
});
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
/**
|
|
386
|
-
* 获取当前媒体实例(音频或视频元素)
|
|
387
|
-
* @returns HTML媒体元素实例
|
|
388
|
-
*/
|
|
389
|
-
}, {
|
|
390
|
-
key: "mediaInstance",
|
|
391
|
-
get: function get() {
|
|
392
|
-
var _this$videoAgentScene4;
|
|
393
|
-
return (_this$videoAgentScene4 = this.videoAgentScene) === null || _this$videoAgentScene4 === void 0 ? void 0 : _this$videoAgentScene4.videoAgentMesh.mediaInstance;
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
/**
|
|
397
|
-
* 逐帧任务循环处理
|
|
398
|
-
*
|
|
399
|
-
* 在每个动画帧中检查播放状态、处理关键帧触发等
|
|
400
|
-
* @param callback - 关键帧触发时的回调函数
|
|
401
|
-
*/
|
|
402
|
-
}, {
|
|
403
|
-
key: "requestAnimationFrameLoop",
|
|
404
|
-
value: function requestAnimationFrameLoop(callback) {
|
|
405
|
-
var _this$mediaInstance2,
|
|
406
|
-
_this3 = this;
|
|
407
|
-
// 如果正在等待背景音乐加载,暂停整个播放流程
|
|
408
|
-
if (this.waitingForBgMusic) {
|
|
409
|
-
var _this$mediaInstance;
|
|
410
|
-
if (!((_this$mediaInstance = this.mediaInstance) !== null && _this$mediaInstance !== void 0 && _this$mediaInstance.paused)) {
|
|
411
|
-
var _this$videoAgentScene5, _this$videoAgentScene6;
|
|
412
|
-
(_this$videoAgentScene5 = this.videoAgentScene) === null || _this$videoAgentScene5 === void 0 ? void 0 : (_this$videoAgentScene6 = _this$videoAgentScene5.videoAgentMesh.mediaOperations) === null || _this$videoAgentScene6 === void 0 ? void 0 : _this$videoAgentScene6.pause();
|
|
413
|
-
}
|
|
414
|
-
return;
|
|
415
|
-
}
|
|
416
|
-
if ((_this$mediaInstance2 = this.mediaInstance) !== null && _this$mediaInstance2 !== void 0 && _this$mediaInstance2.ended && this.mediaInstance.currentTime !== 0) {
|
|
417
|
-
var _this$vreoUnit, _this$videoAgentScene7;
|
|
418
|
-
if (this.ended) return;
|
|
419
|
-
(_this$vreoUnit = this.vreoUnit) === null || _this$vreoUnit === void 0 ? void 0 : _this$vreoUnit.keyframes.forEach(function (keyframe) {
|
|
420
|
-
return keyframe.parsed = false;
|
|
421
|
-
});
|
|
422
|
-
var media = (_this$videoAgentScene7 = this.videoAgentScene) === null || _this$videoAgentScene7 === void 0 ? void 0 : _this$videoAgentScene7.videoAgentMesh.mediaOperations;
|
|
423
|
-
media === null || media === void 0 ? void 0 : media.pause();
|
|
424
|
-
if (media) media.currentTime = 0;
|
|
425
|
-
this.playback.finish();
|
|
426
|
-
this.setEnded(true);
|
|
427
|
-
this.setPlaying(false);
|
|
428
|
-
return;
|
|
429
|
-
}
|
|
430
|
-
if (!this.playing) {
|
|
431
|
-
var _this$mediaInstance3;
|
|
432
|
-
if (!((_this$mediaInstance3 = this.mediaInstance) !== null && _this$mediaInstance3 !== void 0 && _this$mediaInstance3.paused)) {
|
|
433
|
-
var _this$videoAgentScene8, _this$videoAgentScene9;
|
|
434
|
-
(_this$videoAgentScene8 = this.videoAgentScene) === null || _this$videoAgentScene8 === void 0 ? void 0 : (_this$videoAgentScene9 = _this$videoAgentScene8.videoAgentMesh.mediaOperations) === null || _this$videoAgentScene9 === void 0 ? void 0 : _this$videoAgentScene9.pause();
|
|
435
|
-
}
|
|
436
|
-
return;
|
|
437
|
-
}
|
|
438
|
-
this.resumeMedia();
|
|
439
|
-
var currentKeyframes = this.currentKeyframes;
|
|
440
|
-
var run = this.playback.capture();
|
|
441
|
-
currentKeyframes.forEach(function (keyframe) {
|
|
442
|
-
if (!(run !== null && run !== void 0 && run.valid()) || keyframe.parsed) return;
|
|
443
|
-
keyframe.parsed = true;
|
|
444
|
-
_this3.emit(keyframe.type, keyframe, _this3.currentTime);
|
|
445
|
-
if (callback && run.valid()) {
|
|
446
|
-
callback(keyframe.type, keyframe, _this3.currentTime);
|
|
447
|
-
}
|
|
448
|
-
});
|
|
449
|
-
}
|
|
450
|
-
}, {
|
|
451
|
-
key: "resumeMedia",
|
|
452
|
-
value: function resumeMedia() {
|
|
453
|
-
var _this$mediaInstance4,
|
|
454
|
-
_this4 = this;
|
|
455
|
-
if (this.waitingForBgMusic) return;
|
|
456
|
-
if ((_this$mediaInstance4 = this.mediaInstance) !== null && _this$mediaInstance4 !== void 0 && _this$mediaInstance4.paused && this.playing && !this.resuming) {
|
|
457
|
-
var _this$videoAgentScene10;
|
|
458
|
-
var attempt = ++this.resumeGeneration;
|
|
459
|
-
this.resuming = attempt;
|
|
460
|
-
var run = this.playback.capture();
|
|
461
|
-
var valid = function valid() {
|
|
462
|
-
return !!(run !== null && run !== void 0 && run.valid());
|
|
463
|
-
};
|
|
464
|
-
void ((_this$videoAgentScene10 = this.videoAgentScene) === null || _this$videoAgentScene10 === void 0 ? void 0 : _this$videoAgentScene10.videoAgentMesh.play().catch(function (error) {
|
|
465
|
-
if (valid()) {
|
|
466
|
-
_this4.playback.cancel();
|
|
467
|
-
console.error(error);
|
|
468
|
-
}
|
|
469
|
-
}).finally(function () {
|
|
470
|
-
if (_this4.resuming === attempt) _this4.resuming = undefined;
|
|
471
|
-
}));
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
/**
|
|
476
|
-
* 开始运行播放器逻辑循环
|
|
477
|
-
*
|
|
478
|
-
* 启动帧循环,持续监听并处理关键帧事件
|
|
479
|
-
* @param callback - 关键帧触发时的回调函数
|
|
480
|
-
*/
|
|
481
|
-
}, {
|
|
482
|
-
key: "run",
|
|
483
|
-
value: function run(callback) {
|
|
484
|
-
var _this5 = this;
|
|
485
|
-
if (this.stopInterval) return;
|
|
486
|
-
this.stopInterval = requestAnimationFrameInterval(function () {
|
|
487
|
-
return _this5.requestAnimationFrameLoop(callback);
|
|
488
|
-
});
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
/**
|
|
492
|
-
* 清理播放器状态
|
|
493
|
-
*
|
|
494
|
-
* 停止播放、重置关键帧状态、清理数据和定时器
|
|
495
|
-
*/
|
|
496
|
-
}, {
|
|
497
|
-
key: "clear",
|
|
498
|
-
value: function clear() {
|
|
499
|
-
var _this$vreoUnit2, _this$stopInterval;
|
|
500
|
-
this.setPlaying(false);
|
|
501
|
-
(_this$vreoUnit2 = this.vreoUnit) === null || _this$vreoUnit2 === void 0 ? void 0 : _this$vreoUnit2.keyframes.forEach(function (keyframe) {
|
|
502
|
-
return keyframe.parsed = false;
|
|
503
|
-
});
|
|
504
|
-
|
|
505
|
-
/**
|
|
506
|
-
* 清理掉数据
|
|
507
|
-
*/
|
|
508
|
-
this.vreoUnit = undefined;
|
|
509
|
-
if (this.mediaInstance) {
|
|
510
|
-
var _this$videoAgentScene11, _this$videoAgentScene12, _this$videoAgentScene13;
|
|
511
|
-
(_this$videoAgentScene11 = this.videoAgentScene) === null || _this$videoAgentScene11 === void 0 ? void 0 : (_this$videoAgentScene12 = _this$videoAgentScene11.videoAgentMesh.mediaOperations) === null || _this$videoAgentScene12 === void 0 ? void 0 : _this$videoAgentScene12.pause();
|
|
512
|
-
if ((_this$videoAgentScene13 = this.videoAgentScene) !== null && _this$videoAgentScene13 !== void 0 && _this$videoAgentScene13.videoAgentMesh.mediaOperations) this.videoAgentScene.videoAgentMesh.mediaOperations.currentTime = 0;
|
|
513
|
-
}
|
|
514
|
-
(_this$stopInterval = this.stopInterval) === null || _this$stopInterval === void 0 ? void 0 : _this$stopInterval.call(this);
|
|
515
|
-
this.stopInterval = undefined;
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
/**
|
|
519
|
-
* 销毁控制器实例
|
|
520
|
-
*
|
|
521
|
-
* 清理所有状态和资源,释放内存
|
|
522
|
-
*/
|
|
523
|
-
}, {
|
|
524
|
-
key: "dispose",
|
|
525
|
-
value: function dispose() {
|
|
526
|
-
this.disposers.splice(0).forEach(function (dispose) {
|
|
527
|
-
return dispose();
|
|
528
|
-
});
|
|
529
|
-
this.playback.dispose();
|
|
530
|
-
this.clear();
|
|
531
|
-
}
|
|
532
|
-
}]);
|
|
533
|
-
return Controller;
|
|
534
|
-
}(Subscribe);
|
|
535
|
-
var ControllerContext = /*#__PURE__*/React.createContext(null);
|
|
536
|
-
export { ControllerContext };
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
5
|
-
/** Local timeline lifetime only. Playback permission is owned by the injected manager. */
|
|
6
|
-
export var PlaybackLifecycle = /*#__PURE__*/function () {
|
|
7
|
-
function PlaybackLifecycle(manager, onStop) {
|
|
8
|
-
var _this = this;
|
|
9
|
-
_classCallCheck(this, PlaybackLifecycle);
|
|
10
|
-
_defineProperty(this, "generation", 0);
|
|
11
|
-
_defineProperty(this, "disposed", false);
|
|
12
|
-
_defineProperty(this, "members", new Set());
|
|
13
|
-
this.onStop = onStop;
|
|
14
|
-
this.controller = manager === null || manager === void 0 ? void 0 : manager.createController({
|
|
15
|
-
label: 'vreo',
|
|
16
|
-
onCancel: function onCancel() {
|
|
17
|
-
return _this.stop();
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
_createClass(PlaybackLifecycle, [{
|
|
22
|
-
key: "active",
|
|
23
|
-
get: function get() {
|
|
24
|
-
var _this$run;
|
|
25
|
-
return !!((_this$run = this.run) !== null && _this$run !== void 0 && _this$run.valid());
|
|
26
|
-
}
|
|
27
|
-
}, {
|
|
28
|
-
key: "capture",
|
|
29
|
-
value: function capture() {
|
|
30
|
-
return this.run;
|
|
31
|
-
}
|
|
32
|
-
}, {
|
|
33
|
-
key: "begin",
|
|
34
|
-
value: function begin(userAction) {
|
|
35
|
-
var _this$controller$begi,
|
|
36
|
-
_this$controller,
|
|
37
|
-
_this2 = this;
|
|
38
|
-
if (this.disposed) return false;
|
|
39
|
-
if (this.active) return true;
|
|
40
|
-
var session = (_this$controller$begi = (_this$controller = this.controller) === null || _this$controller === void 0 ? void 0 : _this$controller.begin({
|
|
41
|
-
userAction: userAction,
|
|
42
|
-
audible: true
|
|
43
|
-
})) !== null && _this$controller$begi !== void 0 ? _this$controller$begi : undefined;
|
|
44
|
-
if (this.controller && !session) return false;
|
|
45
|
-
var generation = ++this.generation;
|
|
46
|
-
var mediaManager = session === null || session === void 0 ? void 0 : session.mediaManager;
|
|
47
|
-
this.run = {
|
|
48
|
-
session: session,
|
|
49
|
-
mediaManager: mediaManager,
|
|
50
|
-
valid: function valid() {
|
|
51
|
-
return generation === _this2.generation && !_this2.disposed && !(session !== null && session !== void 0 && session.signal.aborted);
|
|
52
|
-
},
|
|
53
|
-
bind: function bind(element) {
|
|
54
|
-
return session ? session.bind(element) : element;
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
return true;
|
|
58
|
-
}
|
|
59
|
-
}, {
|
|
60
|
-
key: "add",
|
|
61
|
-
value: function add(stop) {
|
|
62
|
-
var _this3 = this;
|
|
63
|
-
this.members.add(stop);
|
|
64
|
-
return function () {
|
|
65
|
-
_this3.members.delete(stop);
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
}, {
|
|
69
|
-
key: "stop",
|
|
70
|
-
value: function stop() {
|
|
71
|
-
++this.generation;
|
|
72
|
-
this.run = undefined;
|
|
73
|
-
var errors = [];
|
|
74
|
-
try {
|
|
75
|
-
this.onStop();
|
|
76
|
-
} catch (error) {
|
|
77
|
-
errors.push(error);
|
|
78
|
-
}
|
|
79
|
-
for (var _i = 0, _arr = _toConsumableArray(this.members); _i < _arr.length; _i++) {
|
|
80
|
-
var stop = _arr[_i];
|
|
81
|
-
try {
|
|
82
|
-
stop();
|
|
83
|
-
} catch (error) {
|
|
84
|
-
errors.push(error);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
if (errors.length) throw errors[0];
|
|
88
|
-
}
|
|
89
|
-
}, {
|
|
90
|
-
key: "cancel",
|
|
91
|
-
value: function cancel() {
|
|
92
|
-
var _this$controller2;
|
|
93
|
-
var generation = this.generation;
|
|
94
|
-
(_this$controller2 = this.controller) === null || _this$controller2 === void 0 ? void 0 : _this$controller2.cancel();
|
|
95
|
-
if (generation === this.generation) this.stop();
|
|
96
|
-
}
|
|
97
|
-
}, {
|
|
98
|
-
key: "finish",
|
|
99
|
-
value: function finish() {
|
|
100
|
-
var _this$run2;
|
|
101
|
-
var session = (_this$run2 = this.run) === null || _this$run2 === void 0 ? void 0 : _this$run2.session;
|
|
102
|
-
this.stop();
|
|
103
|
-
session === null || session === void 0 ? void 0 : session.finish();
|
|
104
|
-
}
|
|
105
|
-
}, {
|
|
106
|
-
key: "dispose",
|
|
107
|
-
value: function dispose() {
|
|
108
|
-
var _this$controller3;
|
|
109
|
-
if (this.disposed) return;
|
|
110
|
-
this.disposed = true;
|
|
111
|
-
var generation = this.generation;
|
|
112
|
-
(_this$controller3 = this.controller) === null || _this$controller3 === void 0 ? void 0 : _this$controller3.dispose();
|
|
113
|
-
if (generation === this.generation) this.stop();
|
|
114
|
-
this.members.clear();
|
|
115
|
-
}
|
|
116
|
-
}]);
|
|
117
|
-
return PlaybackLifecycle;
|
|
118
|
-
}();
|