Giter Club home page Giter Club logo

videojs-transcript's Introduction

Video.js Transcript

Creates interactive transcripts from text tracks.

Alpha Release 2

Please report any issues or feature requests on the tracker. Thank you!

Getting Started

Once you've added the plugin script to your page, you can use it with any video:

<head>
<script src="video.js"></script>
<script src="videojs-transcript.js"></script>
</head>
<body>
<video id="video">
      <source src="whatever.webm" type="video/webm">
      <track kind="captions" src="mycaptions.srt" srclang="en" label="English" default>
</video>
<div id="transcript"></div>
<script>
    var video = videojs('video');

    // Set up any options.
    var options = {
      showTitle: false,
      showTrackSelector: false,
    });

    // Initialize the plugin.
    var transcript = video.transcript(options);

    // Then attach the widget to the page.
    var transcriptContainer = document.querySelector('#transcript');
    transcriptContainer.appendChild(transcript.el());  
</script>
</body>

There's also a working example of the plugin you can check out if you're having trouble.

You'll also want to include one of the css files. You can style the plugin as you like but there are a few examples in the /css folder to get you started.

Documentation

Plugin Options

You may pass in an options object to the plugin upon initialization. This object may contain any of the following properties:

autoscroll

Default: true

Set to false to disable autoscrolling.

clickArea

Default: 'line'

Set which elements in the transcript are clickable. Options are 'timestamp', 'text', the whole 'line', or 'none'.

showTitle

Default: true

Show a title with the transcript widget.

(Currently the title only says 'Transcript')

showTrackSelector

Default: true

Show a track selector with the transcript widget.

followPlayerTrack

Default: true

When you change the caption track on the video, the transcript changes tracks as well.

stopScrollWhenInUse

Default: true

Don't autoscroll the transcript when the user is trying to scroll it.

(This probably still has a few glitches to work out on touch screens and stuff right now)

Plugin Methods

el()

Returns the DOM element containing the html transcript widget. You'll need to append this to your page.

Release History

0.7.2: Alpha Release 2
  • Updated for video.js 4.12
0.7.1: Alpha Release 1
  • First release

videojs-transcript's People

Contributors

walsh9 avatar

Stargazers

David Walsh avatar

Watchers

David Walsh avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.