Live portal: rename streams (tab double-click, persisted per browser) and name tab groups (header slot, session)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
@@ -2,10 +2,12 @@ import React, { useEffect, useRef, useState } from 'react'
|
||||
import Hls from 'hls.js'
|
||||
import { whepUrl, hlsUrl } from './api.js'
|
||||
import { audio, effectiveMuted } from './useAudio.js'
|
||||
import { names } from './names.js'
|
||||
|
||||
// WebRTC (WHEP) first, HLS fallback. Mute/volume come from the shared audio store.
|
||||
export default function Player({ params, api }) {
|
||||
const { id, user, title } = params
|
||||
const custom = names.use(s => s.streams[id]) // viewer-side rename (tab double-click)
|
||||
const whep = params.whep || id // Opus audio mirror path when the source audio is AAC
|
||||
const videoRef = useRef(null)
|
||||
const [status, setStatus] = useState('connecting…')
|
||||
@@ -105,7 +107,7 @@ export default function Player({ params, api }) {
|
||||
<div className="bar">
|
||||
<span className="live">LIVE</span>
|
||||
<span className="who">{user}</span>
|
||||
<span className="title" title={title}>{title}</span>
|
||||
<span className="title" title={title}>{custom || title}</span>
|
||||
<span className="viewers">👁 {viewers}</span>
|
||||
<button className={'mute' + (!muted ? ' on' : '') + (override === 'unmuted' && !focused ? ' pinned' : '')}
|
||||
title={override ? (override === 'unmuted' ? 'audio pinned on (click to mute)' : 'muted (click to unmute)') : (focused ? 'focused: audio on (click to mute)' : 'muted: click to pin audio on')}
|
||||
|
||||
Reference in New Issue
Block a user