While implementing HTML5 video with WebM source files (or presumably Ogg Theora) on a new Drupal 7 site — the file totally fails. Looking at the page in Firefox, the video file simply doesn't load. The HTML5 video player sits there with a broken source file icon.

After many hours of debugging, I tracked down the problem — the server is not properly supporting the file type.

The fix is to add the following lines to the htaccess file:

#
# Serve webm files as WebM video and ogg files as Ogg video
#
AddType video/ogg .ogv
AddType video/webm .webm

This tells the server and browser and what these files are.

Searching Drupal.org, it seems a lot of people are having trouble with WebM throughout Drupalandia, and are filing support requests on various Drupal contrib module issue queues.

It would be great for Drupal core to support WebM and Ogg Theora out of the box, especially since this could help overall adoption of the open source video codecs. Too many times, I've seen development teams consider supporting WebM too much work, and instead only use h.264 (with flash for Firefox and Opera). This is quite an obscure bug that's easy to fix. Without this, Drupal doesn't really support HMTL5 video.

Comments

jensimmons’s picture

Version: 7.x-dev » 8.x-dev

Has to go into Drupal 8 first, and get back ported.

Crell’s picture

I've no objection. My only question is whether this is really a Drupal issue, or a web server configuration bug that we're just hacking around. (I mean really, shouldn't Apache have those associations by default already?)

willvincent’s picture

This seems like a reasonable request. It's only adding a couple lines to the htaccess file, so it's not like it would bloat the codebase.

+1

Dave Reid’s picture

My concern about .webm is that it can either be audio or video (see the mimetypes on http://en.wikipedia.org/wiki/WebM) - it's an ambiguous file format so I would worry about hard-coding this video assumption. I also wonder why Apache doesn't have the happings for ogv.

jensimmons’s picture

I agree, it seems this isn't really a Drupal problem, but a Apache (or other type of) server problem. Yet altering the htaccess file seems like a good fix to me — even if it's an impure hack. IMO, the downside is minimal — a practical solution to a growning-pains problem in exchange for tolerating something that's a inconsistent with what usually goes into the Drupal .htaccess file.

Years from now presumably these two lines could be removed, once servers uniformly support .webm and .ogv files.

I see two decisions to be made:

  1. Will the Drupal core community support using the core htaccess file to fix this problem?
  2. What is the best way to write the AddType?

I did not encounter this problem when posting .ogg audio files.

willvincent’s picture

wikipedia makes it look like it can be audio or video, but according to the webmproject site (http://www.webmproject.org/about/), it is a video format. So, I would think setting the mime type as such is perfectly acceptable.

Dave Reid’s picture

Dave Reid’s picture

Component: other » file system

I'm unsure on this too. Do we add support for any new file extension that apache adds in its mime.types in our own .htaccess? How do we balance which added file extensions are useful for end users? We'd also need to records in web.config for IIS.

FYI we also need to add the webm/weba file extensions in file_default_mimetype_mapping().

markdorison’s picture

Component: file system » other

This may not technically be Drupal's problem, per se, but it seems like a small fix with a lot of upside.

jensimmons’s picture

Component: other » file system
Crell’s picture

Component: file system » other

A little undirected googling suggests that "yeah, just add it to your config" is the common answer right now, so we may as well do the same until it becomes standard in Apache/IIS. Dave is right that we'd need to do so for both apache and IIS at this point, since we claim to support both equally. As not an expert in either one I cannot speak to what the "best" syntax is to do so.

We should probably include weba, too, while we're at it.

jensimmons’s picture

Component: other » file system

This is part of what motivated me to file a core bug: search for "WebM" on drupal.org, and you see struggle after struggle after struggle to solve this same problem. Sadly, very little else is being said about the leading open-source video codec.

http://drupal.org/search/apachesolr_multisitesearch/webm?filters=ss_meta...

I like things that make tricky, time-consuming problems Just Go Away™.

tim.plunkett’s picture

Issue tags: +Needs backport to D7

fixing tags

tim.plunkett’s picture

Issue summary: View changes

.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

kim.pepper’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Closing as outdated. Please re-open if this is still relevant.