February 1, 2024

YouTube is probably one of the parts of the internet I consume the most, so I was more than a little sad when YouTube announced that they don’t have plans to build a visionOS app, and disabled the option to load the iPad app. This leaves you with Safari, and the website is okay, but definitely doesn’t feel like a visionOS app. Couple that with visionOS not having the option to add websites to your Home Screen, and YouTube isn’t that convenient on visionOS by default.

Then I remembered for years my old app, Apollo, played back YouTube videos submitted to Reddit pretty well, and I developed a pretty good understanding of how YouTube worked. That sparked the idea to reuse some of Apollo’s code there and build a little YouTube client of my own for visionOS, and after a mad week of coding “Juno for YouTube” is born.

How does it work… technically?

YouTube has a few different APIs.

They have a “Data API” for fetching information (thumbnail, duration, etc.) for a video, that requires an API key, auditing, and you can only call so many times a day. This API doesn’t actually get you the video to play or anything, it’s purely for metadata, and for uploading.

They have private/internal APIs that they get grumpy at you for using because you can circumvent ads. The goal with this app was to not make Google grumpy.

Lastly, they have an embed API that’s pretty powerful, and is what I used in Apollo and now Juno. There’s no API keys, or limits to how many times a day you can call it, as it literally just loads the video in a webview, and provides JavaScript methods to interact with the video, such as pause, play, speed up, etc. It’s really nice, you can play YouTube videos back, and YouTube still gets to show ads (if the user doesn’t have YouTube Premium) and whatnot so no one is grumpy.

This means you can build a fully native visionOS UI that then using JavaScript interacts with the underlying YouTube player, so you get the best of both worlds. Juno even supports detecting aspect ratios of the videos and will resize the window automatically, so ultra-wide 21:9 movie trailers are respected, as are nostalgic 4:3 uploads.

The one downside is that occasionally you’ll get a creator who disabled playback for YouTube embeds. This is rare, especially with videos made in the last few years, but for those Juno will auto-detect that and just load up the normal video website page rather than the fancy player.

At its core, Juno uses the YouTube website itself. No, not scraped. It presents the website as you would load it, but similar to how browser extensions work, it tweaks the theming of the site through CSS and JavaScript.

That results in:

Tweaking backgrounds so the beautiful glassy look of visionOS shows through. As the great Serenity Caldwell once said, “Opaque windows can feel heavy and constricting, especially at large sizes. Whenever possible, prefer the glass material (which pulls light from people’s surroundings).”
Increasing contrast so items are properly visible
Making buttons like the button to view your subscriptions native UI, and then loading the relevant portions of the website accordingly
You get your full recommendations, subscriptions and whatnot, just as you would on the normal YouTube site or app

It was a lot of work tweaking the CSS to get the YouTube website to something that felt comfortable and at home on visionOS, but I’m really happy with how it turned out. Does it feel like a perfectly native visionOS app? Well no, but it’s a heck of a lot nicer than the website, and to be fair Google apps normally do their own thing rather than use iOS system UI, so not sure we’ll ever fully see that. :)

It doesn’t, I don’t think Google would like that, but if you have YouTube Premium you won’t see ads, just like the website. Honestly, YouTube Premium is like one of the most essential subscriptions for me, it’s so handy to never worry about ads and it’s pretty cool in that it also supports the creators substantially more than if you watched ads. So I dunno, if you can afford an expensive Apple Vision Pro, I’d really consider treating yourself to YouTube Premium!

Beautiful translucent visionOS interface
Automatic aspect ratio detection
Speed up or slow down video
Native controls for video playback
Pinch-drag anywhere to scrub through video (an Apollo classic)
Double-pinch either side of the video to jump forward or back 10 seconds in time
Quick launch YouTube from Home Screen
Dim your surroundings to focus on the video
View your recommendations, subscriptions, playlists, etc.
Resizable (while maintaining correct aspect ratio)
Automatic quality selection, should scale up or down based on the size of your window all the way to 4K

This was a bit of a mad dash to get finished in time for the Apple Vision Pro launch, so I’m hoping to add some more things with time.

Ability to see comments (I mean, they’re useful sometimes…)
Maybe select quality directly if interest is there
Caption controls (couldn’t quite get this working in time for 1.0)
More immersive environments
Multiview for multiple
Read More