Skip to content
This repository has been archived by the owner on Nov 11, 2024. It is now read-only.

Commit

Permalink
Support for WAV audio files (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
just-nico authored Jun 26, 2024
1 parent 54fa43f commit ba5ea9e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
attachinary (1.3.4)
attachinary (1.3.5)
cloudinary (~> 1.1.0)
rails (>= 3.2)

Expand Down
2 changes: 1 addition & 1 deletion lib/assets/javascripts/attachinary.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<li>
<% if(files[i].resource_type == "raw") { %>
<div class="raw-file"></div>
<% } else if (["mp3", "m4a"].indexOf(files[i].format) > -1) { %>
<% } else if (["mp3", "m4a", "wav"].indexOf(files[i].format) > -1) { %>
<audio src="<%= $.cloudinary.url(files[i].public_id, { "version": files[i].version, "resource_type": 'video', "format": files[i].format }) %>"
controls preload="<%= options.preload %>" class="<%= options.class %>"/>
<% } else { %>
Expand Down
2 changes: 1 addition & 1 deletion lib/attachinary/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Attachinary
VERSION = "1.3.4"
VERSION = "1.3.5"
end
2 changes: 1 addition & 1 deletion lib/attachinary/view_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def attachinary_file_field_options(model, relation, options={})

if !options[:html][:accept] && accepted_types = options[:attachinary][:accept]
accept = accepted_types.map do |type|
if ["m4a", "mp3"].include?(type.to_s)
if ["m4a", "mp3", "wav"].include?(type.to_s)
[MIME::Type.new("audio/*"), ".#{type}"]
else
[MIME::Types.type_for(type.to_s)[0], ".#{type}"]
Expand Down

0 comments on commit ba5ea9e

Please sign in to comment.