feat: Select default track by a list of preferences#9542
feat: Select default track by a list of preferences#9542KimKyuHoi wants to merge 31 commits intoshaka-project:mainfrom
Conversation
|
Related to #1591 |
|
Incremental code coverage: 71.76% |
|
FYI there was a discussion in topic linked and instead of your proposal, we were thinking about more configurable objects, see #1591 (comment), #1591 (comment) & #1591 (comment) |
|
I appreciate the effort, but I'm not confident this would hold up over time. I would strongly prefer reducing the set of streams using a list of preferences (see the linked comments from @tykus160). Allowing multiple languages introduces questions around multiple roles, codecs, and their possible combinations. The recent text track simplification likely makes integration more straightforward. We should be careful introducing this as a proper v5 API as we'll have to maintain backwards compatibility for a while. @KimKyuHoi, would you be willing to experiment with the proposed idea's in #1591 as opposed to solely allowing multiple languages? |
|
Yes, we can break backwards compatibility with the introduction of a next major version. I'm sorry I'm expanding scope so much for a change that should be relatively straight forward, but I feel we shall take advantage of the fact that we're going to bump a major version in order to get track preferences right from the get go. Nonetheless, we're here to help. @tykus160, do you think implementing this in I'd love to hear everyone else's opinion though! |
|
@matvp91 I think it's a good suggestion. Then, why don't we open a new issue, create a relation, and proceed further? I'm making this suggestion because I'm going to be taking charge of it anyway. I was concerned that if we proceeded with the existing PR, the resulting diff files would be too large. |
|
@KimKyuHoi what works best for you, I'm OK either way. |
|
@matvp91 Oh, you've been waiting a long time, right? Sorry. I'll work on this repo. |
|
Please update PR title and descripcion with the new changes. |
|
Bundle Size Report for PR #9542
|
|
@KimKyuHoi Please update the description of the PR to match with the current implementation! |
I went ahead and implemented the full structured preference system that was discussed in #1591.
Instead of just expanding languages to arrays, I replaced all 14 individual preference fields with 3 structured arrays:
Each array entry works as an AND filter - so you can say things like "I want Korean with 5.1 surround, but if not available, English is fine too":
Config - Replaced the 14 individual fields with 3 arrays of typed preference objects (AudioPreference, TextPreference, VideoPreference). The old fields still work at runtime with a deprecation warning, so existing apps won't break immediately.
Demo - The demo config UI now shows inline expandable preference lists instead of flat text inputs. You can add/remove entries and configure each field per entry. URL hash serialization was updated to use JSON format, with legacy param fallbacks preserved.