public async Task CmdLibVLCSharpPlayerPlay() { try { if (_libVLCSharpPlayer.MediaPlayerStatus() == VLCState.Playing) { _irc.SendPublicChatMessage($"This media player is already {await _libVLCSharpPlayer.GetVideoTime()} @{_botConfig.Broadcaster}"); return; } await _libVLCSharpPlayer.Play(); PlaylistItem playlistItem = _libVLCSharpPlayer.CurrentSongRequestPlaylistItem; string songRequest = _youTubeClientInstance.ShowPlayingSongRequest(playlistItem); if (!string.IsNullOrEmpty(songRequest)) { _irc.SendPublicChatMessage($"@{_botConfig.Broadcaster} <-- Now playing: {songRequest} Currently {await _libVLCSharpPlayer.GetVideoTime()}"); } else { _irc.SendPublicChatMessage($"Unable to display the current song @{_botConfig.Broadcaster}"); } } catch (Exception ex) { await _errHndlrInstance.LogError(ex, "CmdBrdCstr", "CmdLibVLCSharpPlayerPlay()", false, "!srplay"); } }
private async Task <DateTime> PauseAsync() { try { if (_libVLCSharpPlayer.MediaPlayerStatus() == VLCState.Paused && _libVLCSharpPlayer.MediaPlayerStatus() == VLCState.Stopped) { _irc.SendPublicChatMessage($"This media player is already {await _libVLCSharpPlayer.GetVideoTimeAsync()} @{_botConfig.Broadcaster}"); return(DateTime.Now); } _libVLCSharpPlayer.Pause(); _irc.SendPublicChatMessage($"Paused current song request @{_botConfig.Broadcaster}"); } catch (Exception ex) { await _errHndlrInstance.LogError(ex, "LibVLCSharpPlayerFeature", "Pause()", false, "!srpause"); } return(DateTime.Now); }