-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added api documentation using jsdoc. Updated the README.
- Loading branch information
1 parent
a733d81
commit b06946d
Showing
9 changed files
with
2,530 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,44 @@ | ||
closed-caption.js | ||
================= | ||
|
||
A simple way to overlay 'closed caption' like captions over top a video. Look at the demo/index.html for an example of how to use it. | ||
A simple way to overlay closed captions over top a video. View demo/index.html for an example of how to use it. | ||
|
||
The HTML should be structured like this: | ||
|
||
<div class="cc-area"> | ||
<span id="cc-text" class="cc-text"></span> | ||
</div> | ||
|
||
The parent container of `cc-area` must have `position` set to `relative`, `absolute`, or `fixed` for the captions to display properly. | ||
|
||
To initialize a new ClosedCaption object, pass the `cc-text` element: | ||
|
||
var closedCaption = new ClosedCaption($('#cc-text')[0]); | ||
|
||
Set the caption text: | ||
|
||
closedCaption.setCaptions([ | ||
{ html: 'This is caption 1.', startTime: 0, endTime: 1000 }, | ||
{ html: 'This is caption 2.', startTime: 2000 }, | ||
{ html: 'This is caption 3.', startTime: 4000, endTime: 5000 }, | ||
{ html: 'This is caption 4.', startTime: 6000, endTime: 7000 }, | ||
{ html: 'This is caption 5.', startTime: 8000, endTime: 9000 } | ||
]); | ||
|
||
A "caption" object consists of three properties: `html`, `startTime`, and `endTime` (optional). If no `endTime` is set, then the caption will remain visible until the next caption displays. | ||
|
||
To play: | ||
|
||
closedCaption.play(); | ||
|
||
To pause: | ||
|
||
closedCaption.pause(); | ||
|
||
To stop: | ||
|
||
closedCaption.stop(); | ||
|
||
To toggle play: | ||
|
||
closedCaption.togglePlay(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.