修复开播卡正在连接:移除未定义 quality;画质改官网选择+localStorage
Made-with: Cursor
This commit is contained in:
@@ -10,17 +10,9 @@
|
||||
<code>LIVE_PUBLIC_IP</code>(服务器公网 IPv4,与域名一致),并配置 <code>LIVE_ICE_SERVERS</code>(含 TURN)。
|
||||
</p>
|
||||
<p class="status">{{ status }}</p>
|
||||
<div v-if="!session" class="quality-row">
|
||||
<span class="quality-label">推流画质</span>
|
||||
<el-select v-model="quality" style="width: 220px" :disabled="!token">
|
||||
<el-option
|
||||
v-for="o in qualityOptions"
|
||||
:key="o.value"
|
||||
:label="o.label"
|
||||
:value="o.value"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
<p class="quality-hint">
|
||||
画质请在官网「直播」页选择(写入本机);与后台开播使用<strong>同一浏览器</strong>时,开始直播将按该档位采集。
|
||||
</p>
|
||||
<div class="actions">
|
||||
<el-button v-if="!session" type="primary" :disabled="!token" @click="start">开始直播</el-button>
|
||||
<el-button v-else type="danger" @click="stop">结束直播</el-button>
|
||||
@@ -34,7 +26,7 @@
|
||||
import { ref, computed, onMounted, onUnmounted } from 'vue'
|
||||
import { onBeforeRouteLeave } from 'vue-router'
|
||||
import { useAuthStore } from '../../stores/auth'
|
||||
import { startPublishing, LIVE_QUALITY_OPTIONS } from '../../utils/liveWebRTC'
|
||||
import { startPublishing } from '../../utils/liveWebRTC'
|
||||
|
||||
const authStore = useAuthStore()
|
||||
const token = computed(() => authStore.getToken() || '')
|
||||
@@ -50,7 +42,6 @@ function start() {
|
||||
status.value = '正在连接…'
|
||||
const { stop } = startPublishing({
|
||||
token: token.value,
|
||||
quality: quality.value,
|
||||
onStatus: (s) => {
|
||||
status.value = s
|
||||
},
|
||||
@@ -108,15 +99,11 @@ onBeforeRouteLeave(() => {
|
||||
margin-bottom: 12px;
|
||||
min-height: 1.5em;
|
||||
}
|
||||
.quality-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
.quality-label {
|
||||
font-size: 14px;
|
||||
color: #606266;
|
||||
.quality-hint {
|
||||
font-size: 13px;
|
||||
line-height: 1.6;
|
||||
color: #909399;
|
||||
margin: 0 0 14px;
|
||||
}
|
||||
.actions {
|
||||
margin-bottom: 16px;
|
||||
|
||||
Reference in New Issue
Block a user