MCPcopy Create free account
hub / github.com/codecombat/codecombat / playFile

Method playFile

app/core/treema-ext.js:303–321  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

301 }
302
303 playFile () {
304 this.src = `/file/${this.getData()}`
305
306 if (this.instance) {
307 return this.instance.play()
308 } else {
309 createjs.Sound.alternateExtensions = ['mp3', 'ogg']
310 const registered = createjs.Sound.registerSound(this.src)
311 if (registered === true) {
312 return this.instance = createjs.Sound.play(this.src)
313 } else {
314 var f = event => {
315 if (event.src === this.src) { this.instance = createjs.Sound.play(event.src) }
316 return createjs.Sound.removeEventListener('fileload', f)
317 }
318 return createjs.Sound.addEventListener('fileload', f)
319 }
320 }
321 }
322
323 stopFile () { return (this.instance != null ? this.instance.stop() : undefined) }
324

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected