From 1bf73560e394ba6541afdcd5df7ba128937c08f2 Mon Sep 17 00:00:00 2001 From: Vinlic Date: Thu, 7 Dec 2023 00:57:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BD=93=E9=A1=B5=E9=9D=A2url=E6=9C=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E6=97=B6=EF=BC=8C=E8=A7=86=E9=A2=91=E9=A2=84?= =?UTF-8?q?=E5=A4=84=E7=90=86base=20url=E9=87=87=E7=94=A8localhost?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- media/VideoCanvas.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/media/VideoCanvas.js b/media/VideoCanvas.js index 507a6ad..b4c9bf5 100644 --- a/media/VideoCanvas.js +++ b/media/VideoCanvas.js @@ -341,7 +341,9 @@ export default class VideoCanvas { async _fetchData() { if (!this.buffer) { // console.time(); - const response = await captureCtx.fetch("/api/video_preprocess", { + // 当页面url未定义时采用localhost代替 + const base = window.location.url ? "" : "http://localhost"; + const response = await captureCtx.fetch(base + "/api/video_preprocess", { method: "POST", body: JSON.stringify(this._exportConfig()), retryFetchs: 0