【发布时间】:2014-03-17 20:18:09
【问题描述】:
我正在使用媒体模块将媒体保存在 CDN 中。要播放视频,我们在 Drupal 7 中使用 jwplayer。Jwplayer 在 IE 中抛出错误,如果视频不是 content type [mime type] *video/mp4*。我已将现有的 CDN 视频 mime 类型从 application/octet-stream 更改为 video/mp4。
现在上传/保存到 cdn 的任何 mp4 视频都应该只是 video/mp4 mime 类型,但是当我在媒体模块中上传 mp4 视频时,它会以 mime 类型 application/octet 保存在 CDN 中-stream,如何将上传的mime type [content type] 更改为video/mp4。
CDN module code
function CDNtransfer_content($source,$destination) {
$s3=_CDN_transfer_load();
$up_bucket="cdn.example.com";
$uploadOk=null;
$expires=date('D, d M Y H:i:s O', strtotime('+10 year'));
$headers=array('Content-Type' => 'video/mp4', 'Expires' => $expires);
if($destination)
{
$up_state=$s3->putObject($up_bucket, $destination, $source, 'true', $headers);
if($s3->objectExists($up_bucket, $destination)) {
$uploadOk =1;
}
else {
$uploadOk ="Error: File Not Uploaded Correctly. Please try again.";
}
}
return $uploadOk;
}
即使设置上面的标题似乎也不起作用!不知道为什么??
我们在 drupal 中使用 s3 php sdk 2 aws stand alone class 和我们的自定义模块。
在上传 mp4 视频时,如何在 Drupal 7 媒体模块中将 mime type[content type] 更改为 video/mp4。
【问题讨论】:
标签: .htaccess amazon-web-services drupal-7 cdn jwplayer