Skip to content

Conversation

@therama
Copy link
Contributor

@therama therama commented Dec 3, 2025

No description provided.

return subtitlem3u8.data(using: .utf8)
}

fileprivate func getSubtitleManifest(for originalURL: URL) -> String {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we are missing a guard in this method (or somewhere up the chain)

Right now (if I see this code correctly), we intercept all SUBTITLE manifest requests and override it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked into this, and there are no changes in the flow in this refactor. We always intercept yes, but we don't always override it. If we can't find the track description then we return the original.

public static var sourceWithSideloadedTextTrack: SourceDescription {
let typedSource = TypedSource(src: "https://sourceURL.com/manifest.m3u8, type: "application/x-mpegurl")
let textTrack = TextTrackDescription(src: "https://sideloadedurl.com/subtitle.vtt", srclang: "language_code", isDefault: false, kind: .subtitles, label: "Label", format: .WebVTT)
let textTrack = TextTrackDescription(src: "https://sideloadedurl.com/subtitle.vtt", srclang: "language_code", isDefault: true, kind: .subtitles, label: "Label", format: .WebVTT)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did we check the AVplayer behavior in case of 2 DEFAULT=YES subtitles? (most probably one of the already existing subtitles in the manifest could have this set to YES already)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only the first is entry is taken into account. I will add that as a limitation.

@THEObuildbot THEObuildbot force-pushed the improvement/migrate-interceptor branch from dfdf8a6 to c2fd5f0 Compare January 8, 2026 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants