index.js
function timePassed(t) {
    if (t > 0) this.find(".wcp-time-current").text(parseTime(t,this.vlc.length));
    else if (this.find(".wcp-time-current").text() != "" && this.find(".wcp-time-total").text() == "") this.find(".wcp-time-current").text("");

    if (typeof opts[this.context].subtitles === 'undefined') opts[this.context].subtitles = [];

    if (opts[this.context].subtitles.length > 0) {
        // End show subtitle text (external subtitles)
        var nowSecond = (t - opts[this.context].subDelay) /1000;
        if (opts[this.context].trackSub > -2) {
            var subtitle = -1;

            var os = 0;
            for (os in opts[this.context].subtitles) {
                if (os > nowSecond) break;
                subtitle = os;
            }

            if (subtitle > 0) {
                if(subtitle != opts[this.context].trackSub) {
                    if ((opts[this.context].subtitles[subtitle].t.match(new RegExp("<", "g")) || []).length == 2) {
                        if (!(opts[this.context].subtitles[subtitle].t.substr(0,1) == "<" && opts[this.context].subtitles[subtitle].t.slice(-1) == ">")) {
                            opts[this.context].subtitles[subtitle].t = opts[this.context].subtitles[subtitle].t.replace(/<\/?[^>]+(>|$)/g, "");
                        }
                    } else if ((opts[this.context].subtitles[subtitle].t.match(new RegExp("<", "g")) || []).length > 2) {
                        opts[this.context].subtitles[subtitle].t = opts[this.context].subtitles[subtitle].t.replace(/<\/?[^>]+(>|$)/g, "");
                    }
                    this.find(".wcp-subtitle-text").html(nl2br(opts[this.context].subtitles[subtitle].t));
                    opts[this.context].trackSub = subtitle;
                } else if (opts[this.context].subtitles[subtitle].o < nowSecond) {
                    this.find(".wcp-subtitle-text").html("");
                }
            }
        }
        // End show subtitle text (external subtitles)
    }
}
function timePassed(t) {
    if (t > 0) this.find(".wcp-time-current").text(parseTime(t,this.vlc.length));
    else if (this.find(".wcp-time-current").text() != "" && this.find(".wcp-time-total").text() == "") this.find(".wcp-time-current").text("");

    if (typeof opts[this.context].subtitles === 'undefined') opts[this.context].subtitles = [];

    if (opts[this.context].subtitles.length > 0) {
        // End show subtitle text (external subtitles)
        var nowSecond = (t - opts[this.context].subDelay) /1000;
        if (opts[this.context].trackSub > -2) {
            var subtitle = -1;

            var os = 0;
            for (os in opts[this.context].subtitles) {
                if (os > nowSecond) break;
                subtitle = os;
            }

            if (subtitle > 0) {
                if(subtitle != opts[this.context].trackSub) {
                    if ((opts[this.context].subtitles[subtitle].t.match(new RegExp("<", "g")) || []).length == 2) {
                        if (!(opts[this.context].subtitles[subtitle].t.substr(0,1) == "<" && opts[this.context].subtitles[subtitle].t.slice(-1) == ">")) {
                            opts[this.context].subtitles[subtitle].t = opts[this.context].subtitles[subtitle].t.replace(/<\/?[^>]+(>|$)/g, "");
                        }
                    } else if ((opts[this.context].subtitles[subtitle].t.match(new RegExp("<", "g")) || []).length > 2) {
                        opts[this.context].subtitles[subtitle].t = opts[this.context].subtitles[subtitle].t.replace(/<\/?[^>]+(>|$)/g, "");
                    }
                    this.find(".wcp-subtitle-text").html(nl2br(opts[this.context].subtitles[subtitle].t));
                    opts[this.context].trackSub = subtitle;
                } else if (opts[this.context].subtitles[subtitle].o < nowSecond) {
                    this.find(".wcp-subtitle-text").html("");
                }
            }
        }
        // End show subtitle text (external subtitles)
    }
}
player event handlers