diff options
-rw-r--r-- | client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html | 2 | ||||
-rw-r--r-- | config/default.yaml | 2 | ||||
-rw-r--r-- | config/production.yaml.example | 2 | ||||
-rw-r--r-- | server/initializers/constants.ts | 42 | ||||
-rw-r--r-- | server/tests/api/server/config.ts | 1 |
5 files changed, 40 insertions, 9 deletions
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html index a297b0c79..8fdced1c7 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html +++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html | |||
@@ -731,7 +731,7 @@ | |||
731 | i18n-labelText labelText="Allow additional extensions" | 731 | i18n-labelText labelText="Allow additional extensions" |
732 | > | 732 | > |
733 | <ng-container ngProjectAs="description"> | 733 | <ng-container ngProjectAs="description"> |
734 | <span i18n>Allows users to upload .mkv, .mov, .avi and .flv videos.</span> | 734 | <span i18n>Allows users to upload .mkv, .mov, .avi, .wmv, .flv, .f4v, .3g2, .3gp, .mts, m2ts, .mxf, .nut videos.</span> |
735 | </ng-container> | 735 | </ng-container> |
736 | </my-peertube-checkbox> | 736 | </my-peertube-checkbox> |
737 | </div> | 737 | </div> |
diff --git a/config/default.yaml b/config/default.yaml index d6f7f7afe..a3af1b15f 100644 --- a/config/default.yaml +++ b/config/default.yaml | |||
@@ -213,7 +213,7 @@ user: | |||
213 | # Please, do not disable transcoding since many uploaded videos will not work | 213 | # Please, do not disable transcoding since many uploaded videos will not work |
214 | transcoding: | 214 | transcoding: |
215 | enabled: true | 215 | enabled: true |
216 | # Allow your users to upload .mkv, .mov, .avi, .flv videos | 216 | # Allow your users to upload .mkv, .mov, .avi, .wmv, .flv, .f4v, .3g2, .3gp, .mts, m2ts, .mxf, .nut videos |
217 | allow_additional_extensions: true | 217 | allow_additional_extensions: true |
218 | # If a user uploads an audio file, PeerTube will create a video by merging the preview file and the audio file | 218 | # If a user uploads an audio file, PeerTube will create a video by merging the preview file and the audio file |
219 | allow_audio_files: true | 219 | allow_audio_files: true |
diff --git a/config/production.yaml.example b/config/production.yaml.example index f57861eca..c1e7c6c03 100644 --- a/config/production.yaml.example +++ b/config/production.yaml.example | |||
@@ -227,7 +227,7 @@ user: | |||
227 | # Please, do not disable transcoding since many uploaded videos will not work | 227 | # Please, do not disable transcoding since many uploaded videos will not work |
228 | transcoding: | 228 | transcoding: |
229 | enabled: true | 229 | enabled: true |
230 | # Allow your users to upload .mkv, .mov, .avi, .flv videos | 230 | # Allow your users to upload .mkv, .mov, .avi, .wmv, .flv, .f4v, .3g2, .3gp, .mts, m2ts, .mxf, .nut videos |
231 | allow_additional_extensions: true | 231 | allow_additional_extensions: true |
232 | # If a user uploads an audio file, PeerTube will create a video by merging the preview file and the audio file | 232 | # If a user uploads an audio file, PeerTube will create a video by merging the preview file and the audio file |
233 | allow_audio_files: true | 233 | allow_audio_files: true |
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index ca6c2a7ff..573d86b60 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts | |||
@@ -823,6 +823,7 @@ export { | |||
823 | 823 | ||
824 | function buildVideoMimetypeExt () { | 824 | function buildVideoMimetypeExt () { |
825 | const data = { | 825 | const data = { |
826 | // streamable formats that warrant cross-browser compatibility | ||
826 | 'video/webm': '.webm', | 827 | 'video/webm': '.webm', |
827 | 'video/ogg': '.ogv', | 828 | 'video/ogg': '.ogv', |
828 | 'video/mp4': '.mp4' | 829 | 'video/mp4': '.mp4' |
@@ -831,15 +832,44 @@ function buildVideoMimetypeExt () { | |||
831 | if (CONFIG.TRANSCODING.ENABLED) { | 832 | if (CONFIG.TRANSCODING.ENABLED) { |
832 | if (CONFIG.TRANSCODING.ALLOW_ADDITIONAL_EXTENSIONS) { | 833 | if (CONFIG.TRANSCODING.ALLOW_ADDITIONAL_EXTENSIONS) { |
833 | Object.assign(data, { | 834 | Object.assign(data, { |
834 | 'video/quicktime': '.mov', | ||
835 | 'video/x-msvideo': '.avi', | ||
836 | 'video/x-flv': '.flv', | ||
837 | 'video/x-matroska': '.mkv', | 835 | 'video/x-matroska': '.mkv', |
838 | 'video/avi': '.avi', | 836 | 'video/ogg': '.ogg', |
837 | |||
838 | // Developed by Apple | ||
839 | 'video/quicktime': '.mov', // often used as output format by editing software | ||
839 | 'video/x-m4v': '.m4v', | 840 | 'video/x-m4v': '.m4v', |
841 | 'video/m4v': '.m4v', | ||
842 | |||
843 | // Developed by the Adobe Flash Platform | ||
844 | 'video/x-flv': '.flv', | ||
845 | 'video/x-f4v': '.f4v', // replacement for flv | ||
846 | |||
847 | // Developed by Microsoft | ||
848 | 'video/x-ms-wmv': '.wmv', | ||
849 | 'video/x-msvideo': '.avi', | ||
850 | 'video/avi': '.avi', | ||
851 | |||
852 | // Developed by 3GPP | ||
853 | // common video formats for cell phones | ||
854 | 'video/3gpp': '.3gp', | ||
855 | 'video/3gpp2': '.3g2', | ||
856 | |||
857 | // Developed by FFmpeg/Mplayer | ||
858 | 'application/x-nut': '.nut', | ||
859 | |||
860 | // The standard video format used by many Sony and Panasonic HD camcorders. | ||
861 | // It is also used for storing high definition video on Blu-ray discs. | ||
862 | 'video/mp2t': '.mts', | ||
863 | 'video/m2ts': '.m2ts', | ||
864 | |||
865 | // Old formats reliant on MPEG-1/MPEG-2 | ||
866 | 'video/mpv': '.mpv', | ||
867 | 'video/mpeg2': '.m2v', | ||
868 | 'video/mpeg': '.mpeg', | ||
869 | |||
840 | // Could be anything | 870 | // Could be anything |
841 | 'application/octet-stream': null, | 871 | 'application/octet-stream': null, |
842 | 'video/m4v': '.m4v' | 872 | 'application/mxf': '.mxf' // often used as exchange format by editing software |
843 | }) | 873 | }) |
844 | } | 874 | } |
845 | 875 | ||
@@ -869,7 +899,7 @@ function updateWebserverConfig () { | |||
869 | } | 899 | } |
870 | 900 | ||
871 | function buildVideosExtname () { | 901 | function buildVideosExtname () { |
872 | return Object.keys(MIMETYPES.VIDEO.EXT_MIMETYPE) | 902 | return Object.keys(MIMETYPES.VIDEO.EXT_MIMETYPE).filter(e => e !== 'null') |
873 | } | 903 | } |
874 | 904 | ||
875 | function loadLanguages () { | 905 | function loadLanguages () { |
diff --git a/server/tests/api/server/config.ts b/server/tests/api/server/config.ts index 597233588..f5183042c 100644 --- a/server/tests/api/server/config.ts +++ b/server/tests/api/server/config.ts | |||
@@ -371,6 +371,7 @@ describe('Test config', function () { | |||
371 | expect(data.video.file.extensions).to.contain('.webm') | 371 | expect(data.video.file.extensions).to.contain('.webm') |
372 | expect(data.video.file.extensions).to.contain('.ogv') | 372 | expect(data.video.file.extensions).to.contain('.ogv') |
373 | expect(data.video.file.extensions).to.contain('.flv') | 373 | expect(data.video.file.extensions).to.contain('.flv') |
374 | expect(data.video.file.extensions).to.contain('.wmv') | ||
374 | expect(data.video.file.extensions).to.contain('.mkv') | 375 | expect(data.video.file.extensions).to.contain('.mkv') |
375 | expect(data.video.file.extensions).to.contain('.mp3') | 376 | expect(data.video.file.extensions).to.contain('.mp3') |
376 | expect(data.video.file.extensions).to.contain('.ogg') | 377 | expect(data.video.file.extensions).to.contain('.ogg') |