Priming itself for the age of Internet-delivered video, AT&T Inc. said it would buy DirecTV for $48.5 billion in cash and stock, or $95 per share.

While DirecTV doesn’t help the telecom company compete in the online video space immediately, cost savings from the merger and the extra cash flow will improve its ability to compete with the cable giant that would be formed by Comcast Corp.’s proposed $45 billion takeover of Time Warner Cable.