Permalink
Browse files

Merge pull request #90 from siimv/master

Added plus-sign fix for non-flash based players
  • Loading branch information...
2 parents df603de + 424cadb commit 812764e4edea1849ce21367e07a29e09861c1523 @rodnaph committed Mar 14, 2012
Showing with 17 additions and 1 deletion.
  1. +17 −1 resources/htdocs/js/sockso.Player.js
@@ -182,6 +182,22 @@ sockso.Player = function( options ) {
};
+ /**
+ * Encodes pluses for players (except flash based)
+ * as by default they are decoded as spaces
+ *
+ * @param String playUrl
+ *
+ * @return String
+ *
+ */
+
+ this.encodePluses = function( playUrl ) {
+
+ return playUrl.replace( /\+/gi, "%2B" );
+
+ };
+
/**
* plays a track/artist/etc with the correct play type the user is using
*
@@ -191,7 +207,7 @@ sockso.Player = function( options ) {
if ( !options ) options = {};
- playUrl += "?" + ( extraArgs != undefined && extraArgs != null ? extraArgs : '' );
+ playUrl += "?" + ( extraArgs != undefined && extraArgs != null ? this.encodePluses(extraArgs) : '' );
var trackFilter = ( Properties.get('www.flashPlayer.dontFilterMp3s') == 'yes' )
? '' : '&trackType=mp3';

0 comments on commit 812764e

Please sign in to comment.