html 播放本地视频(获取磁盘文件url)

html:



script:

function play(){
        var file = document.getElementById('v_file').files[0];
        var url = URL.createObjectURL(file);
        console.log(url);
        $("#video").attr("src",url);
        $("#v_file").hide();
    }

你可能感兴趣的:(HTML)