Coder Social home page Coder Social logo

lingo-player's Introduction

Description

Open source, cross-platform video player with language learning features.

  • Based on VLC player, offers dictionary lookup for subtitles, word pronunciation and word saving features
  • Works with 90 languages (8100 language combinations!), since it's using Google Translate

To download Windows release go here: http://oaprograms.github.io/lingo-player

How it works:

Let's say you are learning Spanish:

  • Open a Spanish movie, with Spanish subtitles, and optionally 2nd subtitles in your language.
  • Hover over any word to see translations to your language, click on it hear it and to save it to dictionary.
  • You can mark words with 4 levels of familiarity (New - red, Recognized - orange, Familiar - yellow and Known - green)
  • You can look up list of saved words any time and read subtitles in subtitle listing mode.

Used Technologies

Prerequisites

Installation

  • npm install

Contributing

Anyone is very welcome to contribute to this project. In case you are interested, contact me at ognjen.apic at gmail.com, or start an issue.

Planned features in future (help is welcome):

  • Make OSX version
  • Add more dictionary sources
  • Lemmatization / stemming?
  • Highlight frequent words?
  • Translate app UI into several languages

Screenshots

Main screen Words dialog File dialog Main screen

Licence

MIT

lingo-player's People

Contributors

oaprograms avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

lingo-player's Issues

Extended Subtitle Support

Saw this in the readme:

Support more subtitle formats (currently supports .srt and .sub)

In actuality, wcjs-player supports .srt, .sub and .vtt

I was going to add .ass, .ssa and .txt support based on @vankasteelj 's code but never got to it.

The code itself converts the 3 types mentioned above to .srt, ideally this should be changed to just parse the subs. Hope it helps.

var rl = readline.createInterface({
    input: fs.createReadStream(path.join(origPath, orig)),
    output: process.stdout,
    terminal: false
});
rl.on('line', function (line) {
    //detect encoding
    var charset = charsetDetect.detect(line);
    var encoding = charset.encoding;
    var line_, parsedBeginTime, parsedEndTime, parsedDialog;
    //parse SSA
    if (ext === '.ssa' || ext === '.ass') {
        encoding = 'utf-8';
        if (line.indexOf('Format:') !== -1) {
            var ssaFormat = line.split(',');
            for (var i = 0; i < ssaFormat.length; i++) {
                switch (ssaFormat[i]) {
                    case 'Text':
                    case ' Text':
                         dialog = i;
                         break;
                    case 'Start':
                    case ' Start':
                        begin_time = i;
                        break;
                    case 'End':
                    case ' End':
                        end_time = i;
                        break;
                    default:
                }
            }
            if (dialog && begin_time && end_time) {
                console.debug('SUB formatted in \'ssa\'');
            }
            return; //we have the elms spots, move on to the next line
        }
        if (line.indexOf('Dialogue:') === -1) { //not a dialog line
            return;
        }
        line_ = line.split(',');
        parsedBeginTime = line_[begin_time];
        parsedEndTime = line_[end_time];
        parsedDialog = line_[dialog];
        parsedDialog = parsedDialog.replace('{\\i1}', '<i>').replace('{\\i0}', '</i>'); //italics
        parsedDialog = parsedDialog.replace('{\\b1}', '<b>').replace('{\\b0}', '</b>'); //bold
        parsedDialog = parsedDialog.replace('\\N', '\n'); //return to line
        parsedDialog = parsedDialog.replace(/{.*?}/g, ''); //remove leftovers brackets 
    }
    //parse TXT
    if (ext === '.txt') {
        line_ = line.split('}');
        var formatSeconds = function (seconds) {
            var date = new Date(1970, 0, 1);
            date.setSeconds(seconds);
            return date.toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, '$1');
        };
        parsedBeginTime = formatSeconds(line_[0].replace('{', '') / 25);
        parsedEndTime = formatSeconds(line_[1].replace('{', '') / 25);
        parsedDialog = line_[2].replace('|', '\n');
    }
    //SRT needs a number for each subtitle
    counter += 1;
    //keep only the last lang
    if (parsedBeginTime < lastBeginTime) {
        counter = 1;
        fs.writeFileSync(path.join(srtPath, srt), '');
        console.debug('SUB contains multiple tracks, keeping only the last');
    }
    //SRT formatting
    var parsedLine = counter + '\n' + parsedBeginTime + ' --> ' + parsedEndTime + '\n' + parsedDialog;
    fs.appendFileSync(path.join(srtPath, srt), '\n\n' + parsedLine, encoding);
    lastBeginTime = parsedBeginTime;
});
fs.readFile(path.join(srtPath, srt), function (err, dataBuff) {
    if (!err) {
        console.debug('SUB transcoded to SRT:', srt);
        callback(dataBuff);
    } else {
        console.warn('SUB transcoding failed', err);
    }
});

very laggy full hd video

im playing a 1080p video on an amd a8-7100 with radeon r6 on windows 8.1. (i am aware this is not the latest laptop out there)
however other video players work without any flaws this one is very hardware intensive and having hiccups during just playing the video.

Changing audio track

Thank you for this extension: this is exactly what I was looking for. The translation works really well.
However, I cannot choose an audio track. There are some movies with different audio tracks, and there is no way to change them...

No connection

Im using windows10 on VB when hover on word it say "no connection" while few seconds ago it downloaded subtitles with no problem

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.