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

Method createMedia

src/js/media/types/Audio.js:20–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18 }
19
20 createMedia() {
21 //Transform URL for Dropbox
22 var url = transformMediaURL(this.data.url),
23 self = this;
24
25 var self = this,
26 audio_class = "tl-media-item tl-media-audio tl-media-shadow";
27
28 this._el.content_item = this.domCreate("audio", audio_class, this._el.content);
29
30 this._el.content_item.controls = true;
31 this._el.source_item = this.domCreate("source", "", this._el.content_item);
32
33 // Media Loaded Event
34 this._el.content_item.addEventListener('load', function(e) {
35 self.onMediaLoaded();
36 });
37
38 this._el.source_item.src = url;
39 this._el.source_item.type = this._getType(this.data.url, this.data.mediatype.match_str);
40 this._el.content_item.innerHTML += "Your browser doesn't support HTML5 audio with " + this._el.source_item.type;
41 this.player_element = this._el.content_item
42 }
43
44 _updateMediaDisplay(layout) {
45 if (Browser.firefox) {

Callers 1

_loadMediaMethod · 0.95

Calls 5

_getTypeMethod · 0.95
transformMediaURLFunction · 0.90
domCreateMethod · 0.80
addEventListenerMethod · 0.80
onMediaLoadedMethod · 0.80

Tested by

no test coverage detected