private void InitVideo() { if (checkFileName()) { try { if (_video != null) { if (_cachedPath != _filePath) { _video.Dispose(); _video = new Video(_filePath); _cachedPath = _filePath; } } else { _video = new Video(_filePath); _cachedPath = _filePath; } _video.Owner = VideoPanel; isVideo = true; if (_audio != null) { _audio.Dispose(); _audio = null; } } catch { if (_audio != null) { if (_cachedPath != _filePath) { _audio.Dispose(); _video = new Video(_filePath); _cachedPath = _filePath; } } else { _audio = new Audio(_filePath); _cachedPath = _filePath; } isVideo = false; if (_video != null) { _video.Dispose(); _video = null; } } InitEvents(); } }
/// <summary> /// Stop music that is currently playing and dispose of the song. /// Does nothing if no music is playing. /// </summary> public void Stop() { if (isPlaying) { currentSong.Stop(); currentSong.Dispose(); currentSong = null; isPlaying = false; lastMusicPosition = 0; } }
public override void Dispose() { mAVAudio.Dispose(); }