Some Advice on how to Play Melodies in Octaves on the Piano?

So I have started playing Mia & Sebastian’s Theme from La La Land and it seems pretty doable, the first part at least.

However, there’s a point where the melody is played in octaves. I understand the basic technique and I’ve played octaves in the left hand for years, but never in the melody. I’ve tried the most straightforward way I can think of (1 - 5) and it sounds OK but not great.

I’m wondering whether anyone has some advice on how to make those octaves ring nicely. I’ve tried using no pedal and it sounds awfully disjointed, but perhaps it’s just a matter of practicising until I can get them up to speed. With pedal, it sounds immediately nice, but of course, I must be careful not to have the harmonies bleed into each other, resulting in a pretty… mess.

Some techniques are laid out here:

There are plenty of piano technique videos on Youtube; you may just have to find someone you trust with a technique that works for you. There’s not necessarily one right way. Go with what works for your body and sounds good, and stop instantly if you experience any physical pain.

Thanks Briny_Deep, that was interesting. It has given me some good ideas on how to pratice some things, and has also confirmed that I had intuitively been doing other things correctly.

Well, that’s the problem. I never know where to start.