I am using media module to save media in CDN. To play videos, we are using jwplayer in Drupal 7. Jwplayer throws error in IE, If video is not of content type [mime type]
*video/mp4*. I have changed the existing CDN videos mime type from application/octet-stream
to video/mp4.
Now whatever mp4 videos are being uploaded/saved to cdn should only be of video/mp4 mime type but when I upload mp4 videos in media module it is saved in CDN with mime type application/octet-stream, How do I change the uploaded mime type [content type]
to 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;
}
Even setting the above header does not seem to work !!! not sure why ??
We are using s3 php sdk 2 aws stand alone class with our custom module in drupal.
How do I change mime type[content type]
to video/mp4 in media module, Drupal 7, when mp4 video are being uploaded.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…