Skip to content

Commit

Permalink
feat(fileupload): add additional allowed video mime types
Browse files Browse the repository at this point in the history
  • Loading branch information
atlwendy committed Sep 14, 2019
1 parent 25f0b42 commit 739efbe
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion demo/app/components/file-upload/file-upload.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export class FileUploadComponent {
multiple = true;
hideButton = false;
maxKb: number | undefined;
mimeTypeOptions = ['image/png', 'image/jpg', 'image/jpeg', 'text/csv', 'video/mp4'];
mimeTypeOptions = ['image/png', 'image/jpg', 'image/jpeg', 'text/csv', 'video/mp4', 'video/x-flv', 'video/webm', 'video/quicktime', 'video/mpeg'];
ratioConstraints = ['1:2', '1.9:1', '5:1'];


Expand Down
3 changes: 2 additions & 1 deletion terminus-ui/file-upload/src/file-upload.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,8 @@ describe(`TsFileUploadComponent`, function() {
hostComponent.mimeTypes = undefined;
fixture.detectChanges();

expect(component.virtualFileInput.getAttribute('accept')).toEqual('text/csv,image/jpeg,image/jpg,image/png,image/gif,video/mp4');
expect(component.virtualFileInput.getAttribute('accept'))
.toEqual('text/csv,image/jpeg,image/jpg,image/png,image/gif,video/mp4,video/x-flv,video/webm,video/quicktime,video/mpeg');
});

});
Expand Down
8 changes: 8 additions & 0 deletions terminus-ui/file-upload/src/mime-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ export type TsFileAcceptedMimeTypes
| 'image/png'
| 'image/gif'
| 'video/mp4'
| 'video/x-flv'
| 'video/webm'
| 'video/quicktime'
| 'video/mpeg'
;


Expand All @@ -21,4 +25,8 @@ export const TS_ACCEPTED_MIME_TYPES: TsFileAcceptedMimeTypes[] = [
'image/png',
'image/gif',
'video/mp4',
'video/x-flv',
'video/webm',
'video/quicktime',
'video/mpeg',
];

0 comments on commit 739efbe

Please sign in to comment.