ucsdlib/damspas

View on GitHub
app/views/dams_objects/_audio_viewer.html.erb

Summary

Maintainability
Test Coverage
<%
   prefix = (defined?(componentIndex)) ? "component_#{componentIndex}_" : ''
   objid = @document['id']
   cmpid = (defined?(componentIndex)) ? "#{componentIndex}" : '0'
   fieldData = @document["#{prefix}files_tesim"]
   wowzaURL = secure_token_base_url(fieldData, objid, cmpid, Rails.configuration.secure_token_audio_baseurl)
   secure_token = secure_token(fieldData, objid, cmpid, Rails.configuration.secure_token_audio_baseurl)
%>
<% if wowzaURL != nil %>

  <div id="dams-audio">Loading the player...</div>

  <script type="text/javascript">
      jwplayer("dams-audio").setup({
          playlist:
                  [{
                      sources:
                              [
                                  {file: "https://<%=wowzaURL%>/playlist.m3u8?<%=secure_token%>"}
                              ]
                  }],
          width: "100%",
          height: 60,
          rtmp: {bufferlength: 3},
          analytics: {enabled: false}
      });
  </script>

<% end %>
<%= render :partial => 'admin_download', :locals => {:downloadFilePath => downloadFilePath, :downloadDerivativePath => downloadDerivativePath  } %>