/// <summary> /// Sets the playback speed ratio. /// This command is a queued command /// </summary> /// <param name="targetSpeedRatio">The target speed ratio.</param> public void SetSpeedRatio(double targetSpeedRatio) { SpeedRatioCommand command = null; lock (SyncLock) { command = Commands.LastOrDefault(c => c.CommandType == MediaCommandType.SetSpeedRatio) as SpeedRatioCommand; if (command == null) { command = new SpeedRatioCommand(this, targetSpeedRatio); EnqueueCommand(command); } else { command.SpeedRatio = targetSpeedRatio; } } }
/// <summary> /// Sets the playback speed ratio. /// </summary> /// <param name="targetSpeedRatio">The target speed ratio.</param> /// <returns></returns> public async Task SetSpeedRatio(double targetSpeedRatio) { SpeedRatioCommand command = null; lock (SyncLock) { command = Commands.FirstOrDefault(c => c.CommandType == MediaCommandType.SetSpeedRatio) as SpeedRatioCommand; if (command == null) { command = new SpeedRatioCommand(this, targetSpeedRatio); Commands.Add(command); } else { command.SpeedRatio = targetSpeedRatio; } } await command.Promise; }