Пример #1
0
        private void send_command(PlaystateCommand type, string ContentId, Guid?userId)
        {
            PlaystateRequest command = new PlaystateRequest
            {
                Command           = type,
                ControllingUserId = userId.HasValue ? userId.Value.ToString("N") : null
            };

            _sessionManager.SendPlaystateCommand(ContentId, ContentId, command, CancellationToken.None);
        }
Пример #2
0
        public ActionResult SendPlaystateCommand(
            [FromRoute, Required] string sessionId,
            [FromRoute, Required] PlaystateCommand command,
            [FromQuery] long?seekPositionTicks,
            [FromQuery] string?controllingUserId)
        {
            _sessionManager.SendPlaystateCommand(
                RequestHelpers.GetSession(_sessionManager, _authContext, Request).Id,
                sessionId,
                new PlaystateRequest()
            {
                Command           = command,
                ControllingUserId = controllingUserId,
                SeekPositionTicks = seekPositionTicks,
            },
                CancellationToken.None);

            return(NoContent());
        }
Пример #3
0
        public async Task <ActionResult> SendPlaystateCommand(
            [FromRoute, Required] string sessionId,
            [FromRoute, Required] PlaystateCommand command,
            [FromQuery] long?seekPositionTicks,
            [FromQuery] string?controllingUserId)
        {
            await _sessionManager.SendPlaystateCommand(
                await RequestHelpers.GetSessionId(_sessionManager, _authContext, Request).ConfigureAwait(false),
                sessionId,
                new PlaystateRequest()
            {
                Command           = command,
                ControllingUserId = controllingUserId,
                SeekPositionTicks = seekPositionTicks,
            },
                CancellationToken.None)
            .ConfigureAwait(false);

            return(NoContent());
        }