Closed seocahill closed 3 years ago
@dazpatreg féach ar no dhá blobanna os cionn ^.
An rud is tabhachtach ná an 'content_type'. Ar thaobh firefox de is é 'audio/ogg', i gchrome is é `"video/webm".
Mar gheall are sin tá an taistáil sin ag theipeadh i mo gcódsa (dictionary_entry.media.audio?
)
<% if dictionary_entry.media.attached? && dictionary_entry.media.audio? %>
<td><%= tag :audio, src: url_for(dictionary_entry.media), controls: true %></td>
<% end %>
... mar is 'video' iad fileanna le content-type 'webmd', ní 'audio'
Muise, tá gach rud ag obair seachas (i.e. tá na taifeadaí sábháilte go léir) an html 'rendering'.
Ba chor don réitigh an-shimplí:
<% if dictionary_entry.media.attached? && (dictionary_entry.media.audio? || dictionary_entry.media.video?) %>
....etc
An brí ar an cód sin is ea "' 'spáin dom an file má tá video no audio type i gceist"