webupload的分段上传

一:视频的暂停,开始
注意stop中的true!!我就是刚开始没传,结果暂停没作用!!

 $upload.on('click', function() {

            if ( $(this).hasClass( 'disabled' ) ) {
                return false;
            }

            if ( state === 'ready' ) {
                uploader.upload();
            } else if ( state === 'paused' ) {
                uploader.upload();
            } else if ( state === 'uploading' ) {
                uploader.stop(true);
            }
        });

二:上传成功后,如何获取后台返回的参数(uploadSuccess):

 uploader.on( 'uploadSuccess', function( file ,response) {
          
                if(response.status==1)
                {
                    window.parent.document.getElementById('video_path').value=response.path
                   
                    $(".state-finish").text('上传成功')

                }else{
                    alert('上传失败!!')
                }
            });

你可能感兴趣的:(webupload的分段上传)