Skip to content
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

Automatic subtitle selection #503

Closed
6 tasks done
defagos opened this issue Aug 2, 2023 · 6 comments · Fixed by #539
Closed
6 tasks done

Automatic subtitle selection #503

defagos opened this issue Aug 2, 2023 · 6 comments · Fixed by #539
Labels
enhancement New feature or request
Milestone

Comments

@defagos
Copy link
Member

defagos commented Aug 2, 2023

As a user I want automatic subtitle selection to be available. Automatic selection must take care of selecting the most appropriate subtitle selection based on the current audio language.

Acceptance criteria

  • An API is available to enable automatic subtitle selection.
  • A corresponding option is available in the demo.

Documentation

Tasks

  • Understand what automatic subtitle selection actually is.
  • Understand possibly related APIs, most notably preferred settings and automatic behavior.
  • Generate new test streams if needed (e.g. stream with DEFAULT for some language or with AUTOSELECT not available for all languages).
  • Add API to enable automatic subtitle selection.
  • Add corresponding option to the demo player menu.
  • Check behavior over AirPlay.
@defagos defagos added this to Pillarbox Aug 2, 2023
@defagos defagos converted this from a draft issue Aug 2, 2023
@defagos defagos added the enhancement New feature or request label Aug 2, 2023
@defagos defagos added this to the Tracks milestone Aug 2, 2023
@defagos
Copy link
Member Author

defagos commented Aug 3, 2023

I had a look at what is returned by preferredMediaSelection when AD / SDH settings are enabled or disabled but the results are not affected. This property isn't therefore a cheap way to get the subtitles or audio tracks to prefer based on accessibility settings.

@defagos
Copy link
Member Author

defagos commented Aug 3, 2023

We need to clearly identify what Automatic means. After discussions with @amtins and @StaehliJ it appears that our SRG Media Player was likely taking too many decisions and that the definition of this automatic mode should be simpler.

It is likely that:

  • This is related to the AUTOSELECT playlist option.
  • According to some non-official Akamai documentation automatic mode might select a best match only within AUTOSELECT options.

We should therefore:

  • Think about several use cases.
  • Tweak streams to see how packaging affects automatic selection, on iOS, tvOS and macOS. Warning: Safari and QuickTime have different behaviors it seems.

We should also check whether automatic mode agrees with the result obtained by calling selectMediaOptionAutomatically(in:) on a player item. Hopefully this is the case and we therefore can obtain identical behavior with a single call.

@defagos
Copy link
Member Author

defagos commented Aug 9, 2023

See comment elsewhere for an important remark about AUTOSELECT behavior and relationship with MediaAccessibility.

@defagos
Copy link
Member Author

defagos commented Aug 22, 2023

Automatic selection requires appliesMediaSelectionCriteriaAutomatically to be set to true (the default). Our implementation will use this default behavior. The rest works correctly provided playlists are properly configured.

@defagos
Copy link
Member Author

defagos commented Aug 22, 2023

Some remarks:

@defagos defagos closed this as completed Aug 22, 2023
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Pillarbox Aug 22, 2023
@defagos defagos reopened this Aug 22, 2023
@github-project-automation github-project-automation bot moved this from ✅ Done to 📋 Backlog in Pillarbox Aug 22, 2023
@defagos defagos linked a pull request Aug 22, 2023 that will close this issue
5 tasks
@defagos defagos moved this from 📋 Backlog to 🍿 Code Review in Pillarbox Aug 22, 2023
@github-project-automation github-project-automation bot moved this from 🍿 Code Review to ✅ Done in Pillarbox Aug 22, 2023
@defagos
Copy link
Member Author

defagos commented Aug 29, 2023

We finally better (but probably not completely) understand how Automatic (Recommended) works. Note that for a rendition to be selectable automatically, most notably in this mode, it needs to be flagged with AUTOSELECT=YES in the master playlist.

Here is how Automatic (Recommended) seems to work to the best of our current knowledge:

  • For audible rendition selection, the system finds the first language that matches one of the preferred languages defined in the system settings, in order of appearance. If not it uses a default option (the one with DEFAULT=YES is preferred, if any).
  • For legible rendition selection, the result depends on the selected audio language:
    • If the selected audio language appears in the preferred languages defined in the system settings, no subtitles will be displayed. The user is supposedly able to understand this language after all.
    • If the selected audio language does not appear in the preferred languages defined in the system settings, the first subtitles matching one of the preferred languages, in order of appearance, are used. Otherwise a default option is used (the one with DEFAULT=YES is preferred, if any).

Note that this automatic selection logic is affected by accessibility settings, though the idea remains the same. It also seems to be applied when starting playback, not when settings are updated afterwards during playback. The criteria are likely those listed in the official documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant