Rakuten Inc., controlled by billionaire Hiroshi Mikitani, said it has agreed to buy streaming video service provider Viki Inc. as the Internet retailer seeks to expand into new digital offerings.