class UserAgent::Browsers::AppleCoreMedia

CoreMedia is a framework on iOS and is used by various iOS apps to playback media.

Public Class Methods

extend?(agent) click to toggle source
# File lib/user_agent/browsers/apple_core_media.rb, line 5
def self.extend?(agent)
  agent.detect { |useragent| useragent.product == 'AppleCoreMedia' }
end

Public Instance Methods

application() click to toggle source
# File lib/user_agent/browsers/apple_core_media.rb, line 13
def application
  self.reject { |agent| agent.comment.nil? || agent.comment.empty? }.first
end
browser() click to toggle source
# File lib/user_agent/browsers/apple_core_media.rb, line 9
def browser
  "AppleCoreMedia"
end
localization() click to toggle source
# File lib/user_agent/browsers/apple_core_media.rb, line 45
def localization
  return unless application

  application.comment[3]
end
os() click to toggle source
# File lib/user_agent/browsers/apple_core_media.rb, line 31
def os
  return unless application

  if application.comment[0] =~ /Windows NT/
    OperatingSystems.normalize_os(application.comment[0])
  elsif application.comment[2].nil?
    OperatingSystems.normalize_os(application.comment[1])
  elsif application.comment[1] =~ /Android/
    OperatingSystems.normalize_os(application.comment[1])
  else
    OperatingSystems.normalize_os(application.comment[2])
  end
end
platform() click to toggle source
# File lib/user_agent/browsers/apple_core_media.rb, line 17
def platform
  return unless application

  if application.comment[0] =~ /Windows/
    'Windows'
  else
    application.comment[0]
  end
end
security() click to toggle source
# File lib/user_agent/browsers/apple_core_media.rb, line 27
def security
  Security[application.comment[1]]
end