Fix autofocus.

This commit is contained in:
John Livingston 2024-04-03 11:43:36 +02:00
parent 718b9a41e7
commit 624f053d02
No known key found for this signature in database
GPG Key ID: B17B5640CE66CDBC
1 changed files with 8 additions and 4 deletions

View File

@ -85,10 +85,14 @@ async function initConverse (
const isInIframe = inIframe()
initDom(initConverseParams, isInIframe)
if (!isInIframe) { initConverseParams.autofocus = true }
if (isInIframe || chatIncludeMode === 'peertube-video') {
initConverseParams.forceDefaultHideMucParticipants = true
}
// Autofocus: false if besides video, or if an external iframe
initConverseParams.autofocus = (chatIncludeMode === 'peertube-fullpage') ||
(chatIncludeMode === 'chat-only' && !isInIframe)
// hide participant if in an external iframe, or besides video.
initConverseParams.forceDefaultHideMucParticipants = (isInIframe || chatIncludeMode === 'peertube-video')
const params = defaultConverseParams(initConverseParams)
params.view_mode = chatIncludeMode === 'chat-only' ? 'fullscreen' : 'embedded'
params.allow_url_history_change = chatIncludeMode === 'chat-only'