Apple - How can I run a YouTube video in Picture in Picture mode on iOS?
iOS enables PIP easily, there are standard ways to classify all video and unless the web site takes active measures to disable PIP it just works.
Youtube has continually taken steps to disable and remove PIP functionality on iOS, but there are a still few ways to bypass their efforts to control how you consume their video content and watch Picture in Picture:
Bite the bullet and subscribe to Youtube Premium (AKA Youtube Red). If you subscribe to Google Music, it is included. To watch PIP with Youtube Red, swipe down or diagonally across the video to minimize it. Plays in bottom right corner.
Use an app to open and process the links. I found links to two, but can't vouch for either one. Including name of developer in case the location of link changes at some point:
Cornertube by Tiny Whale Pte. Ltd.
https://itunes.apple.com/US/app/id1073199994?mt=8 costs $2.99
Pipifier, made by Arno Appenzeller, can be found at
https://itunes.apple.com/app/pipifier-pip-for-nearly-every/id1160374471?mt=12 free app
Scriptable.app with this YouTube PIP script - both are free
An alternative that needs no payment or extra apps is Safari in split view. This is a part of iOS and is documented at https://support.apple.com/en-us/HT207582.
How to use Split View:
Open an app. Swipe up from the bottom of the screen to open the Dock.
On the Dock, touch & hold the second app that you want to open, then drag it off the dock.
When the app opens in Slide Over, drag the dash icon down.
This question was answered a few years back at How do I play a YouTube video in the background on my iPad? but the solution doesn't work on iOS 10+.
I found no setting to enable it.
This is not possible without a third-party application. YouTube have not added the capablility to iOS. You can suggest it to YouTube but Apple has nothing to do with it.
Is there any setting I can use or third-party app I can use?
There is an app called PiPifier. Link to download. This allows any video on the web to be played in picture-in-picture.
How to use it
When on a YouTube video on the web go to the share menu at the top-right:
Then click more:
Then when you are on a YouTube video on the web click run PiPifier:
Alternatively, you can subscribe to YouTube red or watch the video in split view:
Make sure YouTube is in the dock
Drag the icon to the right of the screen
When it opens drag down the dash icon at the top