Demonstrates serving binary content (video) via MCP resources using the
base64 blob pattern:
1. Server fetches video from CDN
2. Returns as base64 blob via `videos://{id}` resource template
3. Widget fetches resource and plays in `<video>` element
Includes multiple video sizes for testing (1MB to 150MB).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
28 lines
801 B
HTML
28 lines
801 B
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta name="color-scheme" content="light dark">
|
|
<title>Video Resource Player</title>
|
|
</head>
|
|
<body>
|
|
<main class="main">
|
|
<div id="loading" class="loading">
|
|
<div class="spinner"></div>
|
|
<p id="loading-text">Waiting for video...</p>
|
|
</div>
|
|
|
|
<div id="error" class="error" style="display: none;">
|
|
<p class="error-title">Error loading video</p>
|
|
<p id="error-message"></p>
|
|
</div>
|
|
|
|
<div id="player" class="player" style="display: none;">
|
|
<video id="video" controls></video>
|
|
<p id="video-info" class="video-info"></p>
|
|
</div>
|
|
</main>
|
|
<script type="module" src="/src/mcp-app.ts"></script>
|
|
</body>
|
|
</html>
|