File: libavformat.rb

package info (click to toggle)
ruby-useragent 0.16.8-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 368 kB
  • sloc: ruby: 4,824; makefile: 2
file content (32 lines) | stat: -rw-r--r-- 876 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
class UserAgent
  module Browsers
    # The user agent utilized by ffmpeg or other projects utilizing libavformat
    class Libavformat < Base
      def self.extend?(agent)
        agent.detect do |useragent|
          useragent.product == "Lavf" || (useragent.product == "NSPlayer" && agent.version == "4.1.0.3856")
        end
      end

      # @return ["libavformat"] To make it easy to pick it out, all of the UAs that Lavf uses have this browser.
      def browser
        "libavformat"
      end

      # @return [nil, Version] If the product is NSPlayer, we don't have a version
      def version
        super unless detect_product("NSPlayer")
      end

      # @return [nil] Lavf doesn't return us anything here
      def os
        nil
      end

      # @return [nil] Lavf doesn't return us anything here
      def platform
        nil
      end
    end
  end
end