Depending on the compiling options, Flash plugin and Firefox don't always use the same sound architecture. Due to some limitations related to the "linux" origin of flash plugin, flash plugin is unable to use the sound server pulseaudio as it passes audio only through the ALSA sound architecture and you can't reroute dynamically the audio flux.
In any case you can change the default rendering sound device through terminal, and just restart Firefox after.
To list the sound devices available on your system
cat /dev/sndstat
To show the current settings :
sysctl hw.snd.defaut_unit
So set to another sound device, for example 1
sysctl hw.snd.default_unit=1
When you use HTML5 firefox can use the pulseaudio sound server BUT you must use a custom compiling configuration by activating the pulseaudio option.
Recompile firefox accordingly. As a consequence this will install the dependency
audio/pulseaudio if not already installed and adding
audio/pavucontrol will provide you with a GUI to dynamically reroute the sound flux.
(I think gstreamer, libcanberra are also mandatory dependencies)
Run a youtube video.
Run Pavucontrol and you will see a "cubeutils virtual sound stream" attached to Firefox moving, just clic on the "DSPx" box to switch dynamically to another "DSP" rendering device.