Closed smohammedyasin closed 6 years ago
@aadsm I'm also getting this error, everything was working fine before today.
I'v uploaded the .mp3 file. I am on latest chrome version.
Odd, I’ll try to get a look into it this weekend.
Following from above, I am seeing the same error. The majority of this text has been copied on Guthub as well. The onError event handler for the jsmediatags.open method receives an error object with properties:
type = "fileReader"
info = "Offset 0 hasn't been loaded yet"
Pseudo-code below.
I'm running this on my local workstation, with a Windows 7 OS running IIS. I've tested in Chrome v 61, and Firefox v 55. Same error in both.
As you can see, I'm trying to first send the file object (as a file) into the jsmediatags.read function. This results in the error detailed above.
I've commented out the code where, instead of the file object, I try sending in 1.) the complete local path to the file, 2.) the result of createObjectURL on the file object, as well as 3.) the file object's name property. These last 3 do not result in either an onSuccess or onError event being fired.
<script type="text/javascript" src="tagreader/jsmediatags.js"></script>
I am seeing the same error. The onError event handler for the jsmediatags.open method receives an error object with properties:
type = "fileReader"
info = "Offset 0 hasn't been loaded yet"
pseudo-code below.
I'm running this on my local workstation, with a Windows 7 OS running IIS. I've tested in Chrome v 61, and Firefox v 55. Same error in both.
As you can see, I'm trying to first send the file object (as a file) into the jsmediatags.read function. This results in the error detailed above.
I've commented out the code where, instead of the file object, I try sending in 1.) the complete local path to the file, 2.) the result of createObjectURL on the file object, as well as 3.) the file object's name property. These last 3 do not result in either an onSuccess or onError event being fired.
<script type="text/javascript" src="tagreader/jsmediatags.js"></script>
<input type="file" id="fileinput" onchange="window.handleLocalFiles(this.files)">
<script>
var gobjFileTags = null;
function handleLocalFiles(argFiles){
if (argFiles && (argFiles.length > 0)){
testTagReader(argFiles[0]);
}
}
function testTagReader(objFile){
var objTagReader = null;
var strURL = "";
var strFileName = "";
var strLocalPath = "";
// strFileName = objFile.name;
// strURL = window.URL.createObjectURL(objFile);
// var strLocalPath = "c:/users/public/public music/sample music/kalimba.mp3";
objTagReader = window.jsmediatags;
objTagReader.read(objFile, {
// objTagReader.read(strLocalPath, {
// objTagReader.read(strURL, {
// objTagReader.read(strFileName, {
onSuccess: function(tag){
window.gobjFileTags = tag;
window.readFileTags();
},
onError: function(objError){
window.alert("objTagReader Error - type: " + objError.type + ", info: " + objError.info);
}
});
}
function readFileTags(){
window.alert("readFileTags called");
}
I'm having the same issue. Trying to use in a Chrome app.
I've tracked this issue down. It was introduced in 7d5902a when some Flow errors were fixed.
The culprit is BlobFileReader.js
line 45, in which an ArrayBuffer
is casted to a Number
. This fails and we get the offset error.
Here's a screenshot showing the issue:
I'll raise a PR to fix the issue shortly.
@chrisparton1991 this is gold! I’ve been a bit strapped for time lately, so thank you so much for stepping in and finding the root cause! Will wait for your PR.
hello, i'm try to get from input file with function, but i'm getting error ""Offset 0 hasn't been loaded yet"
html colde:
<input type="file" id="file" onchange="loadFile(this)">
java script code:
Please help Yasin