The Picture-in-Picture mode is now available in Firefox from version 71 and above. So there is no need to use an add-on as that in Google Chrome for this feature. (You can check the current Firefox version through Help > About Firefox).
In this mode, a pop-out icon will be visible next to the videos. Clicking on it will open the videos in a mini window.
Using it is simple. Whenever a web video is loaded, there will be a blue pop-out icon next to it.
Click on it to enable the Picture-in-Picture mode. The mini window will be available and the video will play in it.
This mini window is resizable and can be moved around.
Also, the Firefox tab will now show a Picture-in-Picture mode icon next to it indicating that the feature is currently active.
To restore the video playback to the original window, click on the corresponding Picture-in-Picture icon in the mini window.
It will snap back the video to the original window.
This feature though is supported only for videos with audio tracks and which aren’t very short. Most of the YouTube videos as well as video from other sites are supported.
Also, if you are watching videos in the full-screen mode, the Picture-in-Picture icon won’t be available. However, you can use the keyboard shortcut keys Ctrl + Shift + ] or Ctrl + Shift + } to use this mode during that.
All done.