If I remember correctly, if you look at YouTube's app permissions it specifically says something about keeping the screen on. I don't believe Facebook does. So yea, it'll be an app vs app issue. All you can do in those cases is lengthen your general idle timeout or keep tapping the screen now and again.
It drives my wife nuts that the screen keeps turning off while watching MLB At Bat ;-)
Check out an apk called "Screebl lite" at the Play Store.
It's free and works fine to keep you phone "awake" as long as it's not laying flat. You can set the limits for portrait and landscape mode. I've used it for years...
One of my favorite apps for a long time.