Skip to content

Commit

Permalink
ELEMENTS-1313: check video mime-types on nuxeo-document-preview
Browse files Browse the repository at this point in the history
  • Loading branch information
semisse committed Feb 5, 2021
1 parent 8554b75 commit 7ea0206
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions ui/nuxeo-document-preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,16 +281,20 @@ import './viewers/nuxeo-video-viewer.js';
this.document.properties['vid:transcodedVideos'] &&
this.xpath === 'file:content'
) {
const conversions = [];
this.document.properties['vid:transcodedVideos'].forEach((conversion) => {
if (conversion && conversion.content && conversion.content.data && conversion.content['mime-type']) {
conversions.push({
return this.document.properties['vid:transcodedVideos']
.filter(
(conversion) =>
conversion &&
conversion.content &&
conversion.content.data &&
conversion.content['mime-type'].match(/^video.*/),
)
.map((conversion) => {
return {
data: conversion.content.data,
type: conversion.content['mime-type'],
});
}
});
return conversions;
};
});
}
// fallback to blob data if there are no transcoded videos (e.g. video documents managed by liveconnect)
if (this.xpath) {
Expand Down

0 comments on commit 7ea0206

Please sign in to comment.