DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
  1. DZone
  2. Coding
  3. Languages
  4. How To Configure Your Webserver for HTML5 Video

How To Configure Your Webserver for HTML5 Video

Kristof Degrave user avatar by
Kristof Degrave
·
Apr. 09, 12 · Interview
Like (0)
Save
Tweet
Share
22.42K Views

Join the DZone community and get the full member experience.

Join For Free

When you are using HTML 5.0 video on your website, you need to remember that your webserver is configured to send the correct MIME–type with your file. If you don’t the browsers won’t recognize it and the video won’t play. You will see an X appearing on your video, and the video will not start playing when you click on it.

If you are using an Apache webserver, you can use the AddType directive in your side-wide httpd.conf or in the .htaccess file that is located in your directory where your videos are stored.

The following line should be added in that case:

AddType video/ogg .ogv
AddType video/mp4 .mp4
AddType video/webm .webm

When you are using an IIS server there are 2 possibilities. You can configure it on your IIS server, or you can add the MIME–types in your Web.config.

When you want to configure the MIME–types on your IIS server there are some differences between the versions.

  • Configuring MIME-Type for IIS 6.0
  • Configureer MIME-type for IIS 7.0

The other possibility is using your Web.config. This is ideal for developers who are use IIS Express and don’t have a full instance of IIS running. But beware, this is only supported when you are using IIS 7.0 or higher. The following section needs to be added in your configuration file:

<configuration>
  <system.webServer>
    <staticContent>
      <mimeMap fileExtension=".mp4" mimeType="video/mp4" />
      <mimeMap fileExtension=".webm" mimeType="video/webm" />
      <mimeMap fileExtension=".ogv" mimeType="video/ogv" />
    </staticContent>
  </system.webServer>
</configuration>

 

HTML

Published at DZone with permission of Kristof Degrave, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Build an Automated Testing Pipeline With GitLab CI/CD and Selenium Grid
  • How To Best Use Java Records as DTOs in Spring Boot 3
  • Stress Testing Tutorial: Comprehensive Guide With Best Practices
  • Microservices 101: Transactional Outbox and Inbox

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: