Skip to content

Commit ba8d6a9

Browse files
Update api-playground/overview.mdx
1 parent 73777e0 commit ba8d6a9

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

api-playground/overview.mdx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,33 @@ Individual `MDX` pages are recommended for small APIs or when you want to experi
144144

145145
For more information, see [x-mint extension](/api-playground/openapi-setup#x-mint-extension) and [MDX Setup](/api-playground/mdx/configuration).
146146

147+
## Media responses
148+
149+
The API playground automatically detects and renders media content types in responses:
150+
151+
- **Images** (`image/*`) - Display inline with full resolution
152+
- **Audio** (`audio/*`) - Playable audio player with controls
153+
- **Video** (`video/*`) - Embedded video player with controls
154+
155+
When your API returns a response with a media content type, the playground renders it directly in the response panel. This allows users to immediately preview generated images, audio files, or video content without downloading.
156+
157+
### Example
158+
159+
If your API endpoint returns a video, ensure your OpenAPI specification includes the appropriate content type:
160+
161+
```yaml
162+
responses:
163+
"200":
164+
description: Generated video
165+
content:
166+
video/mp4:
167+
schema:
168+
type: string
169+
format: binary
170+
```
171+
172+
The playground will automatically render the video with playback controls when the endpoint is called.
173+
147174
## Further reading
148175
149176
- [AsyncAPI Setup](/api-playground/asyncapi/setup) for more information on creating your AsyncAPI schema to generate WebSocket reference pages.

0 commit comments

Comments
 (0)