Angular directive for custom SoundCloud players · v3.1.0



{{track.user.username}} - {{track.title}}

{{ currentTime | hhmmss }} / {{ duration | hhmmss }}



{{ currentTime / duration }}


{{ currentTime | hhmmss }} / {{ duration | hhmmss }}


{{ currentTime / duration }}


{{ currentTime | hhmmss }} / {{ duration | hhmmss }}
{{ currentTime / duration }}

Jxnblk’s Likes

{{ currentTime | hhmmss }} / {{ duration | hhmmss }}
{{ currentTime / duration }}

Getting Started

npm install plangular-3

Or install with Bower:

bower install plangular

Or use the CDN:

<script src=""></script>

Angular app

Include a link to plangular after including Angular.

<script src="//"></script>
<script src="bower_components/plangular/dist/plangular.min.js"></script>

Initialize the app

Configure Plangular with your own client_id. For new SoundCloud apps, you can register at

<body ng-app="app">

    var app = angular.module('app', ['plangular'])
        plangularConfigProvider.clientId = '[YOUR-CLIENT-ID]';

Create a plangular directive instance

<div plangular="">

Include track info

<div plangular="">
  <h3>{{track.user.username}} - {{track.title}}</h3>
  <a ng-href="{{track.permalink_url}}">View on SoundCloud</a>

Add player controls

<button ng-click="playPause()">Play/Pause</button>

Or with separate play/pause controls:

<button ng-click="play()">Play</button>
<button ng-click="pause()">Pause</button>

Show current time and duration

Use the hhmmss filter to format seconds as hh:mm:ss strings.

<small>{{ currentTime | hhmmss }} | {{ duration | hhmmss }}</small>

Progress bar

<progress ng-value="currentTime / duration || 0">
  {{ currentTime / duration || 0 }}

Add scrubber functionality

  ng-value="currentTime / duration">
  {{ currentTime / duration }}

Add images

<img ng-src="{{ track.artwork_url  }}" alt="{{ track.title }}" />
<img ng-src="{{ track.waveform_url }}" alt="waveform" />

Note: The waveform image that the SoundCloud API provides is a 1200 x 280px PNG with a light gray frame and transparent middle. To show progress use absolute positioning with the waveform in front. The light gray color is #efefef.

Loading states

Use the ng-if directive to show and hide content based on whether the track has loaded.

<div ng-if="!track"><!-- Loading state --></div>
<div ng-if="track"><!-- Player --></div>


Use the tracks array and ng-repeat when using a SoundCloud playlist. Pass the $index to the playPause() method to trigger playback on a per-track basis. Determine which track is currently playing with player.playing === track.src.

  <li ng-repeat="track in tracks">
      ng-class="{'active': player.playing === track.src}">
      {{track.user.username}} - {{track.title}}

User tracks

To load the most recent tracks from a given user, use the tracks endpoint. Use ng-repeat to iterate over the tracks array.

<div plangular="">

User likes

To load the most recent likes from a given user, use the likes endpoint.

<div plangular="">

Previous/next controls

To skip to the next and previous track in a playlist or array of tracks, use the previous() and next() methods.

<button ng-click="previous()">Previous</button>
<button ng-click="next()">Next</button>

Example templates

See more examples and starter templates in docs/examples



Object returned from the SoundCloud API


An array of track objects if the instance is a playlist or list of tracks


Audio player object


The HTML5 <audio> element used by the player, exposed for access to media events.


Angular-friendly currentTime from the audio element


Angular-friendly duration from the audio element. Note: you can also access duration in milliseconds from the SoundCloud track object.


Currently playing track index in a playlist or other array of tracks.


Cloned object of track if track.tracks exists. This is useful for displaying the title of the playlist.


Plays the track. Optionally pass an index when handling playlists.


Pauses the player.


Toggles playback. Optionally pass an index when handling playlists.


Skip to previous track when handling playlists


Skip to next track when handling playlists


Sets the audio element’s currentTime property based on a pointer event.

Using the SoundCloud API

Track object

For more details on the SoundCloud track object, see


According to the SoundCloud API terms you must:

Read more here:


SoundCloud provides an option for users to prevent streaming to third-party apps. If your sound isn't playing check the track.streamable variable. If it's set to false, there is no way to play that sound with the API.

More Examples

{{track.user.username}} - {{track.title}}
{{ currentTime / duration }}
{{track.user.username}} - {{track.title}}
{{ currentTime / duration }}
{{track.title}} artwork



{{ currentTime / duration }}
{{track.title}} waveform





{{ currentTime / duration }}
{{track.title}} artwork



{{ currentTime / duration }}