HOWTO add pinyin subtitles to streaming movies https://spacecruft.org/Chinese/pinyin-movie
Find a file
2026-08-01 20:12:34 -06:00
img Example image 2026-08-01 20:12:34 -06:00
.gitignore git ignore 2026-08-01 20:12:25 -06:00
LICENSE-CC.txt Creative Commons Attribution-ShareAlike 4.0 International 2026-08-01 20:12:16 -06:00
README.md HOWTO Add Pīnyīn Subtitles to Streaming Movies 2026-08-01 20:12:02 -06:00

HOWTO Add Pīnyīn Subtitles to Streaming Movies

This document shows how to add pīnyīn subtitles to streaming movies from sites such as Viki, Netflix, HBO/Max, etc. with browser extensions in Firefox. It likely works with other browsers such as Chromium.

Pīnyīn and English Subtitles

Rationale

Subtitles are a great way to study a foreign language. The problem with this in Mandarin is that the subtitles are in Hànzì, not pīnyīn, so new students typically can't read the subtitles.

Following a Mandarin movie with pīnyīn makes it much easier to understand what the actors are saying.

Hànzì to Pīnyīn

The trick is to have the Hànzì converted to pīnyīn on the fly. The "Pinyin Annotator" extension does this automatically.

It can be downloaded and installed in Firefox:

Source code (GPLv3):

Pīnyīn and English

While the "Pinyon Annotator" extension is great for adding pīnyīn, you can't view the English subtitles at the same time.

There is another browser extension, "asbplayer" that allows you to view multiple subtitles at the same time.

It can be downloaded and installed in Firefox:

Source code (MIT):

With "asbplayer" you can set the subtitle sizes, colors, and many more options. Click to open the side panel to select which subtitles to add.

This also presents some options for the user in how to handle the subtitles. For instance, you could enable Mandarin subtitles in Netflix, then add English subtitles with "asbplayer". But I think the superior solution is to turn off subtitles in the streaming service (e.g. Netflix) and enable both Mandarin and English subtitles in "asbplayer". This allows for the best rendering.

Remove Hànzì

With "Pinyin Annotator" and "asbplayer" working, you now have three subtitles being displayed: Hànzì, pīnyīn, and English.

This can be a bit much on the screen, especially if you don't read the Hànzì. The best solution is to remove the Hànzì.

This can be done with yet another extension that dynamically changes the CSS on the fly.

It can be downloaded and installed in Firefox:

Source code (GPLv3):

To use this, you need to add custom CSS code for the particular website.

Use this code:

/* Pinyin Annotator: show only pinyin, hide the Chinese characters */
pya.py-chinese-item { display: none !important; }

/* Promote pinyin from tiny ruby text to a normal inline line */
pya.py-result-item ruby { display: inline !important; }
rt.py-pinyin-item {
  display: inline !important;
  font-size: 1em !important;        /* match the subtitle text size */
  margin-inline-end: 0.25em;        /* space between syllables */
}

Sites

This works with:

  • Viki (Rakuten)
  • Netflix
  • HBO/Max

This does not work with:

  • IQ

License

Creative Commons Attribution-ShareAlike 4.0 International. See LICENSE-CC.txt for details.

Copyright © 2026 Jeff Moe moe@spacecruft.org

Loveland, Colorado, USA