soundcloud.pug
– Soundcloud podcasts players ¶
View source code on GithubEmbed Soundcloud user¶
mixin soundcloud-user(id)
- if ("alt" in attributes)
- alt = attributes.alt;
- delete attributes.alt;
- else
- alt = true;
- if ("color" in attributes)
- color = attributes.color;
- delete attributes.color;
- else
- color = "ff8800";
- if ("auto_play" in attributes)
- auto_play = attributes.auto_play;
- delete attributes.auto_play;
- else
- auto_play = false;
- if ("hide_related" in attributes)
- hide_related = attributes.hide_related;
- delete attributes.hide_related;
- else
- hide_related = false;
- if ("show_comments" in attributes)
- show_comments = attributes.show_comments;
- delete attributes.show_comments;
- else
- show_comments = true;
- if ("show_user" in attributes)
- show_user = attributes.show_user;
- delete attributes.show_user;
- else
- show_user = true;
- if ("show_reposts" in attributes)
- show_reposts = attributes.show_reposts;
- delete attributes.show_reposts;
- else
- show_reposts = false;
- if ("show_teaser" in attributes)
- show_teaser = attributes.show_teaser;
- delete attributes.show_teaser;
- else
- show_teaser = true;
iframe(src=`https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/users/${id}&color=%23${color}&auto_play=${auto_play}&hide_related=${hide_related}&show_comments=${show_comments}&show_user=${show_user}&show_reposts=${show_reposts}&show_teaser=${show_teaser}`
width="100%"
height="300"
scrolling="no"
frameborder="no"
allow="autoplay")&attributes(attributes)
- if (alt)
| Your browser does not support iframes.
-
+soundcloud-user
(id)(color="ff8800", auto_play=false, hide_related=false, show_comments=true, show_user=true, show_reposts=false, show_teaser=true, width="100%", height="300")¶ Arguments: - id (string) – Soundcloud user identificator. You can get it from an user Soundcloud page url.
- color (string) – Player color passed as HEX color withour
#
character. - autoplay (bool) – Play tracklist when content is loaded. As default
false
. - hide_related (bool) – Hide related content if
true
. As defaultfalse
. - show_comments (bool) – Show user comments on displayed tracks. As default
true
. - show_user – Show uploader name. As default
true
. - show_reposts (bool) – Show reposts. As default
false
. - show_teaser (bool) – Show teaser. As default
true
.
Usage¶
Input
+soundcloud-user("alvaromondejar")(show_comments=false)
Output
<iframe src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/users/alvaromondejar&color=%23ff8800&auto_play=false&hide_related=false&show_comments=false&show_user=true&show_reposts=false&show_teaser=true" width="100%" height="300" scrolling="no" frameborder="no" allow="autoplay"></iframe>
Render