@cloud-app-dev/vidc 3.1.6 → 3.1.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.
|
@@ -21,7 +21,11 @@ interface IFrontendPlayerWithExtProps extends Omit<ILivePlayerWithExtProps, 'url
|
|
|
21
21
|
segments?: ISegmentType[];
|
|
22
22
|
begin?: number;
|
|
23
23
|
httpLoading: boolean;
|
|
24
|
-
|
|
24
|
+
getLocalRecordUrl?: (options: {
|
|
25
|
+
url: URL;
|
|
26
|
+
begin: number;
|
|
27
|
+
end: number;
|
|
28
|
+
}) => string;
|
|
25
29
|
}
|
|
26
|
-
export declare function FrontendPlayerWithExt({ mode, style, className, segments, updatePlayer, onClick, pluginDownloadUrl, httpLoading,
|
|
30
|
+
export declare function FrontendPlayerWithExt({ mode, style, className, segments, updatePlayer, onClick, pluginDownloadUrl, httpLoading, getLocalRecordUrl, }: IFrontendPlayerWithExtProps): JSX.Element;
|
|
27
31
|
export {};
|
|
@@ -122,8 +122,7 @@ export function FrontendPlayerWithExt(_ref) {
|
|
|
122
122
|
onClick = _ref.onClick,
|
|
123
123
|
pluginDownloadUrl = _ref.pluginDownloadUrl,
|
|
124
124
|
httpLoading = _ref.httpLoading,
|
|
125
|
-
|
|
126
|
-
localRecordTimeParams = _ref$localRecordTimeP === void 0 ? ['begin', 'end'] : _ref$localRecordTimeP;
|
|
125
|
+
getLocalRecordUrl = _ref.getLocalRecordUrl;
|
|
127
126
|
|
|
128
127
|
var _a;
|
|
129
128
|
|
|
@@ -145,17 +144,24 @@ export function FrontendPlayerWithExt(_ref) {
|
|
|
145
144
|
begin = _ref2[0],
|
|
146
145
|
end = _ref2[1];
|
|
147
146
|
var videoUrl = new URL(segments[0].url);
|
|
147
|
+
var url;
|
|
148
148
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
149
|
+
if (getLocalRecordUrl) {
|
|
150
|
+
url = getLocalRecordUrl({
|
|
151
|
+
url: videoUrl,
|
|
152
|
+
begin: begin,
|
|
153
|
+
end: end
|
|
154
|
+
});
|
|
155
|
+
} else {
|
|
156
|
+
videoUrl.searchParams.set('begin', "".concat(moment(begin).unix()));
|
|
157
|
+
videoUrl.searchParams.set('end', "".concat(moment(end).unix()));
|
|
158
|
+
url = videoUrl.toString();
|
|
159
|
+
}
|
|
152
160
|
|
|
153
|
-
videoUrl.searchParams.set(startParams, "".concat(moment(begin).unix()));
|
|
154
|
-
videoUrl.searchParams.set(endParams, "".concat(moment(end).unix()));
|
|
155
161
|
setState({
|
|
156
162
|
begin: begin,
|
|
157
163
|
end: end,
|
|
158
|
-
url:
|
|
164
|
+
url: url
|
|
159
165
|
}); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
160
166
|
}, [segments]);
|
|
161
167
|
var seekTo = useCallback(function (time) {
|
|
@@ -163,19 +169,26 @@ export function FrontendPlayerWithExt(_ref) {
|
|
|
163
169
|
return;
|
|
164
170
|
}
|
|
165
171
|
|
|
166
|
-
var
|
|
167
|
-
var
|
|
172
|
+
var end = moment().unix();
|
|
173
|
+
var begin = moment(time).unix();
|
|
168
174
|
var videoUrl = new URL(state.url);
|
|
175
|
+
var url;
|
|
169
176
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
177
|
+
if (getLocalRecordUrl) {
|
|
178
|
+
url = getLocalRecordUrl({
|
|
179
|
+
url: videoUrl,
|
|
180
|
+
begin: begin,
|
|
181
|
+
end: end
|
|
182
|
+
});
|
|
183
|
+
} else {
|
|
184
|
+
videoUrl.searchParams.set('begin', "".concat(moment(begin).unix()));
|
|
185
|
+
videoUrl.searchParams.set('end', "".concat(moment(end).unix()));
|
|
186
|
+
url = videoUrl.toString();
|
|
187
|
+
}
|
|
173
188
|
|
|
174
|
-
videoUrl.searchParams.set(startParams, "".concat(beginTime));
|
|
175
|
-
videoUrl.searchParams.set(endParams, "".concat(endTime));
|
|
176
189
|
setState(function (old) {
|
|
177
190
|
return Object.assign(Object.assign({}, old), {
|
|
178
|
-
url:
|
|
191
|
+
url: url
|
|
179
192
|
});
|
|
180
193
|
});
|
|
181
194
|
}, // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -6,5 +6,5 @@ import './index.less';
|
|
|
6
6
|
* @param param0
|
|
7
7
|
* @returns
|
|
8
8
|
*/
|
|
9
|
-
declare function RecordPlayer({ list, children, queryRecord, onIndexChange, onClose, onCloseAll, download, snapshot, defaultScreen, screenChange, defaultSelectIndex, oneWinExtTools, allWinExtTools, fpsDelay, fps, queryRecordErrorHandle,
|
|
9
|
+
declare function RecordPlayer({ list, children, queryRecord, onIndexChange, onClose, onCloseAll, download, snapshot, defaultScreen, screenChange, defaultSelectIndex, oneWinExtTools, allWinExtTools, fpsDelay, fps, queryRecordErrorHandle, getLocalRecordUrl, ...options }: IRecordPlayerProps): JSX.Element;
|
|
10
10
|
export default RecordPlayer;
|
|
@@ -76,8 +76,8 @@ function RecordPlayer(_a) {
|
|
|
76
76
|
fpsDelay = _a.fpsDelay,
|
|
77
77
|
fps = _a.fps,
|
|
78
78
|
queryRecordErrorHandle = _a.queryRecordErrorHandle,
|
|
79
|
-
|
|
80
|
-
options = __rest(_a, ["list", "children", "queryRecord", "onIndexChange", "onClose", "onCloseAll", "download", "snapshot", "defaultScreen", "screenChange", "defaultSelectIndex", "oneWinExtTools", "allWinExtTools", "fpsDelay", "fps", "queryRecordErrorHandle", "
|
|
79
|
+
getLocalRecordUrl = _a.getLocalRecordUrl,
|
|
80
|
+
options = __rest(_a, ["list", "children", "queryRecord", "onIndexChange", "onClose", "onCloseAll", "download", "snapshot", "defaultScreen", "screenChange", "defaultSelectIndex", "oneWinExtTools", "allWinExtTools", "fpsDelay", "fps", "queryRecordErrorHandle", "getLocalRecordUrl"]);
|
|
81
81
|
|
|
82
82
|
var _useState = useState(Object.assign(Object.assign({}, cloneDeep(defaultState)), {
|
|
83
83
|
screenNum: defaultScreen !== null && defaultScreen !== void 0 ? defaultScreen : defaultState.screenNum
|
|
@@ -455,7 +455,7 @@ function RecordPlayer(_a) {
|
|
|
455
455
|
height: screenType.height
|
|
456
456
|
},
|
|
457
457
|
httpLoading: state.winLoadingStatus[index],
|
|
458
|
-
|
|
458
|
+
getLocalRecordUrl: getLocalRecordUrl
|
|
459
459
|
}));
|
|
460
460
|
})), /*#__PURE__*/React.createElement("div", {
|
|
461
461
|
className: "player-tools-group"
|