List of contents:
- Checking, if mime-type is set correctly
- Fixing MIME type in AWS
- How to change MIME types as a batch operation
Do you have any trouble getting your videos to play in some browsers with FV Player (or any other HTML 5 video player)? Here’s how to fix it.
If your videos on Amazon S3 do not have the proper MIME type, also known as content-type, you will have to edit them to be able to play these videos. This can be fixed individually in your AWS console, or as a batch operation using CloudBerry Explorer.
Checking, if MIME type is set correctly
Log in to your Amazon Web Services (AWS) account at https://console.aws.amazon.com, and click S3 in the menu:
Open the bucket to which your video was uploaded. Next, click a video in the bucket to open its details. In the properties tab, scroll down to Metadada:
There should be the following values:
Key: Content-Type Value: video/mp4
or any other value, corresponding with the file-type of the uploaded video.
There definitely should NOT be Value: application/octet-stream.
Fixing MIME type in AWS
If you need to fix your MIME type on just a couple of files, you can easily do that in your AWS console. If you have a large amount of files to fix, it is better to do this as an batch operation.
1. Access the Metadata in Properties tab of your video file, just like in the previous section of this guide. Once there, click Edit.
Notice that the MIME type for this video is set to audio/mp3. That is incorrect, as this is a video file in mp4 format.
2. Simply rewrite the Value field to the correct value for your video file and hit Edit metadata.
That’s it, your video should play without issues now.
How to change MIME types as a batch operation
If you have a large number of videos with incorrect MIME types, you can save a lot of time by changing the types as a batch operation. For this, we recommend using a S3 bucket explorer software. The following guide is for batch operations using CloudBerry.
- In your AWS account, click your username and then click My Security Credentials.
If a window shows up, informing you that you are accessing the security credentials of your AWS account, close it by clicking X in its top-right corner.
- Select Access Keys. You will need both your secret Access Key and Access Key ID.
You cannot view your Secret Access Keys. If you do not know them, you can create a new pair by clicking Create New Access Key. At the next window, click Download Key File to save it, as you will not be able to get it later.
Download the free version of CloudBerry Explorer by following this link: https://www.msp360.com/explorer.aspx. Once downloaded, install it.
Upon opening the CloudBerry Explorer, you will be prompted to pick a cloud storage to register your account. Pick Amazon S3.
- A window prompting you to add new Amazon S3 account will pop up. Enter a display name of your choosing, then enter the access and secret keys from Amazon Web Services. Then click add.
- Change your source from My Computer to your added Amazon S3 account.
Now you can see all your buckets from Amazon S3. Pick a bucket which you wish to edit and select all the videos with incorrect MIME types. Then click Set HTTP Headers.
Make sure, to pick the “Keep existing headers, overwrite values for headers with the same name and add new headers” option. Then click Add.
- In the drop-down menus, set Content-Type for the HTTP Header and set appropriate value in the Value field. Then click Ok.
- Review and click Ok.
- You can see the progress of editing in the bottom half of the screen. This operation should be rather quick. Once it is successfully done, the progress list will disappear. If something fails, you will receive error reports on the failed operations.
- When the editing is finished, choose a video from the edited bucket to test, if it plays correctly. The Video OK admin note should appear above the video.
From now on, your videos should play well in HTML 5 and specifically in FV Player. If you run into any other issues or have any further tips for using Amazon S3 for HTML 5 videos, do not hesitate to let us know.
Thanks for using FV Player!