mirror of
https://github.com/usebruno/bruno.git
synced 2025-06-27 07:21:51 +02: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>
|
</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:
|
default:
|
||||||
case 'raw': {
|
case 'raw': {
|
||||||
return (
|
return (
|
||||||
|
@ -67,6 +67,10 @@ const QueryResult = ({ item, collection, data, dataBuffer, width, disableRunEven
|
|||||||
allowedPreviewModes.unshift('preview-image');
|
allowedPreviewModes.unshift('preview-image');
|
||||||
} else if (contentType.includes('pdf')) {
|
} else if (contentType.includes('pdf')) {
|
||||||
allowedPreviewModes.unshift('preview-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;
|
return allowedPreviewModes;
|
||||||
|
@ -25,6 +25,7 @@ const contentSecurityPolicy = [
|
|||||||
// this has been commented out to make oauth2 work
|
// this has been commented out to make oauth2 work
|
||||||
// "form-action 'none'",
|
// "form-action 'none'",
|
||||||
"img-src 'self' blob: data: https:",
|
"img-src 'self' blob: data: https:",
|
||||||
|
"media-src 'self' blob: data: https:",
|
||||||
"style-src 'self' 'unsafe-inline' https:"
|
"style-src 'self' 'unsafe-inline' https:"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user