private void SongThread() { while (!exitThread) { if (!soundStream.Update()) { if (eof) { exitThread = true; } else { System.Console.WriteLine( "Stopped playing Song before EOF!" + " Hastily rebooting playback, expect jitteriness!" ); soundStream.Play(false); } } // Arbitrarily 1 frame in a 15Hz game -flibit Thread.Sleep(67); } if (PlayCount > 0) { /* If PlayCount is 0 at this point, then we were stopped by the * calling application, and this event shouldn't happen. * -flibit */ MediaPlayer.OnSongFinishedPlaying(null, null); } }
private void PlatformInitialize(string fileName) { Content.ContentManager.BlockContentLoaading = true; _audio = new HTMLAudioElement(); _audio.oncanplaythrough += (e) => Content.ContentManager.BlockContentLoaading = false; _audio.src = fileName; _audio.load(); _duration = TimeSpan.FromSeconds(_audio.duration); _audio.onended += (e) => MediaPlayer.OnSongFinishedPlaying(null, null); }
private void SongThread() { while (!exitThread) { soundStream.Update(); if (eof && soundStream.PendingBufferCount == 0) { soundStream.Stop(); exitThread = true; } // Arbitrarily 1 frame in a 15Hz game -flibit Thread.Sleep(67); } if (PlayCount > 0) { /* If PlayCount is 0 at this point, then we were stopped by the * calling application, and this event shouldn't happen. * -flibit */ MediaPlayer.OnSongFinishedPlaying(null, null); } }
internal void OnFinishedPlaying() { MediaPlayer.OnSongFinishedPlaying(null, null); }