pixuireactcomponents 1.3.83 → 1.3.85
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
|
@@ -14,6 +14,9 @@ export interface SliderProps {
|
|
|
14
14
|
outerBg: string;
|
|
15
15
|
innerBg: string;
|
|
16
16
|
dotBg: string;
|
|
17
|
+
outerCss?: CSSProperties;
|
|
18
|
+
innerCss?: CSSProperties;
|
|
19
|
+
dotCss?: CSSProperties;
|
|
17
20
|
onDragStart: Function | null;
|
|
18
21
|
onDrag: Function | null;
|
|
19
22
|
onDragEnd: Function | null;
|
|
@@ -366,9 +366,9 @@ var Slider = /** @class */ (function (_super) {
|
|
|
366
366
|
return (h("div", { style: this.props.hasIncDecButton ? this.state.withButtonStyle : {}, id: this.props.id, className: this.props.className },
|
|
367
367
|
this.props.hasIncDecButton && h("img", { src: this.props.decButtonBg, style: this.state.decButtonStyle, onClick: this.onDecClick }),
|
|
368
368
|
h("div", { ref: this.refWrapper, style: this.state.wrapperStyle },
|
|
369
|
-
h("div", { style: this.state.outerStyle, draggable: true, onDragStart: this.onDragStart, onDrag: this.onDrag, onDragEnd: this.onDragEnd },
|
|
370
|
-
h("div", { style: __assign(__assign({}, this.state.innerStyle), { width: innerWidth }) },
|
|
371
|
-
h("div", { style: __assign(__assign({}, this.state.dotWrapperStyle), { marginLeft: dotWrapperMarginLeft }) }, hasDot && h("img", { src: this.props.dotBg, style: this.state.dotStyle }))))),
|
|
369
|
+
h("div", { style: __assign(__assign({}, this.state.outerStyle), this.props.outerCss), draggable: true, onDragStart: this.onDragStart, onDrag: this.onDrag, onDragEnd: this.onDragEnd },
|
|
370
|
+
h("div", { style: __assign(__assign(__assign({}, this.state.innerStyle), { width: innerWidth }), this.props.innerCss) },
|
|
371
|
+
h("div", { style: __assign(__assign({}, this.state.dotWrapperStyle), { marginLeft: dotWrapperMarginLeft }) }, hasDot && h("img", { src: this.props.dotBg, style: __assign(__assign({}, this.state.dotStyle), this.props.dotCss) }))))),
|
|
372
372
|
this.props.hasIncDecButton && h("img", { src: this.props.incButtonBg, style: this.state.incButtonStyle, onClick: this.onIncClick })));
|
|
373
373
|
};
|
|
374
374
|
Slider.defaultProps = {
|
|
@@ -18,7 +18,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
18
18
|
}
|
|
19
19
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
20
20
|
};
|
|
21
|
-
import {
|
|
21
|
+
import { h } from 'preact';
|
|
22
22
|
import { useEffect, useRef, useState } from 'preact/hooks';
|
|
23
23
|
import { Slider } from '../slider/Slider';
|
|
24
24
|
var videoWrapperStyle = {
|
|
@@ -59,13 +59,13 @@ var videoLog = function () {
|
|
|
59
59
|
}
|
|
60
60
|
};
|
|
61
61
|
export var VideoPlayer = function (props) {
|
|
62
|
-
var playUrl = props.playUrl, _a = props.autoPlay, autoPlay = _a === void 0 ? true : _a, playEvent = props.playEvent, elementClass = props.elementClass, _b = props.durations, durations = _b === void 0 ? { hideSliderDuration: 3000 } : _b, sliderBG = props.sliderBG, videoDuration = props.videoDuration,
|
|
63
|
-
var refVideo =
|
|
62
|
+
var playUrl = props.playUrl, _a = props.autoPlay, autoPlay = _a === void 0 ? true : _a, playEvent = props.playEvent, elementClass = props.elementClass, _b = props.durations, durations = _b === void 0 ? { hideSliderDuration: 3000 } : _b, sliderBG = props.sliderBG, videoDuration = props.videoDuration, isStreaming = props.isStreaming;
|
|
63
|
+
var refVideo = useRef(null);
|
|
64
64
|
// const hideSliderDuration = 1000;
|
|
65
|
-
var
|
|
66
|
-
var
|
|
67
|
-
var
|
|
68
|
-
var
|
|
65
|
+
var _c = useState(VideoStatus.Loading), videoStatus = _c[0], setVideoStatus = _c[1];
|
|
66
|
+
var _d = useState(0), currentTime = _d[0], setCurrentTime = _d[1];
|
|
67
|
+
var _e = useState(0), totalTime = _e[0], setTotalTime = _e[1];
|
|
68
|
+
var _f = useState(false), showSlider = _f[0], setShowSlider = _f[1];
|
|
69
69
|
var sliderTimmer = useRef(null);
|
|
70
70
|
var updatePlayTime = function () {
|
|
71
71
|
// videoLog('updatePlayTime----------------');
|
|
@@ -71,7 +71,7 @@ export var assetCache;
|
|
|
71
71
|
return __generator(this, function (_a) {
|
|
72
72
|
console.log('cacheAsset---', url);
|
|
73
73
|
return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
|
|
74
|
-
var lib, localPath, xhr;
|
|
74
|
+
var urlWithoutParams, lib, localPath, xhr;
|
|
75
75
|
var _this = this;
|
|
76
76
|
return __generator(this, function (_a) {
|
|
77
77
|
switch (_a.label) {
|
|
@@ -80,8 +80,9 @@ export var assetCache;
|
|
|
80
80
|
console.log('非jssdk环境');
|
|
81
81
|
reject(url);
|
|
82
82
|
}
|
|
83
|
+
urlWithoutParams = url.split('?')[0];
|
|
83
84
|
lib = LibMgr.getInstance().getMainLib();
|
|
84
|
-
return [4 /*yield*/, getLocalPath(
|
|
85
|
+
return [4 /*yield*/, getLocalPath(urlWithoutParams)];
|
|
85
86
|
case 1:
|
|
86
87
|
localPath = _a.sent();
|
|
87
88
|
if (!force) {
|