2. Given that the three sides $a, b, c$ of $\triangle A B C$ form a geometric sequence, and the angles opposite to sides $a, b, c$ are $\angle A, \angle B, \angle C$ respectively, and $\sin A \cdot \sin B+\sin B \cdot \sin C+\cos 2 B=1$. Then $\angle B$ is $(\quad)$.
(A) $\frac{\pi}{4}$
(B) $\frac{\pi}{3}$
(C) $\frac{\pi}{2}$
(D) $\frac{2 \pi}{3}$
2. B.

Given that $a, b, c$ form a geometric sequence, we know $b^{2}=a c$.
From the given equation,
$$
\begin{array}{l}
\sin A \cdot \sin B+\sin B \cdot \sin C+1-2 \sin ^{2} B=1 . \\
\text { Since } \sin B \neq 0, \text { we have } \\
\sin A+\sin C=2 \sin B \Rightarrow a+c=2 b . \\
\text { By } \cos B=\frac{a^{2}+c^{2}-b^{2}}{2 a c} \\
=\frac{(a+c)^{2}-2 a c-b^{2}}{2 a c}=\frac{1}{2} \\
\Rightarrow \angle B=\frac{\pi}{3} .
\end{array}
$$