@realsee/vreo 2.3.5 → 2.3.6

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.
@@ -20,14 +20,17 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
20
20
  var isWX = navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1;
21
21
  var isIOS = navigator.userAgent.toLowerCase().indexOf('iphone') !== -1;
22
22
  var isIOSorWX = isIOS || isWX;
23
- var videoElement = document.createElement('video');
24
- videoElement.setAttribute('playsinline', 'true');
25
- videoElement.setAttribute('webkit-playsinline', 'true');
23
+
24
+ var _videoElement = document.createElement('video');
25
+
26
+ _videoElement.setAttribute('playsinline', 'true');
27
+
28
+ _videoElement.setAttribute('webkit-playsinline', 'true');
26
29
 
27
30
  if (isIOSorWX) {
28
- if (videoElement.paused) {
29
- videoElement.addEventListener('click', function () {
30
- return videoElement.play();
31
+ if (_videoElement.paused) {
32
+ _videoElement.addEventListener('click', function () {
33
+ return _videoElement.play();
31
34
  }, {
32
35
  once: true
33
36
  });
@@ -50,33 +53,37 @@ function InfoPanelVideo(_ref2) {
50
53
  var url = _ref2.url,
51
54
  children = _ref2.children;
52
55
  var videoWrapperRef = React.useRef(null);
56
+ var controller = (0, _hooks.useController)();
53
57
  React.useEffect(function () {
58
+ var _controller$configs, _controller$configs$v;
59
+
54
60
  // if (!isIOSorWX) return
61
+ var video = ((_controller$configs = controller.configs) === null || _controller$configs === void 0 ? void 0 : (_controller$configs$v = _controller$configs.videos) === null || _controller$configs$v === void 0 ? void 0 : _controller$configs$v.videoPanel) || _videoElement;
55
62
  if (!videoWrapperRef.current) return;
56
- videoElement.src = url;
63
+ video.src = url;
57
64
 
58
- if (!videoWrapperRef.current.contains(videoElement)) {
59
- videoWrapperRef.current.appendChild(videoElement);
65
+ if (!videoWrapperRef.current.contains(video)) {
66
+ videoWrapperRef.current.appendChild(video);
60
67
  }
61
68
 
62
69
  var canplaythrough = function canplaythrough() {
63
- videoElement.removeEventListener('canplaythrough', canplaythrough);
70
+ video.removeEventListener('canplaythrough', canplaythrough);
64
71
 
65
72
  try {
66
- videoElement.play();
73
+ video.play();
67
74
  } catch (error) {}
68
75
  };
69
76
 
70
- videoElement.addEventListener('canplaythrough', canplaythrough);
71
- videoElement.load(); // videoElement.play()
77
+ video.addEventListener('canplaythrough', canplaythrough);
78
+ video.load(); // video.play()
72
79
 
73
80
  return function () {
74
81
  var _videoWrapperRef$curr;
75
82
 
76
- videoElement.pause();
83
+ video.pause();
77
84
 
78
- if ((_videoWrapperRef$curr = videoWrapperRef.current) !== null && _videoWrapperRef$curr !== void 0 && _videoWrapperRef$curr.contains(videoElement)) {
79
- videoWrapperRef.current.removeChild(videoElement);
85
+ if ((_videoWrapperRef$curr = videoWrapperRef.current) !== null && _videoWrapperRef$curr !== void 0 && _videoWrapperRef$curr.contains(video)) {
86
+ videoWrapperRef.current.removeChild(video);
80
87
  }
81
88
  };
82
89
  }, [videoWrapperRef.current]);
@@ -108,9 +115,9 @@ function InfoPanel() {
108
115
  var timeoutRef = React.useRef();
109
116
  var controller = (0, _hooks.useController)();
110
117
  React.useEffect(function () {
111
- var _controller$configs;
118
+ var _controller$configs2;
112
119
 
113
- if (((_controller$configs = controller.configs) === null || _controller$configs === void 0 ? void 0 : _controller$configs.keyframeMap.InfoPanel) === false) {
120
+ if (((_controller$configs2 = controller.configs) === null || _controller$configs2 === void 0 ? void 0 : _controller$configs2.keyframeMap.InfoPanel) === false) {
114
121
  return;
115
122
  }
116
123
 
@@ -17,6 +17,7 @@ export interface PlayerConfigs {
17
17
  videos?: {
18
18
  videoEffect?: HTMLVideoElement;
19
19
  modelTVVideo?: HTMLVideoElement;
20
+ videoPanel?: HTMLVideoElement;
20
21
  };
21
22
  videoAgentMeshOptions?: VideoAgentMeshOptions;
22
23
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@realsee/vreo",
3
- "version": "2.3.5",
3
+ "version": "2.3.6",
4
4
  "description": "Vreo (VR Video 缩写) 是基于如视三维渲染引擎 Five 和 用户界面构建库 React 实现的如视 3D 空间剧本播放器。",
5
5
  "keywords": [
6
6
  "realsee",
@@ -27,7 +27,6 @@
27
27
  "peerDependencies": {
28
28
  "@realsee/five": "^5.0.0",
29
29
  "@realsee/dnalogel": "^2.3.3",
30
- "@tweenjs/tween.js": "18.6.4",
31
30
  "three": ">=0.115.0 <=0.117.1",
32
31
  "react": "^17.0.0",
33
32
  "react-dom": "^17.0.0"