Start learning with our library of video tutorials taught by experts. Get started
Viewers: in countries Watching now:
Before we get working with HTML5 video and audio, here is one step we need to do to make sure our server is delivering the files correctly, and that is to add the correct MIME types. When a browser requests a file from the server along with the file data the server will send information about the file in the response header. This includes a MIME type, which basically identifies what type of file it is. Unfortunately many servers by default will deliver the wrong MIME type for the Ogg and WebM formats. When this happens, HTML5 video won't work.
So we need to correct this. If your server is running Apache, which most likely it is, we just need to add or edit the .htaccess file. The .htaccess file lives at the root of your server. For using the exercise files you can find a version in the 1-04 folder of the exercise files and the htaccess.txt file, which is one I have here open, and you can basically rename this file to .htaccess without the .txt at the end which is the correct for the file that you will be uploading to the server.
Check and make sure you don't already have an htaccess file on your server before adding a new one. The file name starts with a dot, so depending on how you are viewing your website's files, the .htaccess file may be hidden. If your FTP browser has a setting to show or hide files that begin with a dot, make sure they are showing. I am going to use fetch, which shows the files that begin with the dot by default. I am going to go ahead and open up the htaccess from the Explore California site and you can see that I added the AddType lines below content that was already in the file and so you can do that too if you already have content in your htaccess file.
But these are the lines that you want to add. With these lines we are just helping server understand what types is delivering. So, we can pass the word onto web browsers which can then play back the media. If you're running different server software than Apache, you will need to look up how to add MIME types for your specific server. If you're working with video and audio files on your computer, they should work fine without this step. Just know that when you start uploading your files to a server, you might run into this issue.
There are currently no FAQs about HTML5: Video and Audio in Depth.
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.