Changing video content type (mime type) in CDN in drupal 7

一曲冷凌霜 提交于 2019-11-29 15:48:05

A MIME-TYPE is a server side setting. You can ask your hosting provider to add the MP4 MIME-TYPE for you.

Or, you can add a .htaccess file to the directory where you uploads are stored.

A sample .htaccess file that adds the MP4 MIME-TYPE is:

<IfModule mod_rewrite.c>
  AddType video/mp4 .mp4
</IfModule>

If you are not able to add the MIME TYPE properly, one work around you can use is to force the JW Player to run as Flash, which is less strict about MIME-TYPEs, by adding this line, to your player's embed code:

primary: 'flash',

Let me know if this helps!

Hitesh

Found the Answer :

1) As Ethan said "A MIME-TYPE is a server side setting. You can ask your hosting provider to add the MP4 MIME-TYPE for you.

Or, you can add a .htaccess file to the directory where you uploads are stored".

A sample .htaccess file that adds the MP4 MIME-TYPE is:

<IfModule mod_rewrite.c>
  AddType video/mp4 .mp4
</IfModule>"

Source : Need to Change Video Content Type to video/mp4 so it plays in IE

But this did not work for me for some reason

2) I did the change in my core class file which i was using in drupal module for CDN upload I had made a change in my class.s3.php file -> in mime_type[] array and also, cross checked with putObject() function.

**

Setting of mime type is always done in coding side and not in AWS S3 bucket, We need to use AWS PHP Class file or sdk to do the manipulation in mime type or make the necessary changes in core class file (eg. class.s3.php )

** For details check here find-mime-type-of-file-or-url-using-php-for-all-file-format

Second Answer has worked for me :)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!