Keep playhead visible for recorded streams
This commit is contained in:
@@ -1344,12 +1344,13 @@ function syncPlayhead() {
|
||||
const duration = state.duration;
|
||||
const hasDuration = Number.isFinite(duration) && duration > 0;
|
||||
const canScrub = state.seekable && hasDuration;
|
||||
const showPlayhead = Boolean(state.session);
|
||||
const max = hasDuration ? duration : 1;
|
||||
const value = hasDuration ? clampNumber(currentTime, 0, max) : 0;
|
||||
const progress = hasDuration && max > 0 ? (value / max) * 100 : 0;
|
||||
|
||||
elements.playhead.hidden = !canScrub;
|
||||
elements.playhead.setAttribute('aria-hidden', String(!canScrub));
|
||||
elements.playhead.hidden = !showPlayhead;
|
||||
elements.playhead.setAttribute('aria-hidden', String(!showPlayhead));
|
||||
elements.currentTime.textContent = formatTime(currentTime);
|
||||
elements.totalTime.textContent = formatTime(duration);
|
||||
elements.seek.max = String(max);
|
||||
|
||||
@@ -171,10 +171,13 @@ app.post('/api/session', async (request, response) => {
|
||||
|
||||
const options = parsePlaybackOptions(request.body);
|
||||
const id = randomUUID();
|
||||
|
||||
const metadataStatus = METADATA_PROBE_ENABLED ? 'pending' : 'disabled';
|
||||
|
||||
sessions.set(id, {
|
||||
const shouldProbeMetadata = METADATA_PROBE_ENABLED || canBestEffortResumeWithoutDuration({
|
||||
sourceKind: source.kind,
|
||||
originalUrl: url,
|
||||
url: source.url,
|
||||
});
|
||||
const metadataStatus = shouldProbeMetadata ? 'pending' : 'disabled';
|
||||
const session = {
|
||||
id,
|
||||
url: source.url,
|
||||
originalUrl: url,
|
||||
@@ -189,12 +192,14 @@ app.post('/api/session', async (request, response) => {
|
||||
forceSplitPlayback: false,
|
||||
createdAt: Date.now(),
|
||||
lastUsedAt: Date.now(),
|
||||
});
|
||||
};
|
||||
|
||||
logInfo(`session created id=${shortId(id)} source=${source.kind} mode=${getSessionPlaybackConnectionMode(sessions.get(id))} fps=${options.fps} width=${options.width} quality=${options.quality}`);
|
||||
sessions.set(id, session);
|
||||
|
||||
if (METADATA_PROBE_ENABLED) {
|
||||
startSessionMetadataProbe(sessions.get(id));
|
||||
logInfo(`session created id=${shortId(id)} source=${source.kind} mode=${getSessionPlaybackConnectionMode(session)} fps=${options.fps} width=${options.width} quality=${options.quality}`);
|
||||
|
||||
if (shouldProbeMetadata) {
|
||||
startSessionMetadataProbe(session);
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user