This commit is contained in:
eric
2025-09-08 16:19:27 +08:00
parent c02a8f7172
commit 39df8bcbf8
14 changed files with 13 additions and 13 deletions

View File

@@ -18,7 +18,7 @@
<p class="modified">
<time :datetime="modified">{{ humanTime() }}</time>
<!-- 直播按钮 -->
<button v-if="!isDir && isVideoFile(name)" class="live-button" @click="loopLive">
<button v-if="!isDir && isVideoFile(name)" class="live-button" @click="loopLive">
循环直播
</button>
<button v-if="!isDir && isVideoFile(name)" class="live-button" @click="startLive">
@@ -30,7 +30,7 @@
<button v-if="!isDir && isVideoFile(name)" class="live-button" @click="stopLive">
停止直播
</button>
</p>
</div>
@@ -387,7 +387,7 @@ const stopLive = async () => {
// 调用 FastAPI 停止接口
// const res = await fetch("http://192.168.31.103:8700/stop_live", {
const res = await fetch("http://127.0.0.1:8700/stop_live", {
const res = await fetch(`${location.protocol}//${location.hostname}8700/stop_live`, {
method: "POST",
headers: { "Content-Type": "application/json" },
@@ -413,11 +413,11 @@ const loopLive = async () => {
// props.url 是 FileBrowser 内部路径,例如 /videos/test.mp4
const file_path = props.url;
// const file_path = encodeURIComponent(props.url);
console.log('file_path',file_path)
console.log('file_path', file_path)
// 调用 FastAPI 后端接口
// const res = await fetch("http://192.168.31.103:8700/loop_Live", {
const res = await fetch("http://127.0.0.1:8700/loop_Live", {
const res = await fetch(`${location.protocol}//${location.hostname}8700/loop_Live`, {
method: "POST",
headers: { "Content-Type": "application/json" },
@@ -447,7 +447,7 @@ const obsLive = async () => {
// 这里模拟 OBS 推流逻辑,你可以根据实际后端接口来调整
// const res = await fetch("http://192.168.31.103:8700/obs_live", {
const res = await fetch("http://127.0.0.1:8700/obs_live", {
const res = await fetch(`${location.protocol}//${location.hostname}:8700/obs_live`, {
method: "POST",
headers: { "Content-Type": "application/json" },
@@ -472,11 +472,11 @@ const startLive = async () => {
// props.url 是 FileBrowser 内部路径,例如 /videos/test.mp4
const file_path = props.url;
// const file_path = encodeURIComponent(props.url);
console.log('file_path',file_path)
console.log('file_path', file_path)
// 调用 FastAPI 后端接口
const res = await fetch("http://192.168.31.103:8700/start_live", {
// const res = await fetch("http://127.0.0.1:8700/start_live", {
const res = await fetch(`${location.protocol}//${location.hostname}:8700/start_live`, {
// const res = await fetch("http://127.0.0.1:8700/start_live", {
method: "POST",
headers: { "Content-Type": "application/json" },