Method: Livelist::HLS.current_time

Defined in:
lib/livelist/hls/hls.rb

.current_time(playlist, seconds = 2) ⇒ Object



6
7
8
9
10
11
# File 'lib/livelist/hls/hls.rb', line 6

def self.current_time(playlist, seconds = 2)
  lines = File
          .readlines(playlist)
          .select { |line| line =~ /EXTINF:[0-9]/ }
  lines.length * seconds
end