@realsee/vreo 1.0.0-alpha.26 → 1.0.0-alpha.28

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.
@@ -9,6 +9,7 @@ var _five = require("@realsee/five");
9
9
  var _mobx = require("mobx");
10
10
  var React = _interopRequireWildcard(require("react"));
11
11
  var _animationFrame = require("../shared-utils/animationFrame");
12
+ var _VreoUnit = require("../typings/VreoUnit");
12
13
  var _setElementDataset = _interopRequireDefault(require("../shared-utils/setElementDataset"));
13
14
  var _getMediaInfo = require("../shared-utils/getMediaInfo");
14
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -262,6 +263,9 @@ var Controller = /*#__PURE__*/function (_Subscribe) {
262
263
  // 没有被解析过且开始时间低于当前时间戳 100ms
263
264
  return keyframes.filter(function (keyframe) {
264
265
  if (keyframe.parsed) return false;
266
+ // 检测结束时间
267
+ if (keyframe.end < _this2.currentTime) return false;
268
+ if (keyframe.type === _VreoUnit.VreoKeyframeEnum.BgMusic) return true;
265
269
  var dur = _this2.currentTime - keyframe.start;
266
270
  return dur <= 100 && dur >= 0;
267
271
  });
@@ -229,6 +229,7 @@ var Player = /*#__PURE__*/function (_Subscribe) {
229
229
  }, {
230
230
  key: "play",
231
231
  value: function play(currentTime) {
232
+ var _this$controller$vreo;
232
233
  if (this.controller.playing) return true;
233
234
  if (currentTime && this.controller.mediaInstance) {
234
235
  this.controller.mediaInstance.currentTime = currentTime / 1000;
@@ -238,6 +239,11 @@ var Player = /*#__PURE__*/function (_Subscribe) {
238
239
  });
239
240
  this.controller.setEnded(false);
240
241
  this.controller.setPlaying(true);
242
+ (_this$controller$vreo = this.controller.vreoUnit) === null || _this$controller$vreo === void 0 ? void 0 : _this$controller$vreo.keyframes.forEach(function (keyframe) {
243
+ if (keyframe.type === _VreoUnit.VreoKeyframeEnum.BgMusic) {
244
+ keyframe.parsed = false;
245
+ }
246
+ });
241
247
  return true;
242
248
  }
243
249
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@realsee/vreo",
3
- "version": "1.0.0-alpha.26",
3
+ "version": "1.0.0-alpha.28",
4
4
  "description": "Vreo (VR Video 缩写) 是基于如视三维渲染引擎 Five 和 用户界面构建库 React 实现的如视 3D 空间剧本播放器。",
5
5
  "keywords": [
6
6
  "realsee",