Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
The YouTube iOS app uses a bespoke framework for codecs and decoding video in a raw framebuffer in the app. They have be using it for years since the native iOS came around after Apple's version was ended. Guessing this was because Apple's av frameworks have been buggy and never supported codecs that Google/Youtube cared about like VP9 and others. Generally not an issue, but then when Apple implemented PIP it requires using their player framework to render video and it can't host any arbitrary view. That's why iPad support wasn't just something they could turn on without just fundamentally rewriting the app. Apple built it that way so people didn't abuse the API to show non video content using PIP but at the same time you have to buy fully in to Apple's limited and buggy API for video. I don't know how PIP is implemented on iPhone but if it's the same API as what the iPad did, don't expect youtube to turn it on any time soon. There are possible workarounds but mostly through hacks and things like offline video that youtube support might be broken with PIP (I can't say for sure, it's been years since I built a video app for iOS myself). Honestly I wish apple would do the android way because on Android PIP you can have apps host things like maps for navigation there or any other type of window in PIP and not just video.
This is good information to know. I thought they weren’t supporting it because they wanted you to pay for it as part of a YouTube subscription. Apple should do whatever is necessary to make it possible for every video app to support PIP and then require apps to support it.
 
  • Like
Reactions: amartinez1660
I am most saddened by the fact that as a YouTubeTV subscriber ($65 a month) that their iPad app does not take advantage of PiP, the closest you get is being able to put the video in a corner of the screen while you remain within the app, once you try to move to a different app (Safari, Messages, etc) you no longer see or hear the video from YouTubeTV. What is even worse, at least in my experience, is that I cannot get YouTubeTV to just play in Safari on my iPad where I could take advantage of PiP.

So, no I have no faith that this comes to any “free” version of YouTube. But it should at least come to YouTubeTV subscribers, but if it isn’t already a feature for the iPad version of YouTubeTV, then I highly doubt it becomes one for the iPhone version. The fact that I am paying so much per month and this app lacks a feature that would be very useful is pathetic.

Correct me if I am wrong. Maybe I am doing something wrong that makes my prior statements irrelevant?
 
  • Like
Reactions: amartinez1660
YouTube needs to get their **** together. I pay for premium yet I still don’t get a basic feature like this?

Edit: I should be more clear. I was referring to PIP as a whole with YouTube. I’m aware if they did miraculously decide to implement PIP it would take time to come to the iPhone. I was more so referring to them dragging their feet on the iPad side.
Premium iPad users do have PiP. Its not there on iPhone for premium users as iPhone did not support PiP until iOS 14
 
Don’t hold your breath for official PIP support. This has been available on iPad for years and google specifically decided not to support this feature probably because of ads.
 
PIP has been available on the iPad for years, and still they don’t support it. I wouldn’t expect Google to implement it on the iPhone quickly. I just have zero faith that it’ll ever happen.

Solutions like the one in the article are extremely helpful. Though when I watch YouTube I tend to let it auto play the videos. After all these years of watching my up next or whatever has become really good. It sucks having to go back and forth each time a video ends.
I think that it might also be related with one of the YouTube premium selling points of watching/hearing a video on the background. Without premium subscription any change, home navigation, etc stops the video. This iOS feature already circumvents it on Safari (partially only, as locking the phone would still stop playback?). If done on the separate application itself, it would be google shooting itself too now.
 
I didn’t know MR Journalists had a sense of humor. That’s pretty hilarious.
it’s true, though. The youtube app doesn’t currently support PIP even tough iPads have had the feature for years. Until youtube updates the app to support it, if they ever do it at all, PIP won’t work for youtube videos. They do support it on their website using a browser, just as the article states.
[automerge]1594694374[/automerge]
Don’t hold your breath for official PIP support. This has been available on iPad for years and google specifically decided not to support this feature probably because of ads.
Yet they do support it if you view videos on their website using a browser, just not in the app.
[automerge]1594694631[/automerge]
Premium iPad users do have PiP. Its not there on iPhone for premium users as iPhone did not support PiP until iOS 14
Not true, youtube doesn’t support PIP at all. Premium users get to keep a video playing in the background and still hear the audio while they do other things on their device, but they still don’t get PIP. Not even on iPads despite that those devices have had PIP for years now.
 
Last edited:
The sad thing is Youtube and YoutubeTV on Android support PiP, so I don't know what the problem is for iOS other than sheer laziness. This should have been a feature years ago... especially on iPad. Netflix on iPad supports pip yet youtube doesn't?? Come on.
 
  • Like
Reactions: lartola
Don’t hold your breath for official PIP support. This has been available on iPad for years and google specifically decided not to support this feature probably because of ads.
And if they ever do I wouldn’t be surprised if they restricted it to paid subcription users only.
[automerge]1594694831[/automerge]
I think that it might also be related with one of the YouTube premium selling points of watching/hearing a video on the background. Without premium subscription any change, home navigation, etc stops the video. This iOS feature already circumvents it on Safari (partially only, as locking the phone would still stop playback?). If done on the separate application itself, it would be google shooting itself too now.
Not sure anymore if it’s related to youtube premium...someone just said they do support PIP on Android devices, which I did not know when I first read your post.
 
Its a feature they withhold to charge a premium for a subscription to youtube. Same for the feature to turn off the screen but still get the audio. The later I find more annoying as I listen to many things on youtube like a podcast and a screen on only wastes battery. The fact that Google chooses to do this is anti-consumerism at its worst, and they should be called out on it.
 
Its a feature they withhold to charge a premium for a subscription to youtube. Same for the feature to turn off the screen but still get the audio. The later I find more annoying as I listen to many things on youtube like a podcast and a screen on only wastes battery. The fact that Google chooses to do this is anti-consumerism at its worst, and they should be called out on it.
If google wanted to charge a premium for PIP on youtube, they’d be doing that already for iPad users. iPads have had PIP for years. Yet they aren’t doing it, but rather just don’t support it at all. Furthermore, they do support the feature on android devices.
 
Last edited:
If google wanted to charge a premium for PIP on youtube, they’d be doing that already for iPad users. iPads have had PIP for years. Yet they aren’t doing it, but rather just don’t support it at all. Furthermore, they do support the feature on android devices.

Unless I am missing something you cant pip in the iPad version of yourtube app either.
 
The YouTube iOS app uses a bespoke framework for codecs and decoding video in a raw framebuffer in the app. They have be using it for years since the native iOS came around after Apple's version was ended. Guessing this was because Apple's av frameworks have been buggy and never supported codecs that Google/Youtube cared about like VP9 and others. Generally not an issue, but then when Apple implemented PIP it requires using their player framework to render video and it can't host any arbitrary view. That's why iPad support wasn't just something they could turn on without just fundamentally rewriting the app. Apple built it that way so people didn't abuse the API to show non video content using PIP but at the same time you have to buy fully in to Apple's limited and buggy API for video. I don't know how PIP is implemented on iPhone but if it's the same API as what the iPad did, don't expect youtube to turn it on any time soon. There are possible workarounds but mostly through hacks and things like offline video that youtube support might be broken with PIP (I can't say for sure, it's been years since I built a video app for iOS myself). Honestly I wish apple would do the android way because on Android PIP you can have apps host things like maps for navigation there or any other type of window in PIP and not just video.

This doesn’t smell right to me. Youtube plays just fine off the YouTube webpage, so what’s the user benefit in the app using different codecs that are incompatible with PiP? And the idea that Google is unable to ’fundamentally rewrite’ it’s app to use an iOS video playback layer is a stretch. There are plenty of apps with far less financial backing than YouTube that manage to play back video just fine without any evidence that the playback framework is intolerably buggy.

It‘s far more likely this simply a business decision to go with one framework because it supports certain business objectives the Apple framework doesn’t. And we all know playing videos isn”t YouTube’s ultimate business objective. I think you’ve hit upon the truth somewhat though. PiP doesn’t allow custom views, so when a PiP YouTube video ends, you don’t get all the recommendations for more videos. You just get an X button to quit the player, and by extension quit YouTube.
 
Or you can add this as a bookmark:

javascript:document.querySelector(%22video%22).webkitSetPresentationMode(%22picture-in-picture%22);

And next time you open a video on youtube, just open this bookmark and it activates PiP, no need to enter full screen and click that button on top

edit: It also works on macOS
 
This doesn’t smell right to me. Youtube plays just fine off the YouTube webpage, so what’s the user benefit in the app using different codecs that are incompatible with PiP? And the idea that Google is unable to ’fundamentally rewrite’ it’s app to use an iOS video playback layer is a stretch. There are plenty of apps with far less financial backing than YouTube that manage to play back video just fine without any evidence that the playback framework is intolerably buggy.

It‘s far more likely this simply a business decision to go with one framework because it supports certain business objectives the Apple framework doesn’t. And we all know playing videos isn”t YouTube’s ultimate business objective. I think you’ve hit upon the truth somewhat though. PiP doesn’t allow custom views, so when a PiP YouTube video ends, you don’t get all the recommendations for more videos. You just get an X button to quit the player, and by extension quit YouTube.

So I have some first hand knowledge into how the YouTube app is build. I've also contributed to VLC on iOS as well in years past.

The YouTube app isn't some random basic video player and the content it's playing isn't some perfectly uniform type of content like you get from say a Hulu or HBO. It's a complex app that is willing to do more internally than just use existing high level APIs from the system to improve the experience. The tech behind video on the web is core to YT and they have a lot of highly skilled engineers between YT and Google itself. The same was true of VLC when I worked on it.

That means implementing things on your own instead of using the high level system APIs. There is upsides and downsides to doing that and it's a cost benefit analysis. Downside is that you add a lot of complexity and man hour overhead keeping up your implementation instead of using the free one included and updated for you in the system but the upside is that you full control it which gives you flexibility to do more than what the system APIs provide and fix bugs without waiting for system updates. Entire features are not supported in the system API that YouTube and VLC want, or if they are, they are not supported across all devices. Shipping a built-in decoder in the app gives you the ability to handle things like this on its own though.

That includes supporting novel codecs that apple doesn't care for like VP9 (which it seems iOS 14 is finally adding support for into the system frameworks which means the Apple TV can finally play 4k video since all 4K YouTube videos are only VP9), even on older devices (AVKit, AVFoundation, etc only give you the latest version of things on new devices and OSes). Bundling it in the app allows them to support it on older hardware too. Then you have DRM on some content where YT has it's own DRM system different from the content protection system apple pushes.

Sure, if the iOS app was written today and wasn't born into a world where the iOS high level apis weren't pretty terrible I think the YouTube app may have used those APIs but given the existing investment it's unlikely they will switch. Hell, iOS didn't start to get better video player framework APIs until after iOS 8 when they moved off the MediaPlayer framework for AVKit and the YouTube app is much older than that.

It was a silly move by Apple to couple PIP to AVKit with AVPictureInPictureController instead making it so that any view couldn't be hosted from any app via IOSurface. There are some nasty hacks YT could do to maybe support it. One idea is when switching to PIP the app could open AVKIt player and reload the content in that player using the system framework then (which means blowing up buffers already held by the YT app and having to maybe fetch a video in a format supported by the system which codecs and that may be lower quality) and then trying to sync up the progress to that. Let's say though you downloaded offline a video in the YT app and it's stored in VP9. AVKit is unlikely to play it. Lots of potential edge cases and bugs.

To your other points, the reason it works on mobile safari is because YT will transcode the video into a number of supported codecs so that they are supported in different browsers (WebM, Mpeg2, H264, H265, VP9 etc) and encode the video at different bit rates. They will host up whatever they think will work best for mobile safari but that might be the best looking video at the best bitrate and it might not upgrade to the best bitrate while it's playing in the same way or as well as the native YT app can. High res content will only work in YT app as well since 4K requires VP9.

Go try YouTube on an Android device with PIP there today. I don't know what you mean by showing recommendations at the end and their business model because it works pretty well on Android without anything more than the video in the PIP so obviously not something that matters to them like you claim. Also PIP even on iPad doesn't stop you from auto playing another video.

I think you are way off and don't know what you are talking about.
 
Last edited:
  • Like
Reactions: Rogifan
I think you are way off and don't know what you are talking about.

Well darn, I was going to give you a like for putting in all that effort and not being rude but... argh. But anyway, thank you for making the effort, you are right, some of the detail I didn’t know, but as a user and not an engineer I find this a very Googley answer. It’s almost like the engineering prowess is more important than user experience. Their codecs may be awesome, but for watching homemade videos in a one-inch window I think I’d be happy to ‘settle’ for Netflix-quality playback. But it’s fine, you and Google see it a different way, and maybe see what YouTube stands for in a different way. Enjoy the rest of your day.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.