Skip to content

[tvOS] External Trailer Fix #1475

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Conversation

JPKribs
Copy link
Member

@JPKribs JPKribs commented Apr 6, 2025

Summary

Today, I built the Main tvOS build on my actual Apple TV and I found that external trailers always failed to open. I needed to add this to info.plist:

<key>LSApplicationQueriesSchemes</key>
	<array>
		<string>youtube</string>
	</array>

This is IF we want to proceed with this. I've tested this on a real device and can confirm this now works. I wasn't even aware there was a way to build on a remote Apple TV because I never looked into it...

I think the two major reasons we wouldn't want to do this are:

  1. Not all external trailers are going to be YouTube. Do we want to add URL schema for all various sources that come up? This opens us up to the requests for "Enable Trailers for X Platform" which adds some additional maintenance.
  2. From a FOSS perspective, linking into Google's YouTube can feel a bit taboo. I don't personally see the issue but I can understand why that might less than ideal to some folks.

Let me know if we want to proceed!

Proof

ScreenRecording_04-05-2025.19-02-41_1.mov

@JPKribs JPKribs added the bug Something isn't working label Apr 6, 2025
@JPKribs JPKribs marked this pull request as draft April 6, 2025 22:05
@JPKribs JPKribs marked this pull request as ready for review April 6, 2025 22:31
@JPKribs
Copy link
Member Author

JPKribs commented Apr 6, 2025

@LePips no rush since this only impacts tvOS / Main. I've built this out more. Instead of hardcoding YouTube, I made a real DeepLinkURL Struct for this. Testing and working on a real world Apple TV. I only really tested Vimeo and YouTube.

I'm honestly up in the air whether we want to support this type of linking. Entirely your call on this. I've built this out more so adding more in the future / maintaining is easier.

@thornbill
Copy link
Member

I'm curious what happens if those apps are not installed... will the user be prompted to install them?

@JPKribs
Copy link
Member Author

JPKribs commented Apr 7, 2025

I'm curious what happens if those apps are not installed... will the user be prompted to install them?

Right now it errors with: "Unable to open trailer in ApplicationName"

I tested that with a URL to Vimeo when I uninstalled. I could make it more of a call to action or even link in the app store but then we'd have to keep those links up to date if they ever change. I don't imagine App Store URLs change all that much though?


ApplicationName being one of the below. I don't think we need all of these but these are all of the AppleTV apps I found that we could link to:

  • "YouTube"
  • "Vimeo"
  • "Apple TV"
  • "iTunes"
  • "Netflix"
  • "Disney+"
  • "Amazon Prime Video"
  • "HBO Max"
  • "Hulu"
  • "Peacock"
  • "Paramount+"
  • "Dailymotion"
  • "Twitch"
  • "IMDb"
  • "TMDb"
  • "Unknown" - This one is localized

Edit: Ugh. It's MAX now isn't it? If we want HBO / HBO Max / MAX I will need to confirm that LSApplicationQueriesSchemes is still the same.

@dkanada
Copy link
Member

dkanada commented Apr 7, 2025

Whether or not we should link to external apps for trailers feels like more of a server question. Since the server currently supports it I'd say it's a net positive that iOS and tvOS include support. It would be similar to linking IMDb for a movie when the external ID exists on the server.

@JPKribs
Copy link
Member Author

JPKribs commented Apr 7, 2025

Whether or not we should link to external apps for trailers feels like more of a server question. Since the server currently supports it I'd say it's a net positive that iOS and tvOS include support. It would be similar to linking IMDb for a movie when the external ID exists on the server.

That makes complete sense! Most of my hesitance is that would make Swiftfin one of the few apps that "requires" another app downloaded to work. Web, trailers embed in the same browser window so it feels very cohesive. To add to it, I don't think I've used an Apple TV app that opens another app? I was clicking through this morning and I think Swiftfin would be the only tvOS app I've personally seen that has this type of handoff. Not that it's a problem just part of why I wanted to tread carefully when looking at this.

@dkanada
Copy link
Member

dkanada commented Apr 7, 2025

Your comments also make sense - it's exactly why I don't bother with trailers in my own case haha. For what it's worth I'm certain the Android TV client supports YouTube but I'm not sure about other services. I also believe some Apple TV+ integrations link out to external apps if you select a show only on their service but I haven't looked at those in a while.

@JPKribs JPKribs marked this pull request as draft April 12, 2025 04:11
@JPKribs JPKribs marked this pull request as ready for review April 12, 2025 05:05
@JPKribs JPKribs requested a review from LePips April 14, 2025 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants