<commit_before>// video-tt-demo.js
// Copyright <NAME> 2012
// http://www.kaizou.org

window.addEventListener("load",init,false);
var video;
function init(event){
    video = document.getElementById("video");
}
function setSubtitle(se){
    language = se.options[se.selectedIndex].value;
    tracks = video.textTracks;
    for(var j=0; j < tracks.length;j++){
        track = video.textTracks[j];
        if(track.kind === "subtitles"){
            if(track.language == language){
                track.mode = 'showing';
            }else{
                track.mode = 'disabled';
            }
        }
    }
} 
function displayChapters(trackElt){
    if((trackElt) && (textTrack = trackElt.track)){
        if(textTrack.kind === "chapters"){
            var chapterBlock = document.getElementById("chapters");
            for (var i = 0; i < textTrack.cues.length; ++i) {
                var cue = textTrack.cues[i];
                var input = document.createElement("input");
                input.type = "radio"
                input.name = "chapters"
                input.value = cue.startTime;
                input.id = "CHAPTERID" + cue.startTime;
                input.addEventListener("click",
                                        function(evt){
                                            var canvas = document.getElementById('canvas');
                                            var ctx = canvas.getContext('2d');
                                            ctx.drawImage(video,0, 0,video.videoWidth,video.videoHeight,0,0,canvas.width,canvas.height);<commit_msg>Minor updates to improve readability<commit_after>// video-tt-demo.js
// Copyright <NAME> 2012
// http://www.kaizou.org

window.addEventListener("load",init,false);
var video;
function init(event){
    video = document.getElementById("video");
}
function setSubtitle(se){
    language = se.options[se.selectedIndex].value;
    tracks = video.textTracks;
    for(var j=0; j < tracks.length;j++){
        track = video.textTracks[j];
        if(track.kind === "subtitles"){
            if(track.language == language){
                track.mode = 'showing';
            }else{
                track.mode = 'disabled';
            }
        }
    }
} 
function displayChapters(trackElt){
    if((trackElt) && (textTrack = trackElt.track)){
        if(textTrack.kind === "chapters"){
            textTrack.mode = 'hidden';
            var chapterBlock = document.getElementById("chapters");
            for (var i = 0; i < textTrack.cues.length; ++i) {
                var cue = textTrack.cues[i];
                var input = document.createElement("input");
                input.type = "radio"
                input.name = "chapters"
                input.value = cue.startTime;
                input.id = "CHAPTERID" + cue.startTime;
                input.addEventListener("click",
                                        function(evt){
                                            var canvas = document.getElementById('canvas');
                                            var ctx = canvas.getContext('2d');
                                            ctx.drawImage(video,0, 0,video.videoWidth,video.videoHeight,0,0,canvas.width,canvas.height);
{'fraction_non_alphanumeric': 0.13058312655086848, 'fraction_numerical': 0.006823821339950372, 'mean_word_length': 1.698744769874477, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '403660', 'n_tokens_mistral': 871, 'n_tokens_neox': 830, 'n_words': 157}