Skip to content

Commit

Permalink
Merge pull request #740 from sul-dlss/m4a_audio
Browse files Browse the repository at this point in the history
Add m4a extension.
  • Loading branch information
jmartin-sul authored Mar 24, 2017
2 parents ad9e69f + 0fb2a37 commit b6f3fd9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
8 changes: 8 additions & 0 deletions config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,11 @@ stream:
- mpeg
audio:
- mp3
- m4a
# Mapping from file extensions to Wowza streaming prefixes
streaming_prefix:
mov: 'mp4'
mp4: 'mp4'
mpeg: 'mp4'
m4a: 'mp4'
mp3: 'mp3'
6 changes: 1 addition & 5 deletions lib/embed/stacks_media_stream.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,7 @@ def streaming_url_delimiter(type)
end

def streaming_file_prefix
if video?
'mp4'
elsif audio?
'mp3'
end
Settings.streaming_prefix[file_extension]
end

def video?
Expand Down
4 changes: 4 additions & 0 deletions spec/lib/embed/stacks_media_stream_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
sms = described_class.new(druid: 'ab012cd3456', file_name: 'def.mp3')
expect(sms.to_manifest_url).to eq "https://#{streaming_base_url}/ab/012/cd/3456/mp3:def.mp3/manifest.mpd"
end
it 'audio - m4a' do
sms = described_class.new(druid: 'ab012cd3456', file_name: 'def.m4a')
expect(sms.to_manifest_url).to eq "https://#{streaming_base_url}/ab/012/cd/3456/mp4:def.m4a/manifest.mpd"
end
it 'unknown' do
sms = described_class.new(druid: 'ab012cd3456', file_name: 'def.xxx')
expect(sms.to_manifest_url).to be_nil
Expand Down

0 comments on commit b6f3fd9

Please sign in to comment.