|
917 | 917 | * @function |
918 | 918 | */ |
919 | 919 | bootstrap: function () { |
920 | | - evalOpts(this.flowObj.opts.initFileFn, this.fileObj, this); |
| 920 | + if (typeof this.flowObj.opts.initFileFn === "function") { |
| 921 | + this.flowObj.opts.initFileFn(this); |
| 922 | + } |
921 | 923 |
|
922 | 924 | this.abort(true); |
923 | 925 | this.error = false; |
|
1047 | 1049 | /** |
1048 | 1050 | * Default read function using the webAPI |
1049 | 1051 | * |
1050 | | - * @function webAPIFileRead(chunk, startByte, endByte, fileType) |
| 1052 | + * @function webAPIFileRead(fileObj, fileType, startByte, endByte, chunk) |
1051 | 1053 | * |
1052 | 1054 | */ |
1053 | | - function webAPIFileRead(chunk, startByte, endByte, fileType) { |
1054 | | - var function_name = (chunk.fileObj.file.slice ? 'slice' : |
1055 | | - (chunk.fileObj.file.mozSlice ? 'mozSlice' : |
1056 | | - (chunk.fileObj.file.webkitSlice ? 'webkitSlice' : |
1057 | | - 'slice'))); |
1058 | | - chunk.readFinished(chunk.fileObj.file[function_name](startByte, endByte, fileType)); |
| 1055 | + function webAPIFileRead(fileObj, fileType, startByte, endByte, chunk) { |
| 1056 | + var function_name = 'slice'; |
| 1057 | + |
| 1058 | + if (fileObj.file.slice) |
| 1059 | + function_name = 'slice'; |
| 1060 | + else if (fileObj.file.mozSlice) |
| 1061 | + function_name = 'mozSlice'; |
| 1062 | + else if (fileObj.file.webkitSlice) |
| 1063 | + function_name = 'webkitSlice'; |
| 1064 | + |
| 1065 | + chunk.readFinished(fileObj.file[function_name](startByte, endByte, fileType)); |
1059 | 1066 | } |
1060 | 1067 |
|
1061 | 1068 |
|
|
1324 | 1331 | switch (this.readState) { |
1325 | 1332 | case 0: |
1326 | 1333 | this.readState = 1; |
1327 | | - read(this, this.startByte, this.endByte, this.fileType); |
| 1334 | + read(this.fileObj, this.startByte, this.endByte, this.fileType, this); |
1328 | 1335 | return; |
1329 | 1336 | case 1: |
1330 | 1337 | return; |
|
0 commit comments