You will need to install a user script manager extension to install this script.
Inserts a button under the YouTube video player with the following options:
After you select the option "Fill Window" the options "Stretch" and "Hide Search" are revealed. The "Stretch" option expands the video's width or height to fit within the visible area while preserving the original aspect ratio; the stretch is useful for ultrawide and also narrow monitors. The "Hide Search" option helps to maximize the visible area of the video by automatically hiding the search bar at the top; the search bar is revealed when you scroll down the window.
After you select the option "Float Video" the option "Small Float" allows a small video size to float on the page as you scroll. If small float is unselected then the floating video has the original size. In the fill window mode the float is automatically small.
This script has been tested with Tampermonkey on the browsers: Chrome, Edge, Brave, Firefox, Opera.