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

Method fun

app/views/admin/CodePlaybackView.js:133–156  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

131 }
132
133 fun () {
134 if ((this.spade.speed === 8) && this.spade.playback) {
135 if (utils.isCodeCombat) {
136 me.set('music', true)
137 me.set('volume', 1)
138 if (!this.musicPlayer) {
139 const musicFile = 'https://archive.org/download/BennyHillYaketySax/MusicaDeCirco-BennyHill.mp3'
140 this.musicPlayer = new MusicPlayer()
141 return Backbone.Mediator.publish('music-player:play-music', { play: true, file: musicFile })
142 }
143 } else {
144 return store.dispatch('audio/playSound', {
145 track: 'background',
146 loop: true,
147 src: 'https://archive.org/download/BennyHillYaketySax/MusicaDeCirco-BennyHill.mp3'
148 })
149 }
150 } else if (utils.isCodeCombat) {
151 if (this.musicPlayer != null) {
152 this.musicPlayer.destroy()
153 }
154 return this.musicPlayer = undefined
155 }
156 }
157
158 onSpeedButtonClicked (e) {
159 this.spade.speed = $(e.target).data('speed')

Callers 4

updateSliderMethod · 0.95
onPlayClickedMethod · 0.95
onSpeedButtonClickedMethod · 0.95
onPauseClickedMethod · 0.95

Calls 3

publishMethod · 0.80
setMethod · 0.45
destroyMethod · 0.45

Tested by

no test coverage detected