SAN FRANCISCO, (Reuters) - A deal bringing Amazon Prime Video to Apple TV, announced on Monday at Apple Inc’s developer conference after years of talk, shows how competitive tensions among Silicon Valley titans can stand in the way of serving customers.

Tim Cook, CEO, speaks about Amazon during Apple's annual world wide developer conference (WWDC) in San Jose, California, U.S. June 5, 2017. REUTERS/Stephen Lam

The logic of linking Apple TV, a device for watching television over the internet, with Amazon.com Inc’s booming video-streaming service looks obvious.

Apple needs great video to sell its TV player. Amazon needs places to stream its TV shows so that people sign up for its Prime club to watch them - and buy more toilet paper, too. Viewers want to watch their favorite programs on whatever device they choose.

Yet Monday’s announcement, rather than being routine, was the result of a negotiation stretching back at least to 2015 when Amazon stopped selling Apple TVs on its retail site.

Amazon had explained that move by saying it wanted to avoid confusing customers who would expect Prime Video to be on devices sold by Amazon. Critics instead saw a negotiating tactic to get Prime Video onto the Apple device, and a prod for people to buy Amazon’s competing Fire TV players.

“Whenever these companies try to freeze each other out, the consumer always loses,” said Paul Verna, an analyst at research firm eMarketer.

Amazon and Apple declined to comment on how their differences have affected customers. The companies said Amazon shows will be available on Apple TV later this year, but did not specify a date.

Streaming is not the only example where a spat between Apple and Amazon limited customer choice. Amazon’s popular voice-controlled speaker, the Echo, can be told to play songs from an Amazon music account or even Spotify, but not from Apple Music.

Amazon’s Kindle app for Apple’s iPhone lets people read but not buy books, which must be purchased directly from Amazon’s website.

According to former Amazon employees, the company at times brings in tangential business concerns as leverage in negotiations.

“The outcomes of these deals may factor into future conversations,” said Scott Jacobson, a former Amazon manager and now managing director of Madrona Venture Group.

It was not clear how Amazon and Apple came to terms on the video player.

Analysts estimate that the ascendance of Prime Video gave Amazon a better starting point for negotiations. Its shows and films have started winning awards, including three Oscars in 2017. The internet video player with most market share, Roku, not only offers Prime Video but has a smaller price tag than Apple TV.

“It put Apple TV at a big disadvantage,” said Alan Wolk, lead analyst for TV industry publication TV[R]EV.

Amazon declined to comment on whether it will again sell Apple TVs.