China said it was conducting military exercises off its coast after warning U.S. House Speaker Nancy Pelosi to scrap possible plans to visit Taiwan, which Beijing claims as part of its territory.