lib/m3u8/writer.rb in m3u8-0.6.6 vs lib/m3u8/writer.rb in m3u8-0.6.7

- old
+ new

@@ -32,13 +32,17 @@ io.puts "#EXT-X-PLAYLIST-TYPE:#{playlist.type}" unless playlist.type.nil? io.puts "#EXT-X-VERSION:#{playlist.version}" io.puts '#EXT-X-I-FRAMES-ONLY' if playlist.iframes_only io.puts "#EXT-X-MEDIA-SEQUENCE:#{playlist.sequence}" io.puts "#EXT-X-ALLOW-CACHE:#{cache(playlist)}" - io.puts "#EXT-X-TARGETDURATION:#{playlist.target}" + io.puts target_duration_format(playlist) end def cache(playlist) playlist.cache ? 'YES' : 'NO' + end + + def target_duration_format(playlist) + format('#EXT-X-TARGETDURATION:%d', playlist.target) end end end