spec/writer_spec.rb in m3u8-0.3.2 vs spec/writer_spec.rb in m3u8-0.4.0
- old
+ new
@@ -1,11 +1,11 @@
require 'spec_helper'
describe M3u8::Writer do
it 'should render master playlist' do
options = { playlist: 'playlist_url', bitrate: 6400,
- audio: 'mp3' }
+ audio_codec: 'mp3' }
item = M3u8::PlaylistItem.new options
playlist = M3u8::Playlist.new
playlist.items.push item
output = "#EXTM3U\n" +
@@ -16,11 +16,11 @@
writer = M3u8::Writer.new io
writer.write playlist
expect(io.string).to eq output
options = { program_id: '1', playlist: 'playlist_url', bitrate: 6400,
- audio: 'mp3' }
+ audio_codec: 'mp3' }
item = M3u8::PlaylistItem.new options
playlist = M3u8::Playlist.new
playlist.items.push item
output = "#EXTM3U\n" +
@@ -32,11 +32,11 @@
writer.write playlist
expect(io.string).to eq output
options = { program_id: '2', playlist: 'playlist_url', bitrate: 50_000,
width: 1920, height: 1080, profile: 'high', level: 4.1,
- audio: 'aac-lc' }
+ audio_codec: 'aac-lc' }
item = M3u8::PlaylistItem.new options
playlist = M3u8::Playlist.new
playlist.items.push item
output = "#EXTM3U\n" \
@@ -49,16 +49,16 @@
writer.write playlist
expect(io.string).to eq output
playlist = M3u8::Playlist.new
options = { program_id: '1', playlist: 'playlist_url', bitrate: 6400,
- audio: 'mp3' }
+ audio_codec: 'mp3' }
item = M3u8::PlaylistItem.new options
playlist.items.push item
options = { program_id: '2', playlist: 'playlist_url', bitrate: 50_000,
width: 1920, height: 1080, profile: 'high', level: 4.1,
- audio: 'aac-lc' }
+ audio_codec: 'aac-lc' }
item = M3u8::PlaylistItem.new options
playlist.items.push item
output = "#EXTM3U\n" +
%(#EXT-X-STREAM-INF:PROGRAM-ID=1,CODECS="mp4a.40.34") +
@@ -108,16 +108,18 @@
io = StringIO.open
writer = M3u8::Writer.new io
writer.write playlist
expect(io.string).to eq output
- options = { version: 1, cache: false, target: 12, sequence: 1 }
+ options = { version: 1, cache: false, target: 12, sequence: 1,
+ type: 'EVENT' }
playlist = M3u8::Playlist.new options
options = { duration: 11.344644, segment: '1080-7mbps00000.ts' }
item = M3u8::SegmentItem.new options
playlist.items.push item
output = "#EXTM3U\n" \
+ "#EXT-X-PLAYLIST-TYPE:EVENT\n" \
"#EXT-X-VERSION:1\n" \
"#EXT-X-MEDIA-SEQUENCE:1\n" \
"#EXT-X-ALLOW-CACHE:NO\n" \
"#EXT-X-TARGETDURATION:12\n" \
"#EXTINF:11.344644,\n" \