You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SC.stream fails on Firefox, TypeError: t.match(...) is null #68
function p(t) {
if (!t) return 0;
var e = t.match(/\d\S+/)[0].replace(/,/g, ".").split(".");
return parseFloat([e[0], e[1]].join(".")) || 0
}
Error coming from second line. It removes all characters before the first digit in the t string splits the rest by commas. If t = "abc123d,ef" then e = ["123d","ef"]. But you get a type error when there's no digit in the t string.
Not sure why it's only a problem on Firefox. Any ideas?
MchlG, thanks for the solution but could you develop more? I've downloaded SoundManager2 but I'm not really sure what to do, should I place the folder somewhere?
@yimmyao once you have downloaded SoundManager2, grab one of the script files (there are 4, i believe two of them are minified and two of them are for debugging, choose the one you want to use and you can replace it later if you want), place the script file in your folder where index.html resides. Link the js file to index.html , use this script in the head of your index.html...
<script>
soundManager.setup({
url: '/path/to/swf-files/',
flashVersion: 9, // optional: shiny features (default = 8)
// optional: ignore Flash where possible, use 100% HTML5 mode
// preferFlash: false,
onready: function() {
// Ready to use; soundManager.createSound() etc. can now be called.
console.log("sound manager ready")
}
});
</script>
and then use it like this (many other ways to use it, read the documentation it is excellent)
currentSound = soundManager.createSound({
id: //give specific id to this sound,
url: soundcloudStreamURL,
autoLoad: true,
autoPlay: false,
onstop: function(){
//do something when currentSound.stop is called
},
whileloading: function(){
//do something while loading url
},
volume: 50
}).play();
@MchlG thanks for the quick answer! Sorry to bother you again but I've lost you at some point, so I've placed the script where index.html resides (I've chosen soundmanager2.js)
however I didn't understand what to do next when you said "use it like this" should I place that script someplace else too? Also, how do I incorporate it to Firefox?
(You must be having a good laugh by now hah, yes I'm clueless...)
I am not laughing! I am only an egg myself. From your image it looks like you have made a mistake linking the soundmanager.js file after the script you've entered, i think it should be like this
<script src="soundmanager2.js"></script>
<script>
soundManager.setup({
url: '/path/to/swf-files/',
flashVersion: 9, // optional: shiny features (default = 8)
// optional: ignore Flash where possible, use 100% HTML5 mode
// preferFlash: false,
onready: function() {
// Ready to use; soundManager.createSound() etc. can now be called.
console.log("sound manager ready")
}
});
</script>
So the script i've wirrten goes after the link to the soundmanager.js file. Also, make sure that soundmanager.js is in the same directory (same folder) as your index.html file. Then the part that shows how to use it with a soundcloud URL, that goes in your main.js file, which you should link at the bottom of the body of your index.html. Sorry if my instructions are poor, I myself am new to web dev. If you are still unable to figure it out, you can provide me with your email and I can zip up my working project and send it to you that you may test it locally.
Thank you so much, on my way here to see the new instructions... I find that the problem has gone... no updates or anything... just vanished. It's really weird.
Not sure if this helps anyone, but I had the same problem. Turns out it was because I had another Flash plugin installed (VLC Web Plugin from VLC Media Player installation), so when it tried to parse the Flash version number from the player plugin name, it got no matches and thus the crash. Disabling the VLC Firefox plugin solved it for me.
Unfortunately, the offending code is in a file called widget.js, which I can't find anywhere on the soundcloud GitHub. I'm not sure if this is some non-opensourced part of their code or what.
Activity
yimmyao commentedon Aug 4, 2016
I have the same issue. Here's what it says to me:
Error: Permission denied to access property "href"
widget-49c2ff1f.js:8:29302
TypeError: this.getFlashPlugin(...).match(...) is null
widget-49c2ff1f.js:5:4059
Error: Permission denied to access property "href"
widget-49c2ff1f.js:8:29302
TypeError: this.getFlashPlugin(...).match(...) is null
widget-49c2ff1f.js:5:4059
TypeError: this.getFlashPlugin(...).match(...) is null
widget-49c2ff1f.js:5:4059
Error: Permission denied to access property "href"
widget-49c2ff1f.js:8:29302
TypeError: this.getFlashPlugin(...).match(...) is null
widget-49c2ff1f.js:5:4059
Error: Permission denied to access property "href"
It's killing me!
MchlG commentedon Aug 5, 2016
I had same issue. Decided to use SoundManager2 as my audio player and all works well now simply supply audio player with the proper stream-url
yimmyao commentedon Aug 6, 2016
MchlG, thanks for the solution but could you develop more? I've downloaded SoundManager2 but I'm not really sure what to do, should I place the folder somewhere?
MchlG commentedon Aug 6, 2016
@yimmyao once you have downloaded SoundManager2, grab one of the script files (there are 4, i believe two of them are minified and two of them are for debugging, choose the one you want to use and you can replace it later if you want), place the script file in your folder where index.html resides. Link the js file to index.html , use this script in the head of your index.html...
and then use it like this (many other ways to use it, read the documentation it is excellent)
excellent documentation and examples found here... http://www.schillmania.com/projects/soundmanager2/demo/api/
yimmyao commentedon Aug 7, 2016
@MchlG thanks for the quick answer! Sorry to bother you again but I've lost you at some point, so I've placed the script where index.html resides (I've chosen soundmanager2.js)
and If got it right, I placed the script you've written this way: http://i.imgur.com/MZho2Ep.jpg
however I didn't understand what to do next when you said "use it like this" should I place that script someplace else too? Also, how do I incorporate it to Firefox?
(You must be having a good laugh by now hah, yes I'm clueless...)
MchlG commentedon Aug 9, 2016
I am not laughing! I am only an egg myself. From your image it looks like you have made a mistake linking the soundmanager.js file after the script you've entered, i think it should be like this
<script src="soundmanager2.js"></script>So the script i've wirrten goes after the link to the soundmanager.js file. Also, make sure that soundmanager.js is in the same directory (same folder) as your index.html file. Then the part that shows how to use it with a soundcloud URL, that goes in your main.js file, which you should link at the bottom of the body of your index.html. Sorry if my instructions are poor, I myself am new to web dev. If you are still unable to figure it out, you can provide me with your email and I can zip up my working project and send it to you that you may test it locally.
yimmyao commentedon Aug 11, 2016
Thank you so much, on my way here to see the new instructions... I find that the problem has gone... no updates or anything... just vanished. It's really weird.
yagni commentedon Sep 1, 2016
Not sure if this helps anyone, but I had the same problem. Turns out it was because I had another Flash plugin installed (VLC Web Plugin from VLC Media Player installation), so when it tried to parse the Flash version number from the player plugin name, it got no matches and thus the crash. Disabling the VLC Firefox plugin solved it for me.
Unfortunately, the offending code is in a file called widget.js, which I can't find anywhere on the soundcloud GitHub. I'm not sure if this is some non-opensourced part of their code or what.