Code Monkey home page Code Monkey logo

clappr-subtitle's Introduction

Clappr Subtitle

Simple Usage

 var player = new Clappr.Player({
    source: 'video.mp4',
    baseUrl: '/latest',
    mute: true,
    height: 360,
    width: 640,
    plugins: [ClapprSubtitle],
    subtitle : "video.srt" // URL to subtitle
});
player.attachTo(document.getElementById('player'));

Styling the subtitles

 var player = new Clappr.Player({
    source: 'video.mp4',
    baseUrl: '/latest',
    mute: true,
    height: 360,
    width: 640,
    plugins: [ClapprSubtitle],
    subtitle : {
        src : "video.srt",
        auto : true, // automatically loads subtitle
        backgroundColor : 'transparent',
        fontWeight : 'normal',
        fontSize : '14px',
        color: 'yellow',
        textShadow : '1px 1px #000'
    },
});
player.attachTo(document.getElementById('player'));

SRT FORMAT

1
00:00:12,598 --> 00:00:13,891
Do not try and bend the spoon. That's impossible. Instead... only try to realize the truth.

2
00:00:14,212 --> 00:00:17,846
- What truth?
- There is no spoon.

3
00:00:18,102 --> 00:00:24,317
- There is no spoon?
- Then you'll see, that it is not the spoon that bends, it is only yourself.

WARNING

This is a very early version. You can't select subtitle tracks, and long srt files may run slow.

clappr-subtitle's People

Contributors

tmaiadev avatar alialnaimi1 avatar tjenkinson 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.