Skip to content

Commit

Permalink
Documented displayASS and incremented the version number to 1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
j-holub committed Sep 19, 2017
1 parent 76fcaf9 commit 909fa5e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* **1.4.0**
* Added a new method `commandJSON()`
* Added an *options* parameter to the `load()` and `append()` methods to pass additional options to **mpv**
* Added a method `displayASS()` to make using *ass-formatted* subtitles easier. (Thanks to @AxelTerizaki)

* **1.3.1**
* Fixes `next()` and `prev()`. The mode was not propagated to **mpv** and instead of **strong** it is actually **force*
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-mpv",
"version": "1.3.1",
"version": "1.4.0",
"description": "A Node module for MPV",
"main": "index.js",
"scripts": {
Expand Down
16 changes: 16 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,23 @@ mpvPlayer.on('stopped', function() {

Adjust the scale of the subtitles

* **displayASS** (assMessage, duration, position=7)

Displays **ass-formated** subtitles. A good documentation about **ass** can be found [here](http://docs.aegisub.org/3.2/ASS_Tags/).

* `assMessage` the subitle text along with the **ass-tags**
* `duration` the time the subtitle should be displayed in *miliseconds*
* `position` where the subtitles are displayed. It works like a numpad (**5** being center and so on). The default is **7** - the top left corner

This method will add `${osd-ass-cc/0}` (along with the position tag) in front of your message, to enable **ass** formating and *parameter expansion*.

You cannot show two different subtitles at the same time, the newer one will overwrite the previous one. This is a limitation of **mpv**.

Unfortunately beforehand defined **ass styles** do not work, you have to style your subtitles using **ass-tags**

```JavaScript
player.displayASS('{\\fsp10}Hey I'm a letter spaced subtitle in the center of the screen', 5000, 5);
```
## Properties
Expand Down

0 comments on commit 909fa5e

Please sign in to comment.