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

Support coloured subtitles #97

Open
pyby opened this issue Oct 21, 2020 · 1 comment
Open

Support coloured subtitles #97

pyby opened this issue Oct 21, 2020 · 1 comment

Comments

@pyby
Copy link
Member

pyby commented Oct 21, 2020

Issue type

Feature request

Description of the problem

A a deaf or hard-of-hearing, I would like to read subtitles, with the adapted colors, if available.

Environment information

  • Library version: Any
  • iOS version: Any
  • Device: iPhone, iPad, Apple TV

Steps to reproduce

  1. Play a video stream
  2. Open alternate tracks and select a subtitles option
@pyby
Copy link
Member Author

pyby commented Oct 21, 2020

Interesting articles explain WebVTT specifications:
https://ronallo.com/blog/html5-video-caption-cue-settings-tester/
https://www.speechpad.com/captions/webvtt

From Apple documentation, AVPlayer supports the Cue Settings in WebVTT

Here is an example.

::cue(.red){ color: red; }
::cue(.blue){ color: blue; }
::cue(.green){ color: green; }
::cue(.yellow){ color: yellow; }
::cue(.background-red){ background-color: red; }
::cue(.background-blue){ background-color: blue; }
::cue(.background-green){ background-color: green; }
::cue(.background-yellow){ background-color: yellow; }

From French TV broadcaster, France Télévision, The second channel, France 2 livestream is delivered throw HLS with an AES-128 key encryption.

The webvtt subtitles for SDH looks like:

WEBVTT
X-TIMESTAMP-MAP=MPEGTS:7351793473,LOCAL:00:00:00.000

STYLE
::cue(.white) { color: white; }
::cue(.yellow) { color: yellow; }

00:00:00.000 --> 00:00:01.680 align:middle
<c.white> Demander le double </c>
<c.white> de ton cachet. </c>

00:00:02.080 --> 00:00:04.000 align:middle
<c.white> En général, c'est radical. </c>
<c.yellow> -Charlotte. </c>

AVPlayer in Safari Mac (opened in a tab) or in iOS applications support it:
colored_subtitles_hls

For a coloured subtitles integration in SRGMediaPlayer, the stream packager service has to support Cue Settings in WebVTT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant