MP3-jPlayer - Version 2.3.1

Version Description

  • Added developer methods for hooking into the player's Javascript events, these also add support for some of the up-coming extensions.
  • Corrected the help message admin-side that shows on the widget when it's set to an invalid path.
Download this release

Release Info

Developer simon.ward
Plugin Icon 128x128 MP3-jPlayer
Version 2.3.1
Comparing to
See all releases

Code changes from version 2.3 to 2.3.1

js/admin/admin-colours.js CHANGED
@@ -26,8 +26,17 @@ var MP3jP = {
26
  }
27
  },
28
 
29
-
30
 
 
 
 
 
 
 
 
 
 
 
31
 
32
 
33
  /** Colour Picking */
@@ -84,6 +93,7 @@ var MP3jP = {
84
  var style = {};
85
  style[this.CSSprop] = colour;
86
  jQuery('#player' + partid ).css( style ); //player
 
87
  }
88
  },
89
 
26
  }
27
  },
28
 
 
29
 
30
+ extCalls: {
31
+ init: [],
32
+ update_colour: []
33
+ },
34
+ runExternals: function ( hookname, data ) {
35
+ var l = this.extCalls[ hookname ].length;
36
+ for ( var x = 0; x < l; x += 1 ) {
37
+ ( this.extCalls[ hookname ][ x ] )( data );
38
+ }
39
+ },
40
 
41
 
42
  /** Colour Picking */
93
  var style = {};
94
  style[this.CSSprop] = colour;
95
  jQuery('#player' + partid ).css( style ); //player
96
+ this.runExternals( 'update_colour', { pickID: pickID, colour: colour, partID: this.partID } );
97
  }
98
  },
99
 
js/{mp3-jplayer-2.3.js → mp3-jplayer-2.3.1.js} RENAMED
@@ -1,7 +1,8 @@
1
  /*
2
  MP3-jPlayer
3
- Version 2.3
4
- http://mp3-jplayer.com
 
5
  */
6
 
7
  var MP3_JPLAYER = {
@@ -25,7 +26,21 @@ var MP3_JPLAYER = {
25
  plugin_path: '',
26
  lastformats: 'mp3',
27
  allowRanges: true,
28
- extCalls: { init:[], change_pre:[], change_post:[], download:[], error:[] },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  extStyles: [],
30
  extJS: [],
31
  skinJS: '',
@@ -77,17 +92,22 @@ var MP3_JPLAYER = {
77
  img: '#MI_image_'
78
  },
79
 
 
 
 
 
 
 
 
80
  initialise_jp: function ( supplied, track, vol ) {
81
  var that = this;
82
- //console.log('jp init: ' + supplied );
83
  jQuery(this.jpID).jPlayer({
84
  ready: function () {
85
  if ( track === true ) {
86
  var dinfo = that.deviceInfo();
87
  if ( dinfo.device === 'Desk/Laptop' ) {
88
  that.startup();
89
- } else {
90
- //just remove first autolay if there's any
91
  var j;
92
  for ( j in that.pl_info ) {
93
  if ( that.pl_info[j].autoplay ) {
@@ -111,7 +131,6 @@ var MP3_JPLAYER = {
111
  wmode: "window",
112
  solution:"html, flash",
113
  error: function( event ) {
114
- //console.log( 'iE:: ' + event.jPlayer.error.type );
115
  that.check_show_jperrors( event );
116
  },
117
  preload: "none"
@@ -144,23 +163,14 @@ var MP3_JPLAYER = {
144
  },
145
 
146
  init: function () {
147
- var l;
148
- var x;
149
- var callback;
150
  var plpath;
151
-
152
  plpath = this.plugin_path.split('/');
153
  this.dl_domain = plpath[2].replace(/^www./i, "");
154
 
155
  this.unwrap();
156
  this.write_controls();
157
  this.add_jpconstruct_div();
158
-
159
- l = this.extCalls.init.length;
160
- for ( x = 0; x < l; x += 1 ) {
161
- callback = this.extCalls.init[ x ];
162
- callback();
163
- }
164
  this.addExtStyles();
165
  this.initialise_jp( this.lastformats, true, 1 );
166
  },
@@ -206,12 +216,7 @@ var MP3_JPLAYER = {
206
 
207
  if ( this.exData !== false ) {
208
  this.exData.jperror = errortype;
209
- var x;
210
- var l = this.extCalls.change_post.length;
211
- for ( x = 0; x < l; x += 1 ) {
212
- var callback = this.extCalls.change_post[ x ];
213
- callback( this.exData );
214
- }
215
  this.exData = false;
216
  }
217
  },
@@ -301,17 +306,11 @@ var MP3_JPLAYER = {
301
  }
302
  }
303
  }
304
-
305
  if ( pt >= this.exThresh && this.exData !== false ) {
306
- var x;
307
- var l = this.extCalls.change_post.length;
308
- for ( x = 0; x < l; x += 1 ) {
309
- var callback = this.extCalls.change_post[ x ];
310
- callback( this.exData );
311
- }
312
  this.exData = false;
313
  }
314
-
315
  this.played_t = pt;
316
  this.total_t = tt;
317
  this.pp_abs = ppA;
@@ -361,7 +360,7 @@ var MP3_JPLAYER = {
361
  var i, li, sel, that = this, p = this.pl_info[j];
362
 
363
  //PLAYLISTERS and SINGLES
364
- if ('MI' === p.type || 'single' === p.type) {
365
  jQuery(this.eID.vol + j).slider({
366
  value : p.vol,
367
  max: 100,
@@ -541,9 +540,6 @@ var MP3_JPLAYER = {
541
 
542
  E_stop: function ( j, caller ) {
543
  var exData = { pT:'', tT:'', pState: '', pU: '', lp:'', ppA:'', jperror:'' };
544
- var l;
545
- var x;
546
-
547
  if (j === this.tID && j !== '') {
548
  var preL = (this.tID !== '' ) ? this.pl_info[this.tID].list : false;
549
  var pU = ( preL !== false ) ? preL[ this.pl_info[this.tID].tr ].mp3 : '';
@@ -558,12 +554,9 @@ var MP3_JPLAYER = {
558
  } else {
559
  exData = this.exData;
560
  }
 
561
  if ( caller !== 'Echange' && this.jperrorIDs[j] === false ) {
562
- l = this.extCalls.change_pre.length;
563
- for ( x = 0; x < l; x += 1 ) {
564
- var callback = this.extCalls.change_pre[ x ];
565
- callback( exData );
566
- }
567
  }
568
 
569
  this.clearit();
@@ -583,7 +576,6 @@ var MP3_JPLAYER = {
583
  }
584
  this.load_pc = 0;
585
  this.played_t = 0;
586
-
587
  jQuery('#mp3j_nosolution_' + j).empty().hide();
588
  }
589
  return exData;
@@ -604,8 +596,8 @@ var MP3_JPLAYER = {
604
  var track;
605
  var txt;
606
  var p = this.pl_info[j];
607
- var x;
608
- var l;
609
 
610
  if (j === this.tID && change === p.tr) {
611
  if ('playing' === this.state) {
@@ -625,6 +617,7 @@ var MP3_JPLAYER = {
625
  return;
626
  }
627
  }
 
628
  var exData = this.E_stop( this.tID, 'Echange' );
629
 
630
  if ('prev' === change) {
@@ -670,11 +663,15 @@ var MP3_JPLAYER = {
670
  exData.name = p.list[track].name;
671
  exData.artist = p.list[track].artist;
672
  this.exData = exData;
 
673
  },
674
 
675
  E_launchPP: function (j) {
676
  this.launched_ID = j;
677
  this.was_playing = ( this.state === "playing" ) ? true : false;
 
 
 
678
 
679
  if ( this.tID !== '' ) {
680
  this.E_stop(this.tID);
@@ -707,7 +704,6 @@ var MP3_JPLAYER = {
707
  media[ track.formats[1] ] = track.counterpart;
708
  }
709
  }
710
- //console.log(media);
711
  jQuery(this.jpID).jPlayer( "setMedia", media );
712
  },
713
 
@@ -733,6 +729,7 @@ var MP3_JPLAYER = {
733
  jQuery( this.eID.play + j ).removeClass( 'pause-mjp' ).addClass( 'play-mjp' ).empty().append( this.pl_info[j].play_txt );
734
  }
735
  }
 
736
  },
737
 
738
  listclass: function ( j, rem, add ) {
@@ -741,6 +738,7 @@ var MP3_JPLAYER = {
741
  },
742
 
743
  titles: function ( j, track ) {
 
744
  var p = this.pl_info[j], Olink = '', Clink = '';
745
  var img = p.list[track].image;
746
  if (p.type === "MI") {
@@ -756,16 +754,21 @@ var MP3_JPLAYER = {
756
  jQuery(this.eID.img + j).empty().hide().append(Olink + '<img src="' + p.list[track].image + '" />' + Clink).fadeIn(300);
757
  }
758
  }
 
 
759
  },
760
 
761
  writedownload: function ( j, track ) {
 
762
  var p = this.pl_info[j];
763
- if (p.download) {
764
  jQuery(this.eID.dload + j).empty().removeClass('whilelinks').append('<a id="mp3j_dlanchor_' + j + '" href="' + p.list[track].mp3 + '" target="_blank">' + this.vars.dload_text + '</a>');
765
  if ( this.vars.force_dload === true ) {
766
  this.dl_button_click( j );
767
  }
768
  }
 
 
769
  },
770
 
771
  togglelist: function ( j ) {
@@ -858,21 +861,17 @@ var MP3_JPLAYER = {
858
  }
859
  };
860
 
861
- // Force browser download
 
 
 
 
 
862
  MP3_JPLAYER.dl_button_click = function ( j ) {
863
  var that = this, p = this.pl_info[j];
864
  jQuery('#mp3j_dlanchor_' + j).click(function (e) {
865
-
866
  that.dl_runinfo( p.list[p.tr].mp3, j, e );
867
-
868
- var x;
869
- var l = that.extCalls.download.length;
870
- var callback;
871
- for ( x = 0; x < l; x += 1 ) {
872
- callback = that.extCalls.download[ x ];
873
- callback( p.list[p.tr] );
874
- }
875
-
876
  e.preventDefault();
877
  });
878
  };
@@ -928,7 +927,6 @@ MP3_JPLAYER.dl_runinfo = function ( get, j, e ) {
928
  }
929
  };
930
 
931
-
932
  MP3_JPLAYER.dl_interval_check = function ( j, can_write ) {
933
  if ( can_write !== false && this.read_cookie('mp3Download' + j) === 'true' ) { //got cookie back, all should be good
934
  this.dl_dialogue( j, this.vars.message_ok, 'hide');
@@ -979,6 +977,8 @@ MP3_JPLAYER.dl_dialogue = function ( j, text, state ) {
979
  }
980
  jQuery('#mp3j_finfo_' + j).fadeOut(1000);
981
  }
 
 
982
  };
983
 
984
  MP3_JPLAYER.read_cookie = function ( name ) {
1
  /*
2
  MP3-jPlayer
3
+ Version 2.3.1
4
+ http://mp3-jplayer.com
5
+ 2015 Simon Ward
6
  */
7
 
8
  var MP3_JPLAYER = {
26
  plugin_path: '',
27
  lastformats: 'mp3',
28
  allowRanges: true,
29
+ extCalls: {
30
+ init:[],
31
+ change_pre: [],
32
+ change_begin: [],
33
+ change_end: [],
34
+ change_post: [],
35
+ button_playpause: [],
36
+ button_popout: [],
37
+ update_time: [],
38
+ write_titles: [],
39
+ write_download: [],
40
+ download: [],
41
+ download_dialog: [],
42
+ error: []
43
+ },
44
  extStyles: [],
45
  extJS: [],
46
  skinJS: '',
92
  img: '#MI_image_'
93
  },
94
 
95
+ runExternals: function ( hookname, data ) {
96
+ var l = this.extCalls[ hookname ].length;
97
+ for ( var x = 0; x < l; x += 1 ) {
98
+ ( this.extCalls[ hookname ][ x ] )( data );
99
+ }
100
+ },
101
+
102
  initialise_jp: function ( supplied, track, vol ) {
103
  var that = this;
 
104
  jQuery(this.jpID).jPlayer({
105
  ready: function () {
106
  if ( track === true ) {
107
  var dinfo = that.deviceInfo();
108
  if ( dinfo.device === 'Desk/Laptop' ) {
109
  that.startup();
110
+ } else { //just remove first autolay if there's any
 
111
  var j;
112
  for ( j in that.pl_info ) {
113
  if ( that.pl_info[j].autoplay ) {
131
  wmode: "window",
132
  solution:"html, flash",
133
  error: function( event ) {
 
134
  that.check_show_jperrors( event );
135
  },
136
  preload: "none"
163
  },
164
 
165
  init: function () {
 
 
 
166
  var plpath;
 
167
  plpath = this.plugin_path.split('/');
168
  this.dl_domain = plpath[2].replace(/^www./i, "");
169
 
170
  this.unwrap();
171
  this.write_controls();
172
  this.add_jpconstruct_div();
173
+ this.runExternals( 'init', {} );
 
 
 
 
 
174
  this.addExtStyles();
175
  this.initialise_jp( this.lastformats, true, 1 );
176
  },
216
 
217
  if ( this.exData !== false ) {
218
  this.exData.jperror = errortype;
219
+ this.runExternals( 'change_post', this.exData );
 
 
 
 
 
220
  this.exData = false;
221
  }
222
  },
306
  }
307
  }
308
  }
309
+ this.runExternals( 'update_time', { pt: pt, id: j } );
310
  if ( pt >= this.exThresh && this.exData !== false ) {
311
+ this.runExternals( 'change_post', this.exData );
 
 
 
 
 
312
  this.exData = false;
313
  }
 
314
  this.played_t = pt;
315
  this.total_t = tt;
316
  this.pp_abs = ppA;
360
  var i, li, sel, that = this, p = this.pl_info[j];
361
 
362
  //PLAYLISTERS and SINGLES
363
+ if ('MI' === p.type || 'single' === p.type) {
364
  jQuery(this.eID.vol + j).slider({
365
  value : p.vol,
366
  max: 100,
540
 
541
  E_stop: function ( j, caller ) {
542
  var exData = { pT:'', tT:'', pState: '', pU: '', lp:'', ppA:'', jperror:'' };
 
 
 
543
  if (j === this.tID && j !== '') {
544
  var preL = (this.tID !== '' ) ? this.pl_info[this.tID].list : false;
545
  var pU = ( preL !== false ) ? preL[ this.pl_info[this.tID].tr ].mp3 : '';
554
  } else {
555
  exData = this.exData;
556
  }
557
+
558
  if ( caller !== 'Echange' && this.jperrorIDs[j] === false ) {
559
+ this.runExternals( 'change_pre', exData );
 
 
 
 
560
  }
561
 
562
  this.clearit();
576
  }
577
  this.load_pc = 0;
578
  this.played_t = 0;
 
579
  jQuery('#mp3j_nosolution_' + j).empty().hide();
580
  }
581
  return exData;
596
  var track;
597
  var txt;
598
  var p = this.pl_info[j];
599
+
600
+ this.runExternals( 'change_begin', { id: j, change: change } );
601
 
602
  if (j === this.tID && change === p.tr) {
603
  if ('playing' === this.state) {
617
  return;
618
  }
619
  }
620
+
621
  var exData = this.E_stop( this.tID, 'Echange' );
622
 
623
  if ('prev' === change) {
663
  exData.name = p.list[track].name;
664
  exData.artist = p.list[track].artist;
665
  this.exData = exData;
666
+ this.runExternals( 'change_end', exData );
667
  },
668
 
669
  E_launchPP: function (j) {
670
  this.launched_ID = j;
671
  this.was_playing = ( this.state === "playing" ) ? true : false;
672
+ var data = { id: this.launched_ID, playing: this.was_playing };
673
+
674
+ this.runExternals( 'button_popout', data );
675
 
676
  if ( this.tID !== '' ) {
677
  this.E_stop(this.tID);
704
  media[ track.formats[1] ] = track.counterpart;
705
  }
706
  }
 
707
  jQuery(this.jpID).jPlayer( "setMedia", media );
708
  },
709
 
729
  jQuery( this.eID.play + j ).removeClass( 'pause-mjp' ).addClass( 'play-mjp' ).empty().append( this.pl_info[j].play_txt );
730
  }
731
  }
732
+ this.runExternals( 'button_playpause', { type: type } );
733
  },
734
 
735
  listclass: function ( j, rem, add ) {
738
  },
739
 
740
  titles: function ( j, track ) {
741
+ var data;
742
  var p = this.pl_info[j], Olink = '', Clink = '';
743
  var img = p.list[track].image;
744
  if (p.type === "MI") {
754
  jQuery(this.eID.img + j).empty().hide().append(Olink + '<img src="' + p.list[track].image + '" />' + Clink).fadeIn(300);
755
  }
756
  }
757
+ data = { title: p.list[track].name, caption: p.list[track].artist, id: j };
758
+ this.runExternals( 'write_titles', data );
759
  },
760
 
761
  writedownload: function ( j, track ) {
762
+ var data;
763
  var p = this.pl_info[j];
764
+ if ( p.download ) {
765
  jQuery(this.eID.dload + j).empty().removeClass('whilelinks').append('<a id="mp3j_dlanchor_' + j + '" href="' + p.list[track].mp3 + '" target="_blank">' + this.vars.dload_text + '</a>');
766
  if ( this.vars.force_dload === true ) {
767
  this.dl_button_click( j );
768
  }
769
  }
770
+ data = { is_download: p.download , url: p.list[track].mp3 };
771
+ this.runExternals( 'write_download', data );
772
  },
773
 
774
  togglelist: function ( j ) {
861
  }
862
  };
863
 
864
+
865
+ /*
866
+ * Force browser download
867
+ * Version 1.1
868
+ * 2014 Simon Ward
869
+ */
870
  MP3_JPLAYER.dl_button_click = function ( j ) {
871
  var that = this, p = this.pl_info[j];
872
  jQuery('#mp3j_dlanchor_' + j).click(function (e) {
 
873
  that.dl_runinfo( p.list[p.tr].mp3, j, e );
874
+ that.runExternals( 'download', p.list[p.tr] );
 
 
 
 
 
 
 
 
875
  e.preventDefault();
876
  });
877
  };
927
  }
928
  };
929
 
 
930
  MP3_JPLAYER.dl_interval_check = function ( j, can_write ) {
931
  if ( can_write !== false && this.read_cookie('mp3Download' + j) === 'true' ) { //got cookie back, all should be good
932
  this.dl_dialogue( j, this.vars.message_ok, 'hide');
977
  }
978
  jQuery('#mp3j_finfo_' + j).fadeOut(1000);
979
  }
980
+
981
+ this.runExternals( 'download_dialog', { id: j, text: text, state: state } );
982
  };
983
 
984
  MP3_JPLAYER.read_cookie = function ( name ) {
main.php CHANGED
@@ -2,7 +2,7 @@
2
  if ( !class_exists("MP3j_Main") ) { class MP3j_Main {
3
 
4
  // ---------------------- Update Me
5
- var $version_of_plugin = "2.3";
6
  var $M_no = 0;
7
  var $F_no = 0;
8
  var $S_no = 0;
@@ -77,11 +77,19 @@ if ( !class_exists("MP3j_Main") ) { class MP3j_Main {
77
  if ( ! isset( $_POST['update_mp3foxSettings'] ) ) {
78
  $this->setAllowedFeedTypesArrays();
79
  }
80
- $this->SKINS = $this->getSkinData();
81
  }
82
 
83
 
84
  ////
 
 
 
 
 
 
 
 
85
  //~~~~~
86
  function get_excerpt_handler( $stored = "" )
87
  {
@@ -1168,7 +1176,7 @@ if ( !class_exists("MP3j_Main") ) { class MP3j_Main {
1168
 
1169
  //jplayer and plugin js
1170
  wp_enqueue_script( 'jplayer271', $this->PluginFolder . '/js/jquery.jplayer.min.2.7.1.js', false, '2.7.1' );
1171
- wp_enqueue_script( 'mp3-jplayer', $this->PluginFolder . '/js/mp3-jplayer-2.3.js', false, '2.3' );
1172
 
1173
  $skins = $this->SKINS;
1174
  if ( isset( $skins[ $theme ]['url'] ) ) {
2
  if ( !class_exists("MP3j_Main") ) { class MP3j_Main {
3
 
4
  // ---------------------- Update Me
5
+ var $version_of_plugin = "2.3.1";
6
  var $M_no = 0;
7
  var $F_no = 0;
8
  var $S_no = 0;
77
  if ( ! isset( $_POST['update_mp3foxSettings'] ) ) {
78
  $this->setAllowedFeedTypesArrays();
79
  }
80
+ //$this->SKINS = $this->getSkinData();
81
  }
82
 
83
 
84
  ////
85
+
86
+ //~~~~~
87
+ function onInit ()
88
+ {
89
+ $this->SKINS = $this->getSkinData();
90
+ }
91
+
92
+
93
  //~~~~~
94
  function get_excerpt_handler( $stored = "" )
95
  {
1176
 
1177
  //jplayer and plugin js
1178
  wp_enqueue_script( 'jplayer271', $this->PluginFolder . '/js/jquery.jplayer.min.2.7.1.js', false, '2.7.1' );
1179
+ wp_enqueue_script( 'mp3-jplayer', $this->PluginFolder . '/js/mp3-jplayer-2.3.1.js', false, '2.3.1' );
1180
 
1181
  $skins = $this->SKINS;
1182
  if ( isset( $skins[ $theme ]['url'] ) ) {
mp3jplayer.php CHANGED
@@ -3,12 +3,12 @@
3
  Plugin Name: MP3-jPlayer
4
  Plugin URI: http://mp3-jplayer.com
5
  Description: Easy, Flexible Audio for WordPress.
6
- Version: 2.3
7
  Author: Simon Ward
8
  Author URI: http://www.sjward.org
9
  License: GPL2
10
 
11
- Copyright 2015 Simon Ward
12
 
13
  This program is free software; you can redistribute it and/or modify
14
  it under the terms of the GNU General Public License, version 2, as
@@ -20,11 +20,12 @@ License: GPL2
20
  GNU General Public License for more details.
21
 
22
  You should have received a copy of the GNU General Public License
23
- along with this program; if not, write to the Free Software
24
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
  */
26
 
27
- if ( ! function_exists( 'get_bloginfo' ) ) {
 
28
  die();
29
  }
30
 
@@ -162,7 +163,9 @@ if ( isset($MP3JP) )
162
 
163
 
164
  //Template hooks
165
- //scripts
 
 
166
  /*
167
  * should use this conditional but it means that as page loads up players initially appear unstyled (aren't styled until
168
  * last minute) TODO:enqueue style in header when poss.
3
  Plugin Name: MP3-jPlayer
4
  Plugin URI: http://mp3-jplayer.com
5
  Description: Easy, Flexible Audio for WordPress.
6
+ Version: 2.3.1
7
  Author: Simon Ward
8
  Author URI: http://www.sjward.org
9
  License: GPL2
10
 
11
+ Copyright 2010 - 2015 Simon Ward
12
 
13
  This program is free software; you can redistribute it and/or modify
14
  it under the terms of the GNU General Public License, version 2, as
20
  GNU General Public License for more details.
21
 
22
  You should have received a copy of the GNU General Public License
23
+ along with the plugin; if not, write to the Free Software
24
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
  */
26
 
27
+
28
+ if ( ! function_exists( 'get_bloginfo' ) ) { //prevent direct access
29
  die();
30
  }
31
 
163
 
164
 
165
  //Template hooks
166
+
167
+ add_action('init', array( &$MP3JP, 'onInit'), 100 );
168
+
169
  /*
170
  * should use this conditional but it means that as page loads up players initially appear unstyled (aren't styled until
171
  * last minute) TODO:enqueue style in header when poss.
popout.php CHANGED
@@ -17,7 +17,7 @@
17
  <script type='text/javascript' src='js/popout/slider.min.js'></script>
18
  <script type='text/javascript' src='js/wp-backwards-compat/jquery.ui.touch-punch.min.js'></script>
19
  <script type='text/javascript' src='js/jquery.jplayer.min.2.7.1.js'></script>
20
- <script type='text/javascript' src='js/mp3-jplayer-2.3.js'></script>
21
 
22
  <script type='text/javascript'>
23
  function loadcss(filename) {
17
  <script type='text/javascript' src='js/popout/slider.min.js'></script>
18
  <script type='text/javascript' src='js/wp-backwards-compat/jquery.ui.touch-punch.min.js'></script>
19
  <script type='text/javascript' src='js/jquery.jplayer.min.2.7.1.js'></script>
20
+ <script type='text/javascript' src='js/mp3-jplayer-2.3.1.js'></script>
21
 
22
  <script type='text/javascript'>
23
  function loadcss(filename) {
readme.txt CHANGED
@@ -7,7 +7,7 @@ Tags: audio, audio player, audio playlist, mp3 player, music player, media, mobi
7
  License: GPLv2 or later
8
  Requires at least: 2.9
9
  Tested up to: 4.1
10
- Stable tag: 2.3
11
 
12
  Easy, Flexible Audio for WordPress.
13
 
@@ -15,21 +15,24 @@ Easy, Flexible Audio for WordPress.
15
 
16
  = Mobile friendly HTML5 audio players and audio playlist players =
17
 
18
- * Style and colour options for your audio players. Customise the colour scheme, fonts, title and image placements and more on the Player Design page.
19
- * Enhanced features for audio playlist players and single-file audio players.
20
- * Add popout players and popout links, audio widget players, and music downloads.
21
- * Works with all built-in WordPress options for adding your music players, including the recently introduced *Create Audio Playlist* drag & drop interface.
22
- * Flexible multi-player audio plugin, add unlimited music players to pages, posts, sidebars, and template files.
23
 
24
- [Player Demos](http://mp3-jplayer.com/playlist-players/) <br>
25
  [How to Add Your Players](http://mp3-jplayer.com/adding-players/) <br>
26
- [Included Skins Demo](http://mp3-jplayer.com/player-skins/)
27
 
28
 
29
  MP3-jPlayer will expand WP's native shortcodes with new functions and options, giving you a lot of choice in how to set up your music playlists. Here's a few of the features:
30
 
 
31
  * Offer audio downloads to visitors or logged-in users.
32
  * Playlist folders with one simple feed folder command.
 
 
33
  * A fully integrated Pop-out player that can be launched from playlist players, or from a stand-alone popout link.
34
  * Shortcode parameters to give you individual control of player heights, widths, volumes, downloads, styling, and allow you to play from your library, local folders or urls.
35
  * You can use custom fields to manage playlists.
@@ -38,9 +41,10 @@ MP3-jPlayer will expand WP's native shortcodes with new functions and options, g
38
  * Very easy file counterparting, just upload.
39
  * Plays Icecast and Shoutcast audio streams.
40
  * Great compatibility across browsers / platforms. Works on iPhone, iPad, Android.
41
- * Re-skinable player designs via CSS.
42
  * Multisite compatible.
43
- * Can be selectively integrated with WordPress default audio players.
 
44
 
45
  See [the plugin's home page](http://mp3-jplayer.com) for info, demos, documentation, and help articles.
46
 
@@ -101,10 +105,14 @@ Either on the [forum at Wordpress](https://wordpress.org/support/plugin/mp3-jpla
101
 
102
  == Changelog ==
103
 
 
 
 
 
104
  = 2.3 =
105
  * Fixed a major issue on index/cat/search type pages that could incorrectly assign the playlists or break players in some scenarios.
106
  * Added support for custom js (for skin extensions) on the player Design page.
107
- * Developer note: renamed the MP3-jPlayer plugin class instance to MP3JP.
108
 
109
  = 2.2 =
110
  * Simplified error handling to try and eliminate the false triggering of messages that was occurring on some devices.
7
  License: GPLv2 or later
8
  Requires at least: 2.9
9
  Tested up to: 4.1
10
+ Stable tag: 2.3.1
11
 
12
  Easy, Flexible Audio for WordPress.
13
 
15
 
16
  = Mobile friendly HTML5 audio players and audio playlist players =
17
 
18
+ * Adds style and colour options for audio players.
19
+ * Enhanced music playlist players and single-file audio players
20
+ * Additional popout players and popout links, audio widget players, and audio downloads.
21
+ * Works with all built-in WordPress options for adding your music, including the recently introduced *Create Audio Playlist* drag & drop interface.
22
+
23
 
24
+ [Player Demos](http://mp3-jplayer.com/player-skins/) <br>
25
  [How to Add Your Players](http://mp3-jplayer.com/adding-players/) <br>
26
+ [Help & Docs](http://mp3-jplayer.com/help-docs/)
27
 
28
 
29
  MP3-jPlayer will expand WP's native shortcodes with new functions and options, giving you a lot of choice in how to set up your music playlists. Here's a few of the features:
30
 
31
+ * Flexible multi-player audio plugin, add unlimited music players to pages, posts, sidebars, and template files.
32
  * Offer audio downloads to visitors or logged-in users.
33
  * Playlist folders with one simple feed folder command.
34
+ * Can be selectively integrated with WordPress default audio players.
35
+ * Customise the colour scheme, fonts, title and image placements and more on the Player Design page.
36
  * A fully integrated Pop-out player that can be launched from playlist players, or from a stand-alone popout link.
37
  * Shortcode parameters to give you individual control of player heights, widths, volumes, downloads, styling, and allow you to play from your library, local folders or urls.
38
  * You can use custom fields to manage playlists.
41
  * Very easy file counterparting, just upload.
42
  * Plays Icecast and Shoutcast audio streams.
43
  * Great compatibility across browsers / platforms. Works on iPhone, iPad, Android.
44
+ * Editable player designs via CSS.
45
  * Multisite compatible.
46
+
47
+
48
 
49
  See [the plugin's home page](http://mp3-jplayer.com) for info, demos, documentation, and help articles.
50
 
105
 
106
  == Changelog ==
107
 
108
+ = 2.3.1 =
109
+ * Added developer methods for hooking into the player's Javascript events, these also add support for some of the up-coming extensions.
110
+ * Corrected the help message admin-side that shows on the widget when it's set to an invalid path.
111
+
112
  = 2.3 =
113
  * Fixed a major issue on index/cat/search type pages that could incorrectly assign the playlists or break players in some scenarios.
114
  * Added support for custom js (for skin extensions) on the player Design page.
115
+ * Renamed the MP3-jPlayer plugin class instance to MP3JP.
116
 
117
  = 2.2 =
118
  * Simplified error handling to try and eliminate the false triggering of messages that was occurring on some devices.
widget-ui.php CHANGED
@@ -254,21 +254,12 @@ if ( class_exists("WP_Widget") ) {
254
  My library</p>
255
 
256
  <?php
257
- /*
258
- if ( $instance['folder_to_play'] == "" ) {
259
- $folder = $MP3JP->theSettings['mp3_dir'];
260
- } else {
261
- $folder = $instance['folder_to_play'];
262
- }
263
- */
264
-
265
  $folder = $instance['folder_to_play'];
266
- //$folder = '/music/sub';
267
- //$foldertracks = $MP3JP->grabFolderURLs( $folder );
268
  $fdetails = $MP3JP->grabFolderURLs( $folder, $MP3JP->formatsFeedRegex );
269
- $foldertracks = ( isset($fdetails['files']) ) ? $fdetails['files'] : false;
270
-
271
- if ( $foldertracks !== true && $foldertracks !== false ) {
 
272
  if ( ($c = count($foldertracks)) > 0 ) {
273
  $style = "color:#282;";
274
  $txt = $c . "&nbsp;file";
@@ -278,10 +269,14 @@ if ( class_exists("WP_Widget") ) {
278
  $style = "color:#aaa;";
279
  $txt = "There are no audio files here";
280
  }
281
- } elseif ( $foldertracks === true ) {
 
 
282
  $txt = "Folder not found, check path<br />and permissions";
283
  $style = "color:#dfad00;";
284
- } else {
 
 
285
  $txt = "x Remote or inaccessible folder";
286
  $style = "color:#f56b0f;";
287
  }
@@ -292,12 +287,7 @@ if ( class_exists("WP_Widget") ) {
292
  <p class="description" style="margin:0px 0px 0px 80px; font-size:12px; font-weight:700; <?php echo $style; ?>"><?php echo $txt; ?></p>
293
  </div>
294
 
295
-
296
-
297
-
298
-
299
-
300
-
301
  <hr/>
302
  <h3>Player Settings:</h3>
303
 
254
  My library</p>
255
 
256
  <?php
 
 
 
 
 
 
 
 
257
  $folder = $instance['folder_to_play'];
 
 
258
  $fdetails = $MP3JP->grabFolderURLs( $folder, $MP3JP->formatsFeedRegex );
259
+ if ( is_array( $fdetails ) )
260
+ {
261
+ $foldertracks = $fdetails['files'];
262
+
263
  if ( ($c = count($foldertracks)) > 0 ) {
264
  $style = "color:#282;";
265
  $txt = $c . "&nbsp;file";
269
  $style = "color:#aaa;";
270
  $txt = "There are no audio files here";
271
  }
272
+ }
273
+ elseif ( $fdetails === true )
274
+ {
275
  $txt = "Folder not found, check path<br />and permissions";
276
  $style = "color:#dfad00;";
277
+ }
278
+ else
279
+ {
280
  $txt = "x Remote or inaccessible folder";
281
  $style = "color:#f56b0f;";
282
  }
287
  <p class="description" style="margin:0px 0px 0px 80px; font-size:12px; font-weight:700; <?php echo $style; ?>"><?php echo $txt; ?></p>
288
  </div>
289
 
290
+
 
 
 
 
 
291
  <hr/>
292
  <h3>Player Settings:</h3>
293