all files / tests/dummy/app/controllers/ index.js

50% Statements 1/2
100% Branches 0/0
50% Functions 1/2
50% Lines 1/2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19                                   
import { inject as service } from '@ember/service';
import { on } from '@ember/object/evented';
import Controller from '@ember/controller';
 
export default Controller.extend({
  audio: service(),
 
  initAudioFile: on('init', function() {
    this.get('audio').load('Eb5.mp3').asSound('piano-note');
  }),
 
  actions: {
    playSound() {
      this.get('audio').getSound('piano-note').play();
    }
  }
});