duanjiongzhen2523 2013-12-22 14:32
浏览 173
已采纳

在WordPress中更改MIME类型

I am using JW Player plugin from wordpress. I try to upload mp4 file in the admin dashboard -> media There is nothing problem in the uploading. but when i try to load the video in jw player of wordpress it loads only audio. When i try to upload the file it shows the mime type as video/quicktime but i uploaded the mp4 file and mime type should be video/mp4 Not sure why this should happen.

Here is the screenshot that i uploaded from my side

enter image description here

How to change the mime type as video/mp4. Is that anything in wordpress or in convertor?

Any one give me a suggestion to overcome this problem

Reg, vicky

  • 写回答

2条回答 默认 最新

  • douzhan2027 2013-12-22 15:25
    关注

    To add additional MIME types, in function.php write the below code:

    add_filter('upload_mimes', 'add_custom_mime_types');
    
    function add_custom_mime_types($mimes) {
        return array_merge($mimes, array (
            'ac3' => 'audio/ac3',
            'mpa' => 'audio/MPA',
            'flv' => 'video/x-flv',
            'svg' => 'image/svg+xml'
        ));
    }
    

    To remove existing MIME types:

    add_filter('upload_mimes', 'remove_mime_types');
    
    function remove_mime_types($mimes) {
        unset($mimes['mp4']);
    }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序