pixuireactcomponents 1.5.30 → 1.5.32

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixuireactcomponents",
3
- "version": "1.5.30",
3
+ "version": "1.5.32",
4
4
  "description": "pixui react components",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -110,7 +110,7 @@ export function Carousel(props) {
110
110
  var nextInterval = useRef();
111
111
  var _r = useState(true), showTransition = _r[0], setShowTransition = _r[1];
112
112
  var _s = useState([0, 0]), gestureoffset = _s[0], setGestureoffset = _s[1];
113
- var offset = useMemo(function () { return -(isVertical ? compHeight : compWidth) * showIndex; }, [showIndex]);
113
+ var offset = useMemo(function () { return -(isVertical ? compHeight : compWidth) * showIndex; }, [showIndex, compHeight, compWidth]);
114
114
  var itemBoxStyle = {
115
115
  minWidth: compWidth + 'px',
116
116
  minHeight: compHeight + 'px',
@@ -94,6 +94,8 @@ export var VideoPlayer = function (props) {
94
94
  var _e = useState(0), currentTime = _e[0], setCurrentTime = _e[1];
95
95
  var _f = useState(0), totalTime = _f[0], setTotalTime = _f[1];
96
96
  var _g = useState(false), showSlider = _g[0], setShowSlider = _g[1];
97
+ var _h = useState(1.0), currentVolume = _h[0], setCurrentVolume = _h[1]; //视频音量范围0.0~1.0
98
+ var _j = useState(false), isMuted = _j[0], setIsMuted = _j[1];
97
99
  var sliderTimmer = useRef(null);
98
100
  var rootRef = useRef();
99
101
  var isDragingRef = useRef(false);
@@ -280,6 +282,10 @@ export var VideoPlayer = function (props) {
280
282
  load: function () {
281
283
  refVideo.current.load();
282
284
  },
285
+ setMute: function (_muted) {
286
+ refVideo.current.muted = _muted;
287
+ setIsMuted(_muted);
288
+ },
283
289
  getPlayStatus: function () {
284
290
  return videoStatus;
285
291
  },
@@ -299,8 +305,15 @@ export var VideoPlayer = function (props) {
299
305
  }, 3000);
300
306
  }
301
307
  },
308
+ setCurrentVolume: function (volume) {
309
+ refVideo.current.volume = volume;
310
+ setCurrentVolume(volume);
311
+ },
302
312
  currentTime: currentTime,
303
313
  totalTime: totalTime,
314
+ isUIShow: showSlider,
315
+ currentVolume: currentVolume,
316
+ isMuted: isMuted
304
317
  };
305
318
  }
306
319
  // videoLog('currentTime', currentTime, 'totalTime', totalTime);
@@ -342,7 +355,7 @@ export var VideoPlayer = function (props) {
342
355
  console.warn('onloadeddata');
343
356
  }, onCanPlay: onplaying,
344
357
  //@ts-ignore
345
- onfirstframe: onFirstFrame }),
358
+ onfirstframe: onFirstFrame, controls: true }),
346
359
  h("div", { style: screenClickerStyle, onClick: function (e) {
347
360
  videoLog('screenClickerStyle click');
348
361
  e.stopPropagation();