Skip to content
Permalink
Browse files
feat: add ipfs fallback gateways in audio tag
  • Loading branch information
n0izn0iz committed Nov 9, 2020
1 parent f6a235e commit ded52cd2c29ba9a413027cd34b89e386b0301b70
Showing 1 changed file with 6 additions and 2 deletions.
@@ -25,12 +25,16 @@
<div class="col-md-8">
<h1>{{.Post.Post.Title}}</h1>
<p>by <a href="{{.Post.Post.Author.CanonicalURL}}"><img height="30" src="{{.Post.Post.Author.Avatar}}" />@{{.Post.Post.Author.Slug}}</a></p>

{{if .Post.Post.IsSoundCloud}}
<iframe id="soundcloud-player" width=100% height=166 scrolling=no frameborder=no allow=autoplay
src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/{{.Post.Post.SoundCloudID}}{{with .Post.Post.SoundCloudSecretToken}}%3Fsecret_token%3D{{.}}{{end}}&color=%23ff5500&auto_play=false&hide_related=true&show_comments=false&show_user=true&show_reposts=false&show_teaser=false"></iframe>
{{else}}{{if .Post.Post.IsIPFS}}
<audio controls src="/post/{{ .Post.Post.ID }}/download">
<audio controls>
<source src="/post/{{.Post.Post.ID}}/download" />
<source src="https://gateway.ipfs.io/ipfs/{{.Post.Post.IPFSCID}}" />
<source src="https://ipfs.io/ipfs/{{.Post.Post.IPFSCID}}" />
<source src="https://jorropo.ovh/ipfs/{{.Post.Post.IPFSCID}}" />
Your browser does not support the
<code>audio</code> element.
</audio>

0 comments on commit ded52cd

Please sign in to comment.