Skip to content

Commit 5bd1c34

Browse files
committed
feat: 增加预览数据
1 parent 23ebe64 commit 5bd1c34

File tree

1 file changed

+6
-0
lines changed
  • src/BootstrapBlazor/wwwroot/modules

1 file changed

+6
-0
lines changed

src/BootstrapBlazor/wwwroot/modules/media.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,17 @@ export async function getPreviewUrl() {
143143
const capture = new ImageCapture(track);
144144
const blob = await capture.takePhoto();
145145
url = URL.createObjectURL(blob);
146+
media.previewBlob = blob;
146147
}
147148
}
148149
return url;
149150
}
150151

152+
export async function getPreviewData() {
153+
const media = registerBootstrapBlazorModule("MediaDevices");
154+
return media.previewBlob;
155+
}
156+
151157
const closeStream = stream => {
152158
if (stream) {
153159
const tracks = stream.getTracks();

0 commit comments

Comments
 (0)