Media executives gathering at Allen & Co.’s conference this week in Sun Valley, Idaho, will look for opportunities to capitalize on an entertainment environment shaped by the shift toward mobile and online viewing.

Apple Inc.’s success with the iPad, iPhone and iTunes store has spawned competition from tech companies trying to catch up, from Microsoft Corp. and Google Inc. to Inc. The trick for News Corp.’s Rupert Murdoch and Hollywood studios like Walt Disney Co. is to capture new sales without destroying the traditional markets that still dominate their businesses.

“Content companies are the arms dealers in this race,” said Shahid Khan, chairman of MediaMorph Inc., a New York-based media advisory and venture firm. “They don’t care which ecosystem wins the war as long as the Amazons and Googles are buying weapons.”

The annual gathering, held at the Sun Valley Resort in the Sawtooth National Forest since 1983, provides a relaxed setting for moguls such as Murdoch, the chief executive officer of New York-based News Corp., to discuss deals and interact with tech figures, such as Facebook Inc. founder Mark Zuckerberg, whose products are shaping viewer habits.

No device maker has had a bigger impact than Apple in freeing consumers to watch movies and TV anywhere, anytime. Microsoft is mounting a challenge with the Xbox console and the Surface tablet, as is Google, with YouTube, Google TV and the market-leading Android operating system.

Owning Ecosystem

“Everything you see will be around the battle to own the ecosystem – devices, operating systems and content,” Khan said. “The only company that has that end to end is Apple.”

Tim Cook, Apple’s CEO, is scheduled to attend Sun Valley, according to a person with knowledge of his plans who declined to speak publicly. Some of media’s largest deals have been hatched or advanced at the retreat, including Comcast Corp.’s 2011 purchase of NBC Universal.

For the moment, entertainment companies have the upper hand, according to Khan. Industry leaders, including CBS Corp. CEO Leslie Moonves and Time Warner Inc.’s Jeffrey Bewkes, both on the attendee list, have used the popularity of their TV shows and films to wring licensing revenue from the technology companies.

“It’s the Apples and the Googles who are battling to get in front of the consumer,” Khan said.

Content Challenge

Apple, based in Cupertino, California, controls about 63 percent of the worldwide tablet market, researcher IDC said in June, while the iPhone held 32 percent of the U.S. smartphone market in the three months to May, trailing only Android at 51 percent, according to ComScore Inc. The company is also working on a TV set that may be unveiled this year and released in 2013, Gene Munster, a Piper Jaffray Cos. analyst, said in May.

Microsoft, based in Redmond, Washington, is stronger in the home, with more than 66 million of its Xbox video-game consoles sold worldwide and more than 40 million active Xbox Live subscribers using the device to access films, TV and other entertainment.

“Everyone’s still trying to figure out the content portion,” said Anthony LeCour, a New York-based media investment banker with Compass Advisers LLP. “A lot of the deals now are about taking that content or buying them out and layering them on to their system.”

This year’s Allen & Co. conference begins with no shortage of deals on the table.

Vivendi SA, the Paris-based owner of Universal Music Group, has put its 61 percent stake in Activision Blizzard Inc., the world’s largest video-game company, on the market, a person with knowledge of the matter said last month. Activision CEO Bobby Kotick is among those invited.

Newspaper Shopping

Publishing assets have also received attention in recent weeks as investors debate whether they can build enough digital subscriptions on devices like the iPad or Amazon’s Kindle.

News Corp.’s Murdoch heads to the conference with sons Lachlan and James two weeks after deciding to spin off his publishing division, including the Wall Street Journal — a move reflecting the low valuation investors place on the shrinking newspaper industry.

At the same time, billionaire value investor Warren Buffett, who attended last year and helped cement Disney’s purchase of Capital Cities/ABC weeks after the 1995 retreat, has been buying newspapers, betting local publications can thrive in markets where there is little competition.

“News companies are trying to work out deals that will allow them get more people to come online to their content,” LeCour said. “The New York Times is trying to do that — you’ll see more joint ventures on this front.”

Xbox Music

In a move designed to extend its hold on home entertainment, Microsoft plans to let customers of its Xbox music service stream songs and store content on company servers, people familiar with its plans said last month.

Microsoft is in talks with major record labels on the needed rights. Sony CEO Kazuo Hirai is among those invited to Sun Valley, and his music division is a potential partner.

On the mobile front, where Apple has sold more than 365 million devices using its iOS operating system, Microsoft announced in June it will make its own tablet computer this year. The company also said it plans to take a more active role in hardware makers’ designs for Windows-powered smartphones.

Google Play

Google’s Android mobile operating system has been a winner for Samsung Electronics Co., with Galaxy model phones that are selling at a rate of about 380 every minute, the Suwon, South Korea-based company said in a recent earnings report.

Google is focused on improving its marketplace for Android applications, games and entertainment, called Google Play, to make it easier to download content to its Nexus 7-inch tablet, scheduled for release this month, and other devices.

With content, Google’s efforts have gone more slowly. Consumers mostly shunned early products using the Mountain View, California-based company’s Google TV operating system because media companies blocked access to their programming. Its YouTube unit is bypassing studios and funding some original shows, as are Netflix Inc. and Yahoo! Inc.

Offering more professional videos is “what the major multimedia companies are moving towards,” LeCour said.