├── .gitignore ├── README.md ├── bower.json ├── dist ├── plangular.js └── plangular.min.js ├── docs ├── build.js ├── examples │ ├── artwork.html │ ├── basic.html │ ├── compact-progress.html │ ├── compact.html │ ├── custom-image.html │ ├── inline-progress.html │ ├── likes.html │ ├── playlist.html │ ├── progress.html │ ├── unstyled.html │ ├── user.html │ └── waveform.html └── template.html ├── index.html ├── package.json ├── scripts └── bump.js ├── src └── plangular.js └── test └── test.js /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | node_modules 3 | config.json 4 | 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | :warning: **This repo is no longer being maintained** 3 | 4 | For creating custom SoundCloud players, I highly recommend [react-soundplayer](https://github.com/soundblogs/react-soundplayer) or for a more general solution, see [plyr](https://github.com/Selz/plyr). 5 | 6 | 13 | 14 | ## Getting Started 15 | 16 | ```bash 17 | npm install plangular-3 18 | ``` 19 | 20 | Or install with Bower: 21 | 22 | ```bash 23 | bower install plangular 24 | ``` 25 | 26 | Or use the CDN: 27 | 28 | ```html 29 | 30 | ``` 31 | 32 | ## Angular app 33 | 34 | Include a link to plangular after including Angular. 35 | 36 | ```js 37 | 38 | 39 | ``` 40 | 41 | ## Initialize the app 42 | 43 | Configure Plangular with your own `client_id`. 44 | For new SoundCloud apps, you can register at https://developers.soundcloud.com/ 45 | 46 | ```html 47 | 48 | 49 | 55 | 56 | ``` 57 | 58 | ## Create a plangular directive instance 59 | 60 | ```html 61 |
62 |
63 | ``` 64 | 65 | ## Include track info 66 | 67 | ```html 68 |
69 |

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

70 | View on SoundCloud 71 |
72 | ``` 73 | 74 | ## Add player controls 75 | 76 | ```html 77 | 78 | ``` 79 | 80 | Or with separate play/pause controls: 81 | 82 | ```html 83 | 84 | 85 | ``` 86 | 87 | ## Show current time and duration 88 | 89 | Use the `hhmmss` filter to format seconds as `hh:mm:ss` strings. 90 | 91 | ```html 92 | {{ currentTime | hhmmss }} | {{ duration | hhmmss }} 93 | ``` 94 | 95 | ## Progress bar 96 | 97 | ```html 98 | 99 | {{ currentTime / duration || 0 }} 100 | 101 | ``` 102 | 103 | ## Add scrubber functionality 104 | 105 | ```html 106 | 109 | {{ currentTime / duration }} 110 | 111 | ``` 112 | 113 | ## Add images 114 | 115 | ```html 116 | {{ track.title }} 117 | waveform 118 | ``` 119 | 120 | 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`. 121 | 122 | ## Loading states 123 | 124 | Use the `ng-if` directive to show and hide content based on whether the track has loaded. 125 | 126 | ```html 127 |
128 |
129 | ``` 130 | 131 | ## Playlists 132 | 133 | 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`. 134 | 135 | ```html 136 | 145 | ``` 146 | 147 | ## User tracks 148 | 149 | To load the most recent tracks from a given user, use the tracks endpoint. Use `ng-repeat` to iterate over the `tracks` array. 150 | 151 | ```html 152 |
153 |
154 | ``` 155 | 156 | ## User likes 157 | 158 | To load the most recent likes from a given user, use the likes endpoint. 159 | 160 | ```html 161 |
162 |
163 | ``` 164 | 165 | ## Previous/next controls 166 | 167 | To skip to the next and previous track in a playlist or array of tracks, use the `previous()` and `next()` methods. 168 | 169 | ```html 170 | 171 | 172 | ``` 173 | 174 | 175 | ## Example templates 176 | See more examples and starter templates in 177 | [docs/examples](docs/examples) 178 | 179 | --- 180 | 181 | ## API 182 | 183 | ### `track` 184 | Object returned from the SoundCloud API 185 | 186 | ### `tracks` 187 | An array of track objects if the instance is a playlist or list of tracks 188 | 189 | ### `player` 190 | Audio player object 191 | 192 | ### `audio` 193 | The HTML5 `