@realsee/vreo 2.3.5 → 2.3.7
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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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 (
|
|
29
|
-
|
|
30
|
-
return
|
|
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
|
-
|
|
63
|
+
video.src = url;
|
|
57
64
|
|
|
58
|
-
if (!videoWrapperRef.current.contains(
|
|
59
|
-
videoWrapperRef.current.appendChild(
|
|
65
|
+
if (!videoWrapperRef.current.contains(video)) {
|
|
66
|
+
videoWrapperRef.current.appendChild(video);
|
|
60
67
|
}
|
|
61
68
|
|
|
62
69
|
var canplaythrough = function canplaythrough() {
|
|
63
|
-
|
|
70
|
+
video.removeEventListener('canplaythrough', canplaythrough);
|
|
64
71
|
|
|
65
72
|
try {
|
|
66
|
-
|
|
73
|
+
video.play();
|
|
67
74
|
} catch (error) {}
|
|
68
75
|
};
|
|
69
76
|
|
|
70
|
-
|
|
71
|
-
|
|
77
|
+
video.addEventListener('canplaythrough', canplaythrough);
|
|
78
|
+
video.load(); // video.play()
|
|
72
79
|
|
|
73
80
|
return function () {
|
|
74
81
|
var _videoWrapperRef$curr;
|
|
75
82
|
|
|
76
|
-
|
|
83
|
+
video.pause();
|
|
77
84
|
|
|
78
|
-
if ((_videoWrapperRef$curr = videoWrapperRef.current) !== null && _videoWrapperRef$curr !== void 0 && _videoWrapperRef$curr.contains(
|
|
79
|
-
videoWrapperRef.current.removeChild(
|
|
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$
|
|
118
|
+
var _controller$configs2;
|
|
112
119
|
|
|
113
|
-
if (((_controller$
|
|
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
|
|
package/lib/Player/typings.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@realsee/vreo",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.7",
|
|
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"
|
|
@@ -58,7 +57,7 @@
|
|
|
58
57
|
},
|
|
59
58
|
"dependencies": {
|
|
60
59
|
"classnames": "^2.3.1",
|
|
61
|
-
"mobx": "6.
|
|
62
|
-
"mobx-react": "7.
|
|
60
|
+
"mobx": "^6.3.7",
|
|
61
|
+
"mobx-react": "^7.2.1"
|
|
63
62
|
}
|
|
64
63
|
}
|