fix: add playsinline for iOS video support

iOS Safari requires playsinline attribute for inline video playback.

Note: MKV videos still won't play on iOS - only MP4/H.264 is supported.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
gilesb
2026-01-07 19:57:27 +00:00
parent f9e22171de
commit 809d8e452b

View File

@@ -432,7 +432,7 @@ async def ui_cache_view(content_hash: str, request: Request):
"""
if media_type == "video":
html += f'<video src="/cache/{content_hash}" controls autoplay muted loop style="max-width:100%;max-height:500px;"></video>'
html += f'<video src="/cache/{content_hash}" controls autoplay muted loop playsinline style="max-width:100%;max-height:500px;"></video>'
elif media_type == "image":
html += f'<img src="/cache/{content_hash}" alt="{content_hash}" style="max-width:100%;max-height:500px;">'
else:
@@ -1384,7 +1384,7 @@ async def ui_runs(request: Request):
<div class="media-container">
''')
if input_media_type == "video":
html_parts.append(f'<video src="/cache/{input_hash}" controls muted loop></video>')
html_parts.append(f'<video src="/cache/{input_hash}" controls muted loop playsinline></video>')
elif input_media_type == "image":
html_parts.append(f'<img src="/cache/{input_hash}" alt="input">')
html_parts.append('</div></div>')
@@ -1399,7 +1399,7 @@ async def ui_runs(request: Request):
<div class="media-container">
''')
if output_media_type == "video":
html_parts.append(f'<video src="/cache/{output_hash}" controls autoplay muted loop></video>')
html_parts.append(f'<video src="/cache/{output_hash}" controls autoplay muted loop playsinline></video>')
elif output_media_type == "image":
html_parts.append(f'<img src="/cache/{output_hash}" alt="output">')
html_parts.append('</div></div>')
@@ -1627,7 +1627,7 @@ async def ui_detail_page(run_id: str, request: Request):
<div class="media-container">
'''
if input_media_type == "video":
html += f'<video src="/cache/{input_hash}" controls muted loop></video>'
html += f'<video src="/cache/{input_hash}" controls muted loop playsinline></video>'
elif input_media_type == "image":
html += f'<img src="/cache/{input_hash}" alt="input">'
html += '</div></div>'
@@ -1641,7 +1641,7 @@ async def ui_detail_page(run_id: str, request: Request):
<div class="media-container">
'''
if output_media_type == "video":
html += f'<video src="/cache/{output_hash}" controls autoplay muted loop></video>'
html += f'<video src="/cache/{output_hash}" controls autoplay muted loop playsinline></video>'
elif output_media_type == "image":
html += f'<img src="/cache/{output_hash}" alt="output">'
html += '</div></div>'
@@ -1833,7 +1833,7 @@ async def ui_run_partial(run_id: str):
input_media_type = detect_media_type(CACHE_DIR / input_hash)
html += f'<div class="media-box"><label>Input: <a href="/ui/cache/{input_hash}">{input_hash[:24]}...</a></label><div class="media-container">'
if input_media_type == "video":
html += f'<video src="/cache/{input_hash}" controls muted loop></video>'
html += f'<video src="/cache/{input_hash}" controls muted loop playsinline></video>'
elif input_media_type == "image":
html += f'<img src="/cache/{input_hash}" alt="input">'
html += '</div></div>'
@@ -1843,7 +1843,7 @@ async def ui_run_partial(run_id: str):
output_media_type = detect_media_type(CACHE_DIR / output_hash)
html += f'<div class="media-box"><label>Output: <a href="/ui/cache/{output_hash}">{output_hash[:24]}...</a></label><div class="media-container">'
if output_media_type == "video":
html += f'<video src="/cache/{output_hash}" controls autoplay muted loop></video>'
html += f'<video src="/cache/{output_hash}" controls autoplay muted loop playsinline></video>'
elif output_media_type == "image":
html += f'<img src="/cache/{output_hash}" alt="output">'
html += '</div></div>'