Measurement of bound states in the continuum by a detector embedded in a photonic crysta