Put simply, I\'d like to play a blob MP3 file in Firefox.
I have access to both the blob itself: blob
(sliced with mime type audio/mpeg3
),
This seems to work fine for me, although I'm using audio/mpeg
as the MIME Type:
$scope.player = new window.Audio();
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
$scope.player.src = window.URL.createObjectURL(this.response);
$scope.player.play();
}
};
xhr.open('GET', url);
xhr.responseType = 'blob';
xhr.send();