private void BroadcastPosition() { var temporalInformation = _apiAdapter.GetTemporalInformation(); var message = new SocketMessage(Constants.NowPlayingPosition, temporalInformation); _hub.Publish(new PluginResponseAvailableEvent(message)); }
public void Execute(IEvent @event) { var temporalInformation = _apiAdapter.GetTemporalInformation(); var message = new SocketMessage(Constants.NowPlayingPosition, temporalInformation); _hub.Publish(new PluginResponseAvailableEvent(message, @event.ConnectionId)); }
public void Execute(IEvent receivedEvent) { if (receivedEvent == null) { throw new ArgumentNullException(nameof(receivedEvent)); } var temporalInformation = _apiAdapter.GetTemporalInformation(); var message = new SocketMessage(Constants.NowPlayingPosition, temporalInformation); _hub.Publish(new PluginResponseAvailableEvent(message, receivedEvent.ConnectionId)); }
public void Execute(IEvent @event) { var token = @event.DataToken(); if (token != null && token.Type == JTokenType.Integer) { var position = token.Value <int>(); _apiAdapter.SeekTo(position); } var message = new SocketMessage(Constants.NowPlayingPosition, _apiAdapter.GetTemporalInformation()); _hub.Publish(new PluginResponseAvailableEvent(message)); }