Skip to main content

Hosting 360 Degree Videos and Images in a CORS Supported Server

Why: If you have been playing with 360 degree videos and images like me in the recent past (specially with the awesome release of Mozilla aframe.io) then probably you are looking for an inexpensive or preferable free place to host your images/videos since most of the free places where we can upload them don't support CORS.

How: 

Using AWS to Host 360° Virtual Reality Panoramas & 360° Video


AWS S3 has no inode limit and works especially well with multi-res panorama. AWS S3 also works well for large streaming 360° Video Files.

Create an AWS S3 Account

If you do not already have an AWS S3 account, sign up for a Free Amazon Web Services Trial Account, see the following video for details

Create a Bucket

Once you have created your account you will need to create at least one Bucket, see the following video for simple instructions if you are not already familiar with basics of using AWS S3

Set permissions for your bucket

use the AWS web interface to set AWS Bucket Policy & CORS Configuration, setting these as below will automatically set public read access permissions for all files in that bucket, otherwise you will have to set permission per file and may have trouble viewing your panoramas


AWS S3 Bucket Permissions: Bucket Policy and CORS Configuration

Go to your "All Buckets" list on your S3 page, click on the "Properties" button in the upper right, select your bucket, and click on the "Permissions" option, and set the following -

Edit Bucket Policy -

Replace MY_BUCKET_NAME with the name of the bucket you are editing

{
"Version": "2008-10-17",
"Id": "http referer policy example",
"Statement": [
{
"Sid": "readonly policy",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::MY_BUCKET_NAME/*"
}
]
}

Add CORS Configuration

<CORSRule>
        <AllowedOrigin>http://*
        <AllowedOrigin>https://*
        <AllowedMethod>GET</AllowedMethod>
        <MaxAgeSeconds>3000</MaxAgeSeconds>
        <AllowedHeader>Authorization</AllowedHeader>
    </CORSRule>
</CORSConfiguration>

Uploading Panoramas

You can upload your panoramas to AWS S3 either using the web interface, or with ftp clients such as Cyberduck or Transmit, and many others

Popular posts from this blog

LibrePlanet 2017: Liberating your open source experience

LibrePlanet is a yearly gathering of free software activists, users, and contributors—and, it's my favorite conference of the year. Here's why.
LibrePlanet is run by the Free Software Foundation, and has steadily evolved from a yearly members' meeting with presentations from staff and board members to a full blown two-day conference with speakers and attendees from all over the world. The event brings people who care about free software together to talk about the future of the movement, address current challenges, and celebrate successes.
PreludeI was invited to give a talk at LibrePlanet 2017 on 25th March at MIT, in Cambridge, Massachusetts representing Mozilla as a Tech Speaker. I reached Boston on 25th early morning. Around 1 AM. The journey itself was awesome till I realized that you don't get Uber or Lyft at Boston Airport.

Not that the apps don't function there. They work! Just no driver will be ready to pick you up from Airport at that time. After trying to b…

Bringing the Focus back : Firefox Focus (Builds) for Android

Firefox Focus – A Free, Fast Private Browser for....android! On 17th November 2016 Mozilla announced Firefox Focus. A free fast and easy to use private browser for iOS. Firefox Focus was filled with goodies. From inbuilt tracker blocking, content blockers to making privacy the first class citizen. It was all of that. Wrapped in a nice package, but only for Apple Ecosystem. The argument for having focus was to make privacy dead simple and default experience for most people out there. An excellent read is this article "Privacy made simple with Firefox Focus".
And while this was all fine, a lot of us were severely disappointed that we don't have an android version. That all changes now.
Mozilla has released a port of the Firefox Focus source code and I decided to build a port from it. And this is how it looks in my One Plus One.
If you notice it looks almost similar to its iOS counterpart. Focus blocks tracking cookies by default in its system. But there are small design c…

LinuxCon China 2017: Trip Report

Linux Foundation held a combination of three events in China as part of their foray into Asia early this year. It was a big move for them since this was supposed to be the first time Linux Foundation would hold an event in Asia. I was invited to present a talk on Hardening IoT endpoints. The event was held in Beijing, and since I have never been to Beijing before I was pretty excited for the talk. However, it turned out the journey is pretty long and expensive. Much more than a student like me can hope to bear. Normally I represent Mozilla in such situations, but the topic of the talk was too much into security and not aligned much with the goals of Mozilla at that moment. Fortunately, Linux Foundation gave me a Scholarship to come and speak at LinuxCon China which enabled me to attend LinuxCon and the awesome team at Mozilla TechSpeakers including Michael Ellis and Havi helped me get ready for the talk.

The event was held at China National Convention Center. It's a beautiful and …