User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:97.0) Gecko/20100101 Firefox/97.0 Steps to reproduce: I have this minimal Web Page source code (Also, see attachment): <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <body> <input type="file" id="fileinput"> <audio controls id="audio" > <script> const fileInput = document.getElementById('fileinput'); const audio = document.getElementById('audio'); fileInput.onchange = function(e){ console.log(e.target.files) const fileReader = new FileReader() fileReader.onload = () => { audio.src = fileReader.result; } fileReader.onerror = console.error; fileReader.onabort = () => console.log("File Reader aborted!") fileReader.readAsDataURL(e.target.files[0]) } </script> </body> </html> A audio file (e.g. .wav, .flac, .mp3) is read by a <input type="file"> tag and converted to a Data URL by a FileReader. In other words: The problem occurs when trying to set a "Data URL" as a src attribute of an HTML Audio tag. The same applies when using a separate <source> tag as the child of the audio tag. Steps to reproduce: 1. Open the HTML file according to the source code above (or see attachment) 2. Upload an audio file, at least 30mb in size 3. click the play icon of the audio player Actual results: The Audio Player displays 0:00 as audio length and no audio plays when starting the audio player. In the console, this Warning is displayed: "Invalid URI. Load of media resource data:audio/flac;base64,Zkx........" Expected results: No warnings should be displayed in the console. The audio player should display the actual length of the audio file and the audio file should be played. The bug ocurred on: Firefox 97.0 (64-bit) This was tested and did not occur on: Firefox for Linux Mint 95.0.1 (64-bit) Chromium Version 98.0.4758.102 (Official Build) snap (64-bit)
Bug 1757387 Comment 0 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:97.0) Gecko/20100101 Firefox/97.0 Steps to reproduce: I have this minimal Web Page source code (Also, see attachment): ```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <body> <input type="file" id="fileinput"> <audio controls id="audio" > <script> const fileInput = document.getElementById('fileinput'); const audio = document.getElementById('audio'); fileInput.onchange = function(e){ console.log(e.target.files) const fileReader = new FileReader() fileReader.onload = () => { audio.src = fileReader.result; } fileReader.onerror = console.error; fileReader.onabort = () => console.log("File Reader aborted!") fileReader.readAsDataURL(e.target.files[0]) } </script> </body> </html> ``` A audio file (e.g. .wav, .flac, .mp3) is read by a <input type="file"> tag and converted to a Data URL by a FileReader. In other words: The problem occurs when trying to set a "Data URL" as a src attribute of an HTML Audio tag. The same applies when using a separate <source> tag as the child of the audio tag. Steps to reproduce: 1. Open the HTML file according to the source code above (or see attachment) 2. Upload an audio file, at least 30mb in size 3. click the play icon of the audio player Actual results: The Audio Player displays 0:00 as audio length and no audio plays when starting the audio player. In the console, this Warning is displayed: "Invalid URI. Load of media resource data:audio/flac;base64,Zkx........" Expected results: No warnings should be displayed in the console. The audio player should display the actual length of the audio file and the audio file should be played. The bug ocurred on: Firefox 97.0 (64-bit) This was tested and did not occur on: Firefox for Linux Mint 95.0.1 (64-bit) Chromium Version 98.0.4758.102 (Official Build) snap (64-bit)