captions.js 0.1.0-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -0
- package/dist/index.d.mts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +35 -0
- package/dist/index.mjs +10 -0
- package/package.json +41 -0
package/README.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
> [!WARNING]
|
|
2
|
+
> 🚧 **Captions.js is nearing its first public release**
|
|
3
|
+
> The library is under active development and a full-featured version is expected around **November 2025**.
|
|
4
|
+
|
|
5
|
+
💌 Want to know when Captions.js is released?
|
|
6
|
+
Star or watch the repo on GitHub to get updates!
|
|
7
|
+
|
|
8
|
+
# Captions.js
|
|
9
|
+
|
|
10
|
+
A modern JavaScript library for adding captions to HTML5 videos with ease.
|
|
11
|
+
|
|
12
|
+
[**Live Demo**](https://maskin25.github.io/captions.js/)
|
|
13
|
+
|
|
14
|
+
[](https://main--68e681805917843931c33a87.chromatic.com/)
|
|
15
|
+
|
|
16
|
+
## Features
|
|
17
|
+
|
|
18
|
+
- **Easy Integration**: Simple API to add captions to your videos.
|
|
19
|
+
- **Customizable Styles**: Fully customizable caption styles via configurations.
|
|
20
|
+
- **Multiple Formats**: Supports various caption formats including WebVTT and SRT.
|
|
21
|
+
- **Responsive Design**: Captions adapt to different screen sizes and orientations.
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
To install Captions.js, use npm or yarn:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm install captions.js
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
or
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
yarn add captions.js
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
For development see [DEVELOPMENT.md](./DEVELOPMENT.md).
|
package/dist/index.d.mts
ADDED
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
renderCaptions: () => renderCaptions
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(index_exports);
|
|
26
|
+
function renderCaptions(ctx, text) {
|
|
27
|
+
ctx.font = "48px sans-serif";
|
|
28
|
+
ctx.fillStyle = "#17c499ff";
|
|
29
|
+
ctx.fillText(text, 150, 50);
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
33
|
+
0 && (module.exports = {
|
|
34
|
+
renderCaptions
|
|
35
|
+
});
|
package/dist/index.mjs
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "captions.js",
|
|
3
|
+
"version": "0.1.0-alpha",
|
|
4
|
+
"private": false,
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/maskin25/captions.js"
|
|
9
|
+
},
|
|
10
|
+
"description": "A cross-platform captions engine for client- and server-side video processing — ideal for AI video tools, editors, and streaming apps",
|
|
11
|
+
"keywords": [
|
|
12
|
+
"captions",
|
|
13
|
+
"subtitles",
|
|
14
|
+
"video",
|
|
15
|
+
"transcription",
|
|
16
|
+
"ffmpeg",
|
|
17
|
+
"client-side",
|
|
18
|
+
"server-side"
|
|
19
|
+
],
|
|
20
|
+
"files": [
|
|
21
|
+
"dist",
|
|
22
|
+
"README.md"
|
|
23
|
+
],
|
|
24
|
+
"main": "dist/index.js",
|
|
25
|
+
"module": "dist/index.mjs",
|
|
26
|
+
"types": "dist/index.d.ts",
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"import": "./dist/index.mjs",
|
|
30
|
+
"require": "./dist/index.js"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"tsup": "^8.0.0",
|
|
35
|
+
"typescript": "^5.6.3"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "tsup src/index.ts --format esm,cjs --dts",
|
|
39
|
+
"dev": "tsup src/index.ts --format esm,cjs --dts --watch"
|
|
40
|
+
}
|
|
41
|
+
}
|