An extended Josephson junction consists of two superconducting electrodes that are separated by an insulator and it is therefore also a microwave cavity. The superconducting phase difference across the junction determines the supercurrent as well as its spatial distribution. Both, an external magnetic field and a resonant cavity intrafield produce a spatial modification of the superconducting phase along the junction. The interplay between these two effects leads to interference in the critical current of the junction and allows us to continuously tune the coupling strength between the first cavity mode and the Josephson phase from 1 to -0.5. This enables static and dynamic control over the junction in the ultra-strong coupling regime.