MCPcopy
hub / github.com/NUKnightLab/TimelineJS3 / _loadMedia

Method _loadMedia

src/js/media/types/SoundCloud.js:6–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4
5export default class SoundCloud extends Media {
6 _loadMedia() {
7 var api_url,
8 self = this;
9
10 // Create Dom element
11 this._el.content_item = this.domCreate("div", "tl-media-item tl-media-iframe tl-media-soundcloud tl-media-shadow", this._el.content);
12
13 // Get Media ID
14 this.media_id = this.data.url;
15
16 // API URL
17 api_url = "https://soundcloud.com/oembed?url=" + this.media_id + "&format=js&callback=?"
18
19 // API Call
20 getJSON(api_url, function(d) {
21 loadJS("https://w.soundcloud.com/player/api.js", function() {//load soundcloud api for pausing.
22 self.createMedia(d);
23 });
24 });
25
26 }
27
28 createMedia(d) {
29 this._el.content_item.innerHTML = d.html;

Callers

nothing calls this directly

Calls 3

loadJSFunction · 0.90
domCreateMethod · 0.80
createMediaMethod · 0.45

Tested by

no test coverage detected