Title: Forcing WebM part 2
Last modified: October 23, 2017

---

# Forcing WebM part 2

 *  Resolved [sconfig](https://wordpress.org/support/users/sconfig/)
 * (@sconfig)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/forcing-webm-part-2/)
 * Initially I posted in [https://wordpress.org/support/topic/forcing-webm-media-to-load-first-in-wordpress/](https://wordpress.org/support/topic/forcing-webm-media-to-load-first-in-wordpress/)
   and had the problem resolved about forcing WebM to be the first codec to load
   above MP4. However, After a few WordPress updates I noticed a spike in MP4 usage.
   The addition to the functions.php in my child theme is no longer working. All
   other defined functions within the child theme are operating perfectly fine. 
   Just not the video function that I have defined.
 * This is my initial code in my functions.php. It hasen’t changed in the years 
   I was running it.
 *     ```
       $array = apply_filters( 'wp_video_extensions', $array );
   
       function filter_wp_video_extensions( $array ) { 
               $array = str_replace ( 'webm' , 'blank' , $array );
               $array = str_replace ( 'mp4' , 'webm' , $array );
               $array = str_replace ( 'blank' , 'mp4' , $array );
               return $array; 
       }; 
   
       add_filter( 'wp_video_extensions', 'filter_wp_video_extensions', 10, 1 );
       ```
   
 * I wanted to be conservative in case WordPress core decided to add more video 
   formats in the future. I did tr to get more aggressive about it with:
 *     ```
       $array = apply_filters( 'wp_video_extensions', $array );
   
       function filter_wp_video_extensions( $array ) {
          return array( 'webm', 'mp4', 'm4v', 'ogv', 'wmv', 'flv' );
       }
   
       add_filter( 'wp_video_extensions', 'filter_wp_video_extensions', 10, 1 );
       ```
   
 * However it did not work.
 * I ultimately had to disable mp4’s off of my primary site which isn’t the end 
   of the world given that most modern browsers can accept WebM with no fallback.
   It would just be nice to have the default WordPress VideoPlayer fallback naturally
   for Apple and IE browsers.
 * Anyhow, thanks for your time!
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fforcing-webm-part-2%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Jacob Peattie](https://wordpress.org/support/users/jakept/)
 * (@jakept)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/forcing-webm-part-2/#post-9610716)
 * As far as I can tell nothing in WordPress has changed about the `wp_video_extensions`
   filter. I can’t see any changes to the video shortcode that would cause this 
   issue.
 * I tested your second block of code on an up-to-date WordPress install and it’s
   still working fine.
 * Wherever your issue is, it’s not with this code. Do you have any media related
   plugins that might also be filtering this list? Have you tried increasing the
   priority.
 * PS: Why are you _disabling_ mp4 just because you can’t play webm first anyway?
   You’re stopping a huge percentage of users from being able to view the video 
   at all, just because you want to prioritise webm? You say “most modern browsers”,
   but Safari, iOS and IE aren’t exactly a drop in the bucket. Maybe you mentioned
   on original thread, but I don’t get it.
 *  Thread Starter [sconfig](https://wordpress.org/support/users/sconfig/)
 * (@sconfig)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/forcing-webm-part-2/#post-9612673)
 * I’ll try to do a re-install of WordPress to see if any plugins or themes are 
   messing with the code in my child theme.
 * In response to your PS: _I can do what I want._
 * I did however check the metrics on the viewers to my primary site. Less then 
   three percent of those users used an IE or Safari based browser combined based
   off of the Apache log files. It’s definitely a drop in the bucket to me.
 * I still provide MP4 on my primary site via hard-link. I just stripped it out 
   of the video players for any blogs containing them until I can figure out why
   my code is not being accepted. It’s not that big of a deal while it’s getting
   fixed.
 *  Thread Starter [sconfig](https://wordpress.org/support/users/sconfig/)
 * (@sconfig)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/forcing-webm-part-2/#post-9613426)
 * Just wanted to give an update.
 * I found the problem. One of my PHP scripts that mask logins was not properly 
   terminated. Although it didn’t error hard enough to whitescreen wordpress it 
   did make functions.php ignore all statements beyond that point. The video extension
   array was effected by this.
 * Issue resolved due to user error. Apologies if any time was wasted. Marking this
   as resolved. Restoring MP4 as final fallback video codec on my site.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Forcing WebM part 2’ is closed to new replies.

## Tags

 * [mp4](https://wordpress.org/support/topic-tag/mp4/)
 * [video](https://wordpress.org/support/topic-tag/video/)
 * [webm](https://wordpress.org/support/topic-tag/webm/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [sconfig](https://wordpress.org/support/users/sconfig/)
 * Last activity: [8 years, 7 months ago](https://wordpress.org/support/topic/forcing-webm-part-2/#post-9613426)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
