app/models/attachment.rb
def web_video?
    %w(mp4 ogg webm).each do |sub_type|
      return true if Rack::Mime.match?(mime_type, "video/#{sub_type}")
    end

    false
  end
# Returns whether this is a standard web video.
#
# Incorporates a set of formats that cover all popular mobile and desktop
# browsers. However, not all formats will play on all browsers. Furthermore,
# care must be taken to ensure the correct profile, even within a format!
#
# For detailed browser coverage strategy, see:
# http://blog.zencoder.com/2013/09/13/what-formats-do-i-need-for-html5-video
#
# @return [true, false]
Returns whether this is a standard web video.
Incorporates a set of formats that cover all popular mobile and desktop
browsers. However, not all formats will play on all browsers. Furthermore,
care must be taken to ensure the correct profile, even within a format!


Returns whether this is a standard web video . Incorporates a set of formats that cover all popular mobile and desktop browsers . However not all formats will play on all browsers . Furthermore care must be taken to ensure the correct profile even within a format!
def web_video?
    %w(mp4 ogg webm).each do |sub_type|
      return true if Rack::Mime.match?(mime_type, "video/#{sub_type}")
    end
    false
  end
def web_video? %w( mp4 ogg webm ) . each do | sub_type | return true if Rack :: Mime . match? ( mime_type , "video/#{sub_type}" ) end false end
Returns whether this is a standard web video.
Returns whether this is a standard web video .
None
true, false