diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-03-28 15:58:18 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-03-28 15:58:18 -0400 |
| commit | 57623886b25cd2104f326d5974ff8375ba4964f6 (patch) | |
| tree | 12bfd28418705126bbdc045fc1707c2d80c86740 /MediaBrowser.Server.Implementations | |
| parent | 1dafb46b71aef08e45f265e6c1070d0a9270a78f (diff) | |
added generic remote control commands
Diffstat (limited to 'MediaBrowser.Server.Implementations')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Roku/RokuSessionController.cs | 11 | ||||
| -rw-r--r-- | MediaBrowser.Server.Implementations/Session/WebSocketController.cs | 12 |
2 files changed, 23 insertions, 0 deletions
diff --git a/MediaBrowser.Server.Implementations/Roku/RokuSessionController.cs b/MediaBrowser.Server.Implementations/Roku/RokuSessionController.cs index 0e2f9e1b5..d806db1e0 100644 --- a/MediaBrowser.Server.Implementations/Roku/RokuSessionController.cs +++ b/MediaBrowser.Server.Implementations/Roku/RokuSessionController.cs @@ -146,5 +146,16 @@ namespace MediaBrowser.Server.Implementations.Roku RequestContentType = "application/json" }); } + + + public Task SendGenericCommand(GenericCommand command, CancellationToken cancellationToken) + { + return SendCommand(new WebSocketMessage<GenericCommand> + { + MessageType = "Command", + Data = command + + }, cancellationToken); + } } } diff --git a/MediaBrowser.Server.Implementations/Session/WebSocketController.cs b/MediaBrowser.Server.Implementations/Session/WebSocketController.cs index 70d7ac071..ddf4ec2ca 100644 --- a/MediaBrowser.Server.Implementations/Session/WebSocketController.cs +++ b/MediaBrowser.Server.Implementations/Session/WebSocketController.cs @@ -198,5 +198,17 @@ namespace MediaBrowser.Server.Implementations.Session }, cancellationToken); } + + public Task SendGenericCommand(GenericCommand command, CancellationToken cancellationToken) + { + var socket = GetActiveSocket(); + + return socket.SendAsync(new WebSocketMessage<GenericCommand> + { + MessageType = "Command", + Data = command + + }, cancellationToken); + } } } |
