Josephson junction of two-species Bose—Einstein condensates in a high-finesse optical cavity