OrbiSubs panel: include the passphrase in the SRT output URL so it can be copied and used

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
guy
2026-11-21 23:06:25 -03:00
parent 3bc7350ebd
commit 40789c196d
+8 -3
View File
@@ -351,7 +351,12 @@ function syncForm() {
? urlLine(t('Master HLS'), `${MEDIA}/hls/${slug}/master.m3u8`) + urlLine(t('Player'), `${MEDIA}/player.html?u=/hls/${slug}/master.m3u8`)
: '';
$('#srt-url').innerHTML = f.srt_enabled.checked && f.srt_mode.value === 'listener' && f.srt_port.value
? urlLine(t('Salida SRT'), `srt://${location.hostname}:${f.srt_port.value}`) : '';
? urlLine(t('Salida SRT'), srtOutUrl(location.hostname, f.srt_port.value, f.srt_passphrase.value.trim())) : '';
}
// URL de la salida SRT para copiar a un reproductor: con passphrase, porque sin ella el listener
// rechaza la conexión ("Password required"). La latency no va: ffmpeg la lee en µs y VLC/OBS en ms.
function srtOutUrl(host, port, passphrase) {
return `srt://${host}:${port}` + (passphrase ? `?passphrase=${encodeURIComponent(passphrase)}` : '');
}
function urlLine(label, url) {
return `<div class="url-line"><span class="muted">${esc(label)}</span> <span class="mono out-url">${esc(url)}</span><button type="button" class="out-copy" data-url="${esc(url)}" title="${t('Copiar URL')}">📋</button></div>`;
@@ -513,8 +518,8 @@ function openView(c) {
if (c.cfg.hls.enabled) urls.push(urlLine(t('Master HLS'), src), urlLine(t('Player'), `${MEDIA}/player.html?u=/hls/${c.slug}/master.m3u8`));
if (c.cfg.srt.enabled) {
urls.push(c.cfg.srt.mode === 'listener'
? urlLine(t('Salida SRT'), `srt://${location.hostname}:${c.cfg.srt.port}`)
: urlLine(t('Salida SRT (caller a)'), `srt://${c.cfg.srt.host}:${c.cfg.srt.port}`));
? urlLine(t('Salida SRT'), srtOutUrl(location.hostname, c.cfg.srt.port, c.cfg.srt.passphrase))
: urlLine(t('Salida SRT (caller a)'), srtOutUrl(c.cfg.srt.host, c.cfg.srt.port, c.cfg.srt.passphrase)));
if (c.cfg.srt.test && c.cfg.srt.mode === 'listener') urls.push(urlLine(t('HLS desde la salida SRT (608)'), `${MEDIA}/hls/${c.slug}-cc/index.m3u8`));
}
$('#view-urls').innerHTML = urls.join('');