Home | History | Annotate | Download | only in js
      1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 function pathIsVideoFile(path) {
      6   return /\.(3gp|asf|avi|di?vx|f4v|fbr|mov|mp4|m4v|mpe?g4?|ogm|ogv|ogx|webm|wmv?|xvid)$/i.test(path);
      7 }
      8 
      9 function pathIsAudioFile(path) {
     10   return /\.(aac|aiff|atrac|cda|flac|m4a|mp3|pcm|oga|ogg|raw|wav)$/i.test(path);
     11 }
     12 
     13 function pathIsImageFile(path) {
     14   return /\.(bmp|gif|jpe?g|ico|png|webp)$/i.test(path);
     15 }
     16 
     17 function pathIsHtmlFile(path) {
     18   return /\.(htm|html|txt)$/i.test(path);
     19 }
     20 
     21 function pathIsPdfFile(path) {
     22   return /\.(pdf)$/i.test(path);
     23 }
     24