/* global NicoCache_nl */

"use strict";

function checkReEncoding(elem, videoId) {
    if (elem.innerText === 'wait...') return;
    elem.innerText = "wait...";
    var url = "/cache/reEncodingChecker";
    NicoCache_nl.get(url, videoId, function(xhr) {
        var result = JSON.parse(xhr.responseText);
        if (result.status === "OK") {
            elem.innerText = result.reencoded ? "reencoded" : "RAW";
        } else {
            elem.innerText = "failed: " + result.status;
        }
    });
    
}

(function(){

})();
