GitXplorerGitXplorer
a

Sila

public
15 stars
6 forks
19 issues

Commits

List of commits on branch master.
Unverified
8012888c018c88f750f779b50ec0e907a7482a1c

Prevent controls from hiding when adjusting current seek position

aagg23 committed 2 months ago
Unverified
4f7d2cc47f176ed23c657e4e9147709ebc7bf27e

Fix ChannelView startup causing UIKit error

aagg23 committed 2 months ago
Unverified
4b9faae188c7ccf8e1cac123c224b6a60efc6001

Rough VoD time slider

aagg23 committed 2 months ago
Unverified
f1540f4f33f391f8cd2b19a56ecd823f23cf34d5

Automatically set highest quality when playing back VoDs to fix Safari bug that prevents video playback

aagg23 committed 2 months ago
Unverified
3898c4df2daf8a52c2d92fd6d251b210decf84f2

Updated test comment capture

aagg23 committed 2 months ago
Unverified
473ed1939388eb2f332503f00456bc4ad0e83d2c

Fixed AuthController being initialized twice

aagg23 committed 2 months ago

README

The README file for this repository.

Sila for Twitch

Sila is a native Twitch client designed for Apple Vision Pro. Bypass the official Twitch websites with it's annoying touch targets and tiny UI and experience Twitch in a more enjoyable manner.

You can download it from the App Store at https://apps.apple.com/us/app/sila-for-twitch/id6479336617. If you really enjoy the app, or just want to help me pay for my dev account subscription, you can donate here on Github.

Features

  • Native application for a smooth experience; no reliance on a separate web browser. Designed to feel right at home on visionOS.
  • Native-like video playback with controls an UI customized to the Twitch experience. Uses WKWebView internally (see FAQ)
  • Live chat integration with inline Twitch emotes (both static and animated). Other emote sources coming soon.
  • Log in to see your followed channels, and launch directly into their livestreams.
  • Watch multiple streams simultaneously (requires all but one stream to be muted).
  • Start watching new streams with Siri, and build automations via Shortcuts.

No Twitch account is required for use, but if you chose to use it, your existing subscriptions and Twitch Turbo status will be used. Twitch will also properly keep track of your watch time for drops and end of the year summaries.

Screenshots

Video Chat Popular Mixed View

Automation

Sila supports several automation mechanisms: Shortcuts and deeplinking.

The included Shortcuts are:

  • Open Stream - Opens a live video window for the specified channel, if the channel exists and is live
  • Live Following Channels - Returns a list of live channels followed by your account
  • Most Popular Streams - Returns a list of the most popular streams on Twitch
  • Streams in Category - Returns a list of the most popular streams in a given category

Deeplinking uses the sila:// URL scheme. Supported routes are:

  • sila://watch?stream=[streamerName] - Opens a live video window for the specified channel, if the channel exists and is live
  • sila://following - Opens the Following tab
  • sila://popular - Opens the Popular tab
  • sila://categories - Opens the Categories tab
  • sila://category?id=[categoryID] - Opens the specified category, in the Categories tab, if the category exists

Building

Sila is straightforward to build, with everything being self-contained to Xcode and SPM. The only things that should be required of you as a developer is changing the signing team (as is typical for iOS) and adding secrets to Keys.xcconfig:

  1. Create Keys.xcconfig in the root directory of the repo, alongside Sila.xcodeproj.
  2. Add the following content:
API_CLIENT_ID = "[insert id here]"
API_SECRET = "[insert secret here]"

You must obtain these keys from the Twitch developer portal, with your own registered application: https://dev.twitch.tv/console/apps. You must create a "Confidential" client with http://localhost as your OAuth redirect URL. We choose "Confidential" here as Twitch does not allow unauthorized clients to access certain key APIs unless it comes from a "Confidential" client. So while it's wrong to ship a private key with the application, we have no choice.

Important Notice: Registration Bug in Twitch Developer Console

We've identified an intermittent issue during the application registration process in the Twitch Developer Console where attempts to register your application will fail silently. This typically occurs if the chosen name for your application is either restricted or has already been taken by another user. Your key cannot have spaces as if it does, it will silently fail. For instance, the name Sila for Twitch was problematic, whereas MyKeyForSila was successful.

If you encounter a failure at the Create screen, we recommend trying alternative application names. Persist with different names until the registration succeeds.

FAQ

Why "Sila"

Sila is the Inuit word for breath or spirit, which matches well with the ghost mascot I imagined for the icon. I searched through a bunch of names relating to ghost and Twitch and cloud, including in non-English languages, and Sila was the best one I found. After using it for a while, I think it fits quite well.

Why use a WKWebView? Why not a native AVPlayer?

It's against Twitch's ToS to directly access the raw HLS stream, similar to what Streamlink does. It can be made to work, but it's error prone, and it doesn't display ads properly (just displaying a blank placeholder screen), though this may be considered a benefit. In addition, you lose to the ad blocking with subs without extracting a cookie from the web client. In other words, its finicky, and Twitch doesn't like it, which isn't something I wanted to deal with for an app I planned to submit to the App Store.

Why is this code so weird?

This is my first time writing for an Apple platform in close to a decade. SwiftUI is brand new to me, and I went through many iterations trying to figure out good patterns. I imagine there's still plenty of issues with the codebase, so if you spot something, let me know in an issue or open a PR to fix it yourself.