()
| 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 |
nothing calls this directly
no outgoing calls
no test coverage detected