Sha256: 51e7deca9829d65b7e20b58786850f43c6281ee0d35849e7e702771a40159083

Contents?: true

Size: 1.6 KB

Versions: 1

Compression:

Stored size: 1.6 KB

Contents

require "mime_type_list/version"

module MimeTypeList
  class VideoMimeTypes
    class << self

      def extensions_for(mime_type)
        mime_types = MIME::Types.type_for(mime_type)
        mime_types.map {|t| t.extensions }.flatten
      end

      def all_extensions
        all_mime_types.inject([]) do |array, mime_type_name|
          array << extensions_for(mime_type_name)
          array
        end.flatten.sort
      end

      def all_mime_types
        %W{
          application/annodex 
          application/mp4 
          application/ogg 
          application/vnd.rn-realmedia 
          application/x-matroska 
          video/3gpp 
          video/3gpp2 
          video/annodex 
          video/divx 
          video/flv 
          video/h264 
          video/mp4 
          video/mp4v-es 
          video/mpeg 
          video/mpeg-2 
          video/mpeg4 
          video/ogg 
          video/ogm 
          video/quicktime 
          video/ty 
          video/vdo 
          video/vivo 
          video/vnd.rn-realvideo 
          video/vnd.vivo 
          video/webm 
          video/x-bin 
          video/x-cdg 
          video/x-divx 
          video/x-dv 
          video/x-flv 
          video/x-la-asf 
          video/x-m4v 
          video/x-matroska 
          video/x-motion-jpeg 
          video/x-ms-asf 
          video/x-ms-dvr 
          video/x-ms-wm 
          video/x-ms-wmv 
          video/x-msvideo 
          video/x-sgi-movie 
          video/x-tivo 
          video/avi 
          video/x-ms-asx 
          video/x-ms-wvx 
          video/x-ms-wmx
        }
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mime_type_list-0.0.5 lib/mime_type_list.rb