I have an iphone XR but can't screen record i screen record youtube videos because they stay silent when recording?

How do I screen record youtube videos?

Record your screen
Go to Settings > Control Center > Customize Controls, then tap green plus icon next to Screen Recording.
Swipe up from the bottom edge of any screen. On iPhone X or later or iPad with iOS 12 or later, swipe down from the upper-right corner of the screen.
Press deeply on gray record icon and tap Microphone.
Tap Start Recording, then wait for the three-second countdown.
Open Control Center and tap red record icon. Or tap the red status bar at the top of your screen and tap Stop.
Go to the Photos app and select your screen recording.