<commit_before>/*
 *  youtube singleton oh yeah! 
 */
var youtube = {
    obj: null //will hold the current youtube embed

    ,togglePlay: function(){
        //unstarted (-1), ended (0), playing (1), 
        //paused (2), buffering (3), video cued (5)
        if(youtube.obj.getPlayerState() !== 1){
            youtube.obj.playVideo();
        }else{
            youtube.obj.pauseVideo();
        }
    }

    ,stateListener: function(state){
        if(globals.auto){ //global scope
            if(state === 0){
                loadVideo('next');  //tv.js
            }else if(state === -1){
                youtube.togglePlay();
            }
        }
    }

    ,errorListener: function(error){
        consoleLog('youtube error received: '+error);
        loadVideo('next');
    }

    ,createEmbed: function(url){
        var ID, parts;<commit_msg>force minimum of 480p for youtube videos<commit_after>/*
 *  youtube singleton oh yeah! 
 */
var youtube = {
    obj: null //will hold the current youtube embed

    ,togglePlay: function(){
        //unstarted (-1), ended (0), playing (1), 
        //paused (2), buffering (3), video cued (5)
        if(youtube.obj.getPlayerState() !== 1){
            youtube.obj.playVideo();
        }else{
            youtube.obj.pauseVideo();
        }
    }

    ,stateListener: function(state){
        if(globals.auto){ //global scope
            if(state === 0){
                loadVideo('next');  //tv.js
            }else if(state === -1){
                youtube.togglePlay();
            }else if(state === 1){
                var qual = youtube.obj.getPlaybackQuality();
                var avail = youtube.obj.getAvailableQualityLevels();
                consoleLog('quality: '+qual);
                consoleLog('available: '+avail);
                if((qual === 'small' || qual === 'medium') && avail.indexOf('large') !== -1){
                    consoleLog('trying to force large');
                    youtube.obj.setPlaybackQuality('large');
                }
            }
        }
    }

    ,errorListener: function(error){
        consoleLog('youtube error received: '+error);
        loadVideo('next');
    }

    ,createEmbed: function(url){
        var ID, parts;
{'fraction_non_alphanumeric': 0.1495745633676668, 'fraction_numerical': 0.010300044782803403, 'mean_word_length': 1.7444717444717446, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5676178', 'n_tokens_mistral': 685, 'n_tokens_neox': 601, 'n_words': 149}