mirror of
https://github.com/usebruno/bruno.git
synced 2025-02-02 02:49:48 +01:00
Any audio and video response can be now be previewed.
This commit is contained in:
parent
82c600a0e6
commit
7741a3e4ee
@ -65,6 +65,16 @@ const QueryResultPreview = ({
|
||||
</div>
|
||||
);
|
||||
}
|
||||
case 'preview-audio': {
|
||||
return (
|
||||
<audio controls src={`data:${contentType.replace(/\;(.*)/, '')};base64,${dataBuffer}`} className="mx-auto" />
|
||||
);
|
||||
}
|
||||
case 'preview-video': {
|
||||
return (
|
||||
<video controls src={`data:${contentType.replace(/\;(.*)/, '')};base64,${dataBuffer}`} className="mx-auto" />
|
||||
);
|
||||
}
|
||||
default:
|
||||
case 'raw': {
|
||||
return (
|
||||
|
@ -67,6 +67,10 @@ const QueryResult = ({ item, collection, data, dataBuffer, width, disableRunEven
|
||||
allowedPreviewModes.unshift('preview-image');
|
||||
} else if (contentType.includes('pdf')) {
|
||||
allowedPreviewModes.unshift('preview-pdf');
|
||||
} else if (contentType.includes('audio')) {
|
||||
allowedPreviewModes.unshift('preview-audio');
|
||||
} else if (contentType.includes('video')) {
|
||||
allowedPreviewModes.unshift('preview-video');
|
||||
}
|
||||
|
||||
return allowedPreviewModes;
|
||||
|
@ -25,6 +25,7 @@ const contentSecurityPolicy = [
|
||||
// this has been commented out to make oauth2 work
|
||||
// "form-action 'none'",
|
||||
"img-src 'self' blob: data: https:",
|
||||
"media-src 'self' blob: data: https:",
|
||||
"style-src 'self' 'unsafe-inline' https:"
|
||||
];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user