_onPlay(src) { const audio = document.createElement('audio'); audio.setAttribute('src', src); audio.play(); }
play() { this.audio.play(); this.setState({ playStatus: 'playing', }); }
componentDidUpdate() { if (this.state.isTranscribing || this.audioPlayer.played) { // can't find the way to set the scrollTop for this.textArea.current // using ReactDOM is the last option let textArea = ReactDOM.findDOMNode(this.textArea); textArea.scrollTop = textArea.scrollHeight; } }
snglClickBtn.addEventListener('click',()=>{ mainThemeAudio.play(); methodClick = "click"; method.close(); modal1.open(); });
setInterval(() => { const { duration } = this.state.track; if (audio) { const currentTime = audio.currentTime; // Calculate percent of song const percent = (currentTime / duration) * 100; updateScrubber(percent); updateTime(currentTime); } }, 150)
stop() { this.isPlaying = false if(typeof(this.audio) != 'undefined') { this.audio.pause() this.audio = undefined } }
pause() { if (this._currentSource && this._context.state === 'running') { this._context.suspend(); } if (this._audio) { this._audio.pause(); } this._log('Pause audio'); this.emit(Player.EventTypes.PAUSE); return Promise.resolve(); }
playPing() { const pingPlayer = new Audio('static/ping.mp3'); pingPlayer.play(); this.emit('ping'); }
var onEvent = function () { if (count > 0) { snd.play(); } else { snd.removeEventListener("ended", onEvent); snd = null; if (winX) { winX(); // notification.js just sends null, but this is future friendly } } count--; }
/** * Setups the player with the given buffer as source. */ setup() { this.audioPlayer.addEventListener('waiting', () => { console.log('[Audio Player] Player is waiting on data...'); this.emit('waiting'); }); this.audioPlayer.preload = 'none'; this.audioPlayer.autoplay = true; this.audioPlayer.src = URL.createObjectURL(this.mediaSource); }
pause() { this.audio.pause(); this.setState({ playStatus: 'pausing', }); }
play() { this.audio.play(); this.setState({ playStatus: 'playing', }); }
pause() { this.audio.pause(); this.setState({ playStatus: 'pausing', }); }