You do not need to currently be playing a song or podcast in order to share it.

On iOS, the three dots are horizontal. On Android, they are vertical. [2] X Research source

Spotify Codes may work similarly to QR codes, but they can only be read via the Spotify app. You cannot use your camera or a QR reader to read them. [3] X Research source

If your camera is struggling to read the code, you can always screenshot the code on one device and send it to the other. When you open your camera in Spotify, you can select the screenshot from your photos.