safari close tab when youtube playing full screen

The command+w option is not available in this environment, so I tried two actions of Esc, then command+w without success. The Esc closes the full screen, but the Command+w does not appear to get done though the screen does flash a bit. I'm using this on a trackpad swipe and with youtube not in full screen, it works fine.
any ideas?