Let $G$ be the group of norm one elements in $D^{\times}$. An easy argument
shows that it suffices to prove the claim for $G$ in place of $D^{\times}$.
In other words, I will let $\pi$ be an automorphic rep. of $G$.
Now suppose that $\pi_{\infty}$
is one-dimensional. This means that in fact $\pi_{\infty}$ is trivial (because $G(\mathbb Q_v)
= SL_2(\mathbb R)$ has no non-trivial characters).
Now we use the fact that the automorphic representation lives inside the space of automorphic forms
on $G(\mathbb Q)\backslash G(\mathbb A).$ Thus $\pi$ is a space
of functions $f(g)$ on $G(\mathbb A)$ such that $f(\gamma g u) = f(g)$ for any
$\gamma \in G(\mathbb Q)$ and $u \in U$, a compact open subgroup of $G(\mathbb A^{\infty})$
(with $U$ depending on $f$).
Our assumption on $\pi$ shows that furthermore $g_{\infty}f = f$ for all $g_{\infty} \in G(\mathbb R)$.
Thus if $\gamma \in G(\mathbb Q)$, $g \in G(\mathbb A)$,
$g_{\infty} \in G(\mathbb R)$, and $u \in U$, then
$$f(\gamma g ug_{\infty}) = (g_{\infty} f)(\gamma g u) = f(\gamma g u)
= f(g).$$
Now strong approximation says that the double coset space
$G(\mathbb Q)\backslash G(\mathbb A)/ U G(\mathbb R)$ is a point,
and combined with the above calculation, this shows that $f$ is constant, and
thus generates the trivial representation under the action
of $G(\mathbb A)$.
Since $f$ was an arbitrary element of $\pi,$ we see that $\pi$ is trivial,
i.e. that all $\pi_v$ are one-dimesional.
Note that it is important here that $\pi$ was a subspace of automorphic forms,
and not just a subquotient. This is automatic when $D$ is a (non-trivial)
quaternion algebra, because then $G$ is anisotropic, hence all automorphic forms
are automatically $L^2$, and so the space of automorphic forms is semi-simple.
On the other hand, if we consider $GL_2$, then while the above proof goes
through for cuspidal representations (which are necessarily subreps., and not
just subquotients, of automorphic forms), one can find (non-cuspidal) automorphic reps.
of $GL_2$ which are trivial at $\infty$ but infinite-dimensional at the other places.
(Of course, these are then subquotients of automorphic forms which can't be split off
as subrepresentations.)