解决Not allowed to load local resource

在做视频上传的时候,发现Not allowed to load local resource,也弄了很久,怕自己忘记了所以记下来

  bind: function() {
 SelectVideo.on("change", function () { me.BindVedio(this); });

}
//视频绑定
        BindVedio: function (thisFile) {
            var me = this;
            var files = thisFile.files;
            var video = $("video");
            for (var i = 0; i < files.length; i++) {
                    var node = files[i];
                    try {
                        imgURL = node.getAsDataURL();
                    } catch (e) {
                        video.attr("src",window.URL.createObjectURL(node));
                }
            }
        },

  

转载于:https://www.cnblogs.com/biao-123/p/10244111.html

你可能感兴趣的:(解决Not allowed to load local resource)