MP3-jPlayer - Version 2.1

Version Description

  • Fixed plugin compatibility with old versions of WP pre 3.6.
  • Fixed the widget's folder feed (it was picking up all audio regardless of chosen formats), and the admin-side info message that shows the track count.
  • Added a 'Show images' tick option on the widget (this controls the display of any featured images that you've set for the audio).
  • Made player's download link immediately visible upon page load (previously users needed to start a track in order to make the first download link available).
Download this release

Release Info

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

Code changes from version 2.0 to 2.1

css/dark.css CHANGED
@@ -111,7 +111,8 @@ div.transport-MI { position:absolute; width:auto; height:38px; right:2px; bottom
111
 
112
  /* Download */
113
  div.dloadmp3-MI {
114
- background-position:-395px -98px;
 
115
  padding:0;
116
  height:38px;
117
  color:#f0f0f0;
@@ -135,11 +136,16 @@ div.transport-MI { position:absolute; width:auto; height:38px; right:2px; bottom
135
  background-color:transparent;
136
  }
137
  div.dloadmp3-MI.whilelinks:hover { }
138
- .dloadmp3-MI a { padding:10px 8px 0px 28px !important; visibility:hidden; display:none; color:#f0f0f0; font-size:12px; }
139
- .dloadmp3-MI a:hover { }
140
- .dloadmp3-MI.whilelinks a { visibility:inherit; color:#f0f0f0; display:block; }
141
- .dloadmp3-MI.whilelinks a:hover { color:#fff; display:block; }
142
- .dloadmp3-MI p { padding:10px 8px 0px 28px !important; visibility:visible; }
 
 
 
 
 
143
 
144
 
145
  /* VOLUME */
111
 
112
  /* Download */
113
  div.dloadmp3-MI {
114
+ /*background-position:-395px -98px;*/
115
+ background-position:-395px -49px;
116
  padding:0;
117
  height:38px;
118
  color:#f0f0f0;
136
  background-color:transparent;
137
  }
138
  div.dloadmp3-MI.whilelinks:hover { }
139
+ /*
140
+ .dloadmp3-MI a { padding:10px 8px 0px 28px !important; visibility:hidden; display:none; color:#f0f0f0; font-size:12px; }
141
+ .dloadmp3-MI a:hover { }
142
+ */
143
+ .dloadmp3-MI a { padding:10px 8px 0px 28px !important; visibility:inherit; color:#f0f0f0; display:block; font-size:12px; }
144
+ .dloadmp3-MI a:hover { color:#fff; display:block; }
145
+
146
+ .dloadmp3-MI.whilelinks a { visibility:inherit; color:#f0f0f0; display:block; }
147
+ .dloadmp3-MI.whilelinks a:hover { color:#fff; display:block; }
148
+ .dloadmp3-MI p { padding:10px 8px 0px 28px !important; visibility:visible; }
149
 
150
 
151
  /* VOLUME */
css/light.css CHANGED
@@ -109,7 +109,8 @@ div.transport-MI { position:absolute; width:auto; height:38px; right:2px; bottom
109
  div.mp3j-popout-MI:hover { background-color:#e0e0e0 !important; }
110
 
111
  div.dloadmp3-MI {
112
- background-position:-395px -97px;
 
113
  padding:0;
114
  height:40px;
115
  cursor:default;
@@ -133,11 +134,16 @@ div.transport-MI { position:absolute; width:auto; height:38px; right:2px; bottom
133
  background-color:transparent;
134
  }
135
  div.dloadmp3-MI.whilelinks:hover { }
136
- .dloadmp3-MI a { padding:10px 8px 0px 28px !important; visibility:hidden; display:none; color:#505050; font-size:12px; }
137
- .dloadmp3-MI a:hover { }
138
- .dloadmp3-MI.whilelinks a { visibility:inherit; color:#505050; display:block; }
139
- .dloadmp3-MI.whilelinks a:hover { color:#505050; display:block; }
140
- .dloadmp3-MI p { padding:10px 8px 0px 28px !important; visibility:visible; }
 
 
 
 
 
141
 
142
 
143
  /* VOLUME */
109
  div.mp3j-popout-MI:hover { background-color:#e0e0e0 !important; }
110
 
111
  div.dloadmp3-MI {
112
+ /* background-position:-395px -97px; */
113
+ background-position:-395px -48px;
114
  padding:0;
115
  height:40px;
116
  cursor:default;
134
  background-color:transparent;
135
  }
136
  div.dloadmp3-MI.whilelinks:hover { }
137
+ /*
138
+ .dloadmp3-MI a { padding:10px 8px 0px 28px !important; visibility:hidden; display:none; color:#505050; font-size:12px; }
139
+ .dloadmp3-MI a:hover { }
140
+ */
141
+ .dloadmp3-MI a { padding:10px 8px 0px 28px !important; visibility:inherit; color:#505050; display:block; font-size:12px; }
142
+ .dloadmp3-MI a:hover { color:#505050; display:block; }
143
+
144
+ .dloadmp3-MI.whilelinks a { visibility:inherit; color:#505050; display:block; }
145
+ .dloadmp3-MI.whilelinks a:hover { color:#505050; display:block; }
146
+ .dloadmp3-MI p { padding:10px 8px 0px 28px !important; visibility:visible; }
147
 
148
 
149
  /* VOLUME */
css/text.css CHANGED
@@ -121,8 +121,13 @@ div.transport-MI { position:absolute; width:auto; height:24px; right:2px; bottom
121
  background-color:transparent;
122
  }
123
  div.dloadmp3-MI.whilelinks:hover { }
 
124
  .dloadmp3-MI a { padding:0px !important; visibility:hidden; display:none; text-decoration:none !important; }
125
  .dloadmp3-MI a:hover { text-decoration:none !important; }
 
 
 
 
126
  .dloadmp3-MI.whilelinks a { visibility:inherit; display:block; }
127
  .dloadmp3-MI.whilelinks a:hover { display:block; }
128
  .dloadmp3-MI p { padding:0px !important; visibility:visible; }
121
  background-color:transparent;
122
  }
123
  div.dloadmp3-MI.whilelinks:hover { }
124
+ /*
125
  .dloadmp3-MI a { padding:0px !important; visibility:hidden; display:none; text-decoration:none !important; }
126
  .dloadmp3-MI a:hover { text-decoration:none !important; }
127
+ */
128
+ .dloadmp3-MI a { padding:0px !important; visibility:inherit; display:block; text-decoration:none !important; }
129
+ .dloadmp3-MI a:hover { text-decoration:none !important; display:block; }
130
+
131
  .dloadmp3-MI.whilelinks a { visibility:inherit; display:block; }
132
  .dloadmp3-MI.whilelinks a:hover { display:block; }
133
  .dloadmp3-MI p { padding:0px !important; visibility:visible; }
css/v1-skins/v1-dark.css CHANGED
@@ -313,10 +313,10 @@ div.playlist-toggle-MI { position:absolute; cursor:pointer; z-index:20; font-siz
313
  div.playlist-toggle-MI:hover { background:#585858; color:#bbb; }
314
 
315
  /* DOWNLOAD BUTTON */
316
- div.dloadmp3-MI { position:absolute; min-height:11px; cursor:pointer; font:normal normal 500 9px 'trebuchet ms', 'Lucida Grande', 'arial', sans-serif !important; bottom:47px; margin:0px !important; font-size:9px !important; text-align:center; left:0px; width:41%; min-width:75px; max-width:425px; padding:0px 0px 0px 0px !important; border:0px; background:transparent url('images/t10b.png') repeat left top !important; color:#fff; line-height:11px !important; -moz-border-radius-topright:3px; -webkit-border-top-right-radius:3px; overflow:hidden; z-index:150; cursor:default; }
317
  div.dloadmp3-MI.whilelinks, div.dloadmp3-MI.logintext { background:transparent url('images/t50b.png') repeat left top !important; }
318
  div.dloadmp3-MI.whilelinks:hover { background:transparent url('images/t40b.png') repeat left top !important; }
319
- div.dloadmp3-MI a { color:#ececec; display:block; width:auto; padding:2px 5px 1px 2px !important; margin:0px !important; background:transparent; text-decoration:none !important; font:normal normal 500 9px 'trebuchet ms', 'Lucida Grande', 'arial', sans-serif !important; font-size:9px !important; line-height:11px !important; height:100%; border-bottom:none; visibility:hidden; }
320
  div.dloadmp3-MI a:hover { outline: none; border-bottom: none; color: #ececec; }
321
  div.dloadmp3-MI.whilelinks a { color: #f3f3f3; visibility: inherit; }
322
  div.dloadmp3-MI.whilelinks a:hover { color: #fff; }
313
  div.playlist-toggle-MI:hover { background:#585858; color:#bbb; }
314
 
315
  /* DOWNLOAD BUTTON */
316
+ div.dloadmp3-MI { position:absolute; min-height:11px; cursor:pointer; font:normal normal 500 9px 'trebuchet ms', 'Lucida Grande', 'arial', sans-serif !important; bottom:47px; margin:0px !important; font-size:9px !important; text-align:center; left:0px; width:41%; min-width:75px; max-width:425px; padding:0px 0px 0px 0px !important; border:0px; background:transparent url('images/t40b.png') repeat left top !important; color:#fff; line-height:11px !important; -moz-border-radius-topright:3px; -webkit-border-top-right-radius:3px; overflow:hidden; z-index:150; cursor:default; }
317
  div.dloadmp3-MI.whilelinks, div.dloadmp3-MI.logintext { background:transparent url('images/t50b.png') repeat left top !important; }
318
  div.dloadmp3-MI.whilelinks:hover { background:transparent url('images/t40b.png') repeat left top !important; }
319
+ div.dloadmp3-MI a { color:#ececec; display:block; width:auto; padding:2px 5px 1px 2px !important; margin:0px !important; background:transparent; text-decoration:none !important; font:normal normal 500 9px 'trebuchet ms', 'Lucida Grande', 'arial', sans-serif !important; font-size:9px !important; line-height:11px !important; height:100%; border-bottom:none; visibility:visible; }
320
  div.dloadmp3-MI a:hover { outline: none; border-bottom: none; color: #ececec; }
321
  div.dloadmp3-MI.whilelinks a { color: #f3f3f3; visibility: inherit; }
322
  div.dloadmp3-MI.whilelinks a:hover { color: #fff; }
css/v1-skins/v1-silver.css CHANGED
@@ -317,10 +317,10 @@ div.playlist-toggle-MI { position:absolute; cursor:pointer; z-index:20; font-siz
317
  div.playlist-toggle-MI:hover { background:#c6c6c6; color:#777; }
318
 
319
  /* DOWNLOAD BUTTON */
320
- div.dloadmp3-MI { position:absolute; min-height:11px; cursor:pointer; font:normal normal 500 9px 'trebuchet ms', 'Lucida Grande', 'arial', sans-serif !important; bottom:47px; margin:0px !important; font-size:9px !important; text-align:center; left:0px; width:41%; min-width:75px; max-width:425px; padding:0px 0px 0px 0px !important; border:0px; background:transparent url('images/t10b.png') repeat left top !important; color:#fff; line-height:11px !important; -moz-border-radius-topright:3px; -webkit-border-top-right-radius:3px; overflow:hidden; z-index:150; cursor:default; }
321
  div.dloadmp3-MI.whilelinks, div.dloadmp3-MI.logintext { background:transparent url('images/t50b.png') repeat left top !important; }
322
  div.dloadmp3-MI.whilelinks:hover { background:transparent url('images/t40b.png') repeat left top !important; }
323
- div.dloadmp3-MI a { color:#ececec; display:block; width:auto; padding:2px 5px 1px 2px !important; margin:0px !important; background:transparent; text-decoration:none !important; font:normal normal 500 9px 'trebuchet ms', 'Lucida Grande', 'arial', sans-serif !important; font-size:9px !important; line-height:11px !important; height:100%; border-bottom:none; visibility:hidden; }
324
  div.dloadmp3-MI a:hover { outline: none; border-bottom: none; color: #ececec; }
325
  div.dloadmp3-MI.whilelinks a { color: #f3f3f3; visibility: inherit; }
326
  div.dloadmp3-MI.whilelinks a:hover { color: #fff; }
317
  div.playlist-toggle-MI:hover { background:#c6c6c6; color:#777; }
318
 
319
  /* DOWNLOAD BUTTON */
320
+ div.dloadmp3-MI { position:absolute; min-height:11px; cursor:pointer; font:normal normal 500 9px 'trebuchet ms', 'Lucida Grande', 'arial', sans-serif !important; bottom:47px; margin:0px !important; font-size:9px !important; text-align:center; left:0px; width:41%; min-width:75px; max-width:425px; padding:0px 0px 0px 0px !important; border:0px; background:transparent url('images/t50b.png') repeat left top !important; color:#fff; line-height:11px !important; -moz-border-radius-topright:3px; -webkit-border-top-right-radius:3px; overflow:hidden; z-index:150; cursor:default; }
321
  div.dloadmp3-MI.whilelinks, div.dloadmp3-MI.logintext { background:transparent url('images/t50b.png') repeat left top !important; }
322
  div.dloadmp3-MI.whilelinks:hover { background:transparent url('images/t40b.png') repeat left top !important; }
323
+ div.dloadmp3-MI a { color:#ececec; display:block; width:auto; padding:2px 5px 1px 2px !important; margin:0px !important; background:transparent; text-decoration:none !important; font:normal normal 500 9px 'trebuchet ms', 'Lucida Grande', 'arial', sans-serif !important; font-size:9px !important; line-height:11px !important; height:100%; border-bottom:none; visibility:visible; }
324
  div.dloadmp3-MI a:hover { outline: none; border-bottom: none; color: #ececec; }
325
  div.dloadmp3-MI.whilelinks a { color: #f3f3f3; visibility: inherit; }
326
  div.dloadmp3-MI.whilelinks a:hover { color: #fff; }
js/mp3-jplayer-2.0.js CHANGED
@@ -20,19 +20,17 @@ var MP3_JPLAYER = {
20
  jp_audio: {},
21
  jp_seekable: 0,
22
  sliding: false,
23
- //launched_ID: null,
24
  jpID: '#mp3_jplayer_1_8',
25
  plugin_path: '',
26
  lastformats: 'mp3',
27
  allowRanges: true,
28
- //was_playing: false,
29
  extCalls: { init:[], change_pre:[], change_post:[], download:[], error:[] },
30
  extStyles: [],
31
  extJS: [],
32
  skinJS: '',
33
- //skin: {},
34
  mutes: [],
35
  preSlideVol: false,
 
36
 
37
  vars: {
38
  play_f: true,
@@ -197,7 +195,6 @@ var MP3_JPLAYER = {
197
  },
198
  */
199
 
200
-
201
  destroy_jp: function () {
202
  jQuery(this.jpID).unbind();
203
  jQuery(this.jpID).jPlayer("destroy");
@@ -206,12 +203,8 @@ var MP3_JPLAYER = {
206
 
207
  check_show_jperrors: function ( event ) {
208
  if ( this.tID !== '' && ! this.jperrorIDs[ this.tID ] ) {
209
- //if ( event.jPlayer.error.type === 'e_no_solution' || event.jPlayer.error.type === 'e_no_support' ) {
210
- this.show_nosolution( this.tID, event.jPlayer.error.type );
211
- this.jperrorIDs[ this.tID ] = event.jPlayer.error.type;
212
- //}
213
- //console.log(this.jperrorIDs[ this.tID ]);
214
- //TODO:stat here?
215
  }
216
  },
217
 
@@ -219,7 +212,6 @@ var MP3_JPLAYER = {
219
  var p = this.pl_info[j];
220
  var track = p.tr;
221
  var formats = p.list[track].formats;
222
- //var message = this.vars.message_nosolution;
223
  var message = '';
224
 
225
  if ( errortype === 'e_no_solution' || errortype === 'e_no_support' ) {
@@ -230,22 +222,26 @@ var MP3_JPLAYER = {
230
  } else if ( errortype === 'e_url' ) {
231
  message = this.vars.message_bad_url;
232
  }
233
- //if ( formats === 'mp3' || formats === 'm4a' ) {
234
- // message = this.vars.message_nosolution_mpeg;
235
- //}
236
  jQuery('#mp3j_nosolution_' + j).empty().append(message).fadeIn(200);
237
- //TODO: stop here?
238
- //this.E_stop(j);
 
 
 
 
 
 
 
 
 
 
239
  },
240
 
241
  add_jpconstruct_div: function () {
242
  var html = '<div id="mp3_jplayer_items" style="position:relative; overflow:hidden; margin:0; padding:0; border:0; width:0px; height:0px;"><div id="mp3_jplayer_1_8" style="left:-999em;"></div></div>';
243
  jQuery('body').prepend( html );
244
  },
245
-
246
- ////
247
- ////
248
-
249
  get_loaded: function (event) {
250
  var lp;
251
  if ( typeof this.jp_audio.buffered === "object" ) {
@@ -326,6 +322,17 @@ var MP3_JPLAYER = {
326
  }
327
  }
328
  }
 
 
 
 
 
 
 
 
 
 
 
329
  this.played_t = pt;
330
  this.total_t = tt;
331
  this.pp_abs = ppA;
@@ -334,9 +341,6 @@ var MP3_JPLAYER = {
334
 
335
  E_complete: function (j) {
336
  var p = this.pl_info[j];
337
-
338
- //console.log('# e_complete #');
339
-
340
  if ('MI' === p.type) {
341
  if (p.loop || p.tr+1 < p.list.length) {
342
  this.E_change_track(j, 'next');
@@ -367,7 +371,6 @@ var MP3_JPLAYER = {
367
  startup: function () {
368
  var j;
369
  for (j = 0; j < this.pl_info.length; j += 1) {
370
- //if (this.pl_info[j].autoplay) {
371
  if ( this.pl_info[j].autoplay && (this.pl_info[j].type === 'single' || this.pl_info[j].type === 'MI') ) {
372
  this.pl_info[j].autoplay = false;
373
  this.E_change_track(j, this.pl_info[j].tr);
@@ -381,7 +384,6 @@ var MP3_JPLAYER = {
381
 
382
  //PLAYLISTERS and SINGLES
383
  if ('MI' === p.type || 'single' === p.type) {
384
-
385
  jQuery(this.eID.vol + j).slider({
386
  value : p.vol,
387
  max: 100,
@@ -411,7 +413,6 @@ var MP3_JPLAYER = {
411
  e.stopPropagation();
412
  });
413
 
414
-
415
  sel = ('MI' === p.type) ? this.eID.play : this.eID.playW;
416
  jQuery(sel + j).click(function () { //play-pause click
417
  that.E_change_track(j, p.tr);
@@ -429,7 +430,6 @@ var MP3_JPLAYER = {
429
 
430
  //PLAYLISTERS
431
  if ('MI' === p.type) {
432
-
433
  jQuery(this.eID.pT + j).text('00:00');
434
  jQuery(this.eID.indiM + j).empty().append('<span class="mjp-ready">Ready</span>');
435
  jQuery(this.eID.stp + j).click(function () {
@@ -561,7 +561,7 @@ var MP3_JPLAYER = {
561
  }
562
  },
563
 
564
- E_stop: function (j) {
565
  var exData = { pT:'', tT:'', pState: '', pU: '', lp:'', ppA:'', jperror:'' };
566
  var l;
567
  var x;
@@ -569,19 +569,26 @@ var MP3_JPLAYER = {
569
  if (j === this.tID && j !== '') {
570
  var preL = (this.tID !== '' ) ? this.pl_info[this.tID].list : false;
571
  var pU = ( preL !== false ) ? preL[ this.pl_info[this.tID].tr ].mp3 : '';
572
-
573
- exData.pT = this.played_t;
574
- exData.tT = this.total_t;
575
- exData.pState = this.state;
576
- exData.pU = pU;
577
- exData.lp = this.load_pc;
578
- exData.ppA = this.pp_abs;
579
-
580
- l = this.extCalls.change_pre.length;
581
- for ( x = 0; x < l; x += 1 ) {
582
- var callback = this.extCalls.change_pre[ x ];
583
- callback( exData );
 
 
 
 
 
 
584
  }
 
585
  this.clearit();
586
  if ( jQuery(this.eID.pos + j + ' div.ui-widget-header').length > 0 ) {
587
  jQuery(this.eID.pos + j).off( 'click', MP3_JPLAYER.stopProp );
@@ -623,16 +630,10 @@ var MP3_JPLAYER = {
623
  var x;
624
  var l;
625
 
626
- //l = this.extCalls.change_pre.length;
627
- //for ( x = 0; x < l; x += 1 ) {
628
- // var callback = this.extCalls.change_pre[ x ];
629
- // callback( j );
630
- //}
631
-
632
  if (j === this.tID && change === p.tr) {
633
  if ('playing' === this.state) {
634
  if (this.load_pc === 0) {
635
- this.E_stop(j);
636
  } else {
637
  this.pauseit();
638
  this.button(j, 'play');
@@ -647,11 +648,7 @@ var MP3_JPLAYER = {
647
  return;
648
  }
649
  }
650
-
651
- //var preL = (this.tID !== '' ) ? this.pl_info[this.tID].list : false;
652
- //var pU = ( preL !== false ) ? preL[ this.pl_info[this.tID].tr ].mp3 : '';
653
- //var exData = { pT: this.played_t, pState: this.state, pU: pU };
654
- var exData = this.E_stop(this.tID);
655
 
656
  if ('prev' === change) {
657
  track = (p.tr-1 < 0) ? p.list.length-1 : p.tr-1;
@@ -685,14 +682,7 @@ var MP3_JPLAYER = {
685
  //console.log('--------------');
686
  //console.log('p.list[track].formats (arr): ' + p.list[track].formats );
687
  //console.log('this.lastformats (str): ' +this.lastformats);
688
-
689
- //console.log(this.jperrorIDs);
690
-
691
  var formatString = p.list[track].formats[0] + ( (typeof p.list[track].formats[1] !== 'undefined') ? ',' + p.list[track].formats[1] : '' );
692
- //if ( p.list[track].formats !== this.lastformats || this.jperrorIDs[ j ] === true ) {
693
- //if ( p.list[track].formats[0] !== this.lastformats || this.jperrorIDs[ j ] === true ) {
694
- //exData.jperror = ( this.jperrorIDs[ j ] === true ) ? 'true' : 'nope';
695
-
696
  if ( formatString !== this.lastformats || this.jperrorIDs[ j ] ) {
697
  this.jperrorIDs[ j ] = false;
698
  this.destroy_jp();
@@ -707,12 +697,7 @@ var MP3_JPLAYER = {
707
  exData.mp3 = p.list[track].mp3;
708
  exData.name = p.list[track].name;
709
  exData.artist = p.list[track].artist;
710
- exData.jperror = ( this.jperrorIDs[ j ] ) ? this.jperrorIDs[ j ] : '';
711
- l = this.extCalls.change_post.length;
712
- for ( x = 0; x < l; x += 1 ) {
713
- var callback = this.extCalls.change_post[ x ];
714
- callback( exData );
715
- }
716
  },
717
 
718
  E_launchPP: function (j) {
@@ -904,7 +889,6 @@ var MP3_JPLAYER = {
904
  return { os:os, device:device, isMobile:isMobile };
905
  }
906
 
907
-
908
  };
909
 
910
  // Force browser download
20
  jp_audio: {},
21
  jp_seekable: 0,
22
  sliding: false,
 
23
  jpID: '#mp3_jplayer_1_8',
24
  plugin_path: '',
25
  lastformats: 'mp3',
26
  allowRanges: true,
 
27
  extCalls: { init:[], change_pre:[], change_post:[], download:[], error:[] },
28
  extStyles: [],
29
  extJS: [],
30
  skinJS: '',
 
31
  mutes: [],
32
  preSlideVol: false,
33
+ exData: false,
34
 
35
  vars: {
36
  play_f: true,
195
  },
196
  */
197
 
 
198
  destroy_jp: function () {
199
  jQuery(this.jpID).unbind();
200
  jQuery(this.jpID).jPlayer("destroy");
203
 
204
  check_show_jperrors: function ( event ) {
205
  if ( this.tID !== '' && ! this.jperrorIDs[ this.tID ] ) {
206
+ this.show_nosolution( this.tID, event.jPlayer.error.type );
207
+ this.jperrorIDs[ this.tID ] = event.jPlayer.error.type;
 
 
 
 
208
  }
209
  },
210
 
212
  var p = this.pl_info[j];
213
  var track = p.tr;
214
  var formats = p.list[track].formats;
 
215
  var message = '';
216
 
217
  if ( errortype === 'e_no_solution' || errortype === 'e_no_support' ) {
222
  } else if ( errortype === 'e_url' ) {
223
  message = this.vars.message_bad_url;
224
  }
 
 
 
225
  jQuery('#mp3j_nosolution_' + j).empty().append(message).fadeIn(200);
226
+
227
+ //if ( this.exData !== false && errortype === 'e_url' ) {
228
+ if ( this.exData !== false ) {
229
+ this.exData.jperror = errortype;
230
+ var x;
231
+ var l = this.extCalls.change_post.length;
232
+ for ( x = 0; x < l; x += 1 ) {
233
+ var callback = this.extCalls.change_post[ x ];
234
+ callback( this.exData );
235
+ }
236
+ this.exData = false;
237
+ }
238
  },
239
 
240
  add_jpconstruct_div: function () {
241
  var html = '<div id="mp3_jplayer_items" style="position:relative; overflow:hidden; margin:0; padding:0; border:0; width:0px; height:0px;"><div id="mp3_jplayer_1_8" style="left:-999em;"></div></div>';
242
  jQuery('body').prepend( html );
243
  },
244
+
 
 
 
245
  get_loaded: function (event) {
246
  var lp;
247
  if ( typeof this.jp_audio.buffered === "object" ) {
322
  }
323
  }
324
  }
325
+
326
+ if ( pt > 3 && this.exData !== false ) { //TODO:skip threshold
327
+ var x;
328
+ var l = this.extCalls.change_post.length;
329
+ for ( x = 0; x < l; x += 1 ) {
330
+ var callback = this.extCalls.change_post[ x ];
331
+ callback( this.exData );
332
+ }
333
+ this.exData = false;
334
+ }
335
+
336
  this.played_t = pt;
337
  this.total_t = tt;
338
  this.pp_abs = ppA;
341
 
342
  E_complete: function (j) {
343
  var p = this.pl_info[j];
 
 
 
344
  if ('MI' === p.type) {
345
  if (p.loop || p.tr+1 < p.list.length) {
346
  this.E_change_track(j, 'next');
371
  startup: function () {
372
  var j;
373
  for (j = 0; j < this.pl_info.length; j += 1) {
 
374
  if ( this.pl_info[j].autoplay && (this.pl_info[j].type === 'single' || this.pl_info[j].type === 'MI') ) {
375
  this.pl_info[j].autoplay = false;
376
  this.E_change_track(j, this.pl_info[j].tr);
384
 
385
  //PLAYLISTERS and SINGLES
386
  if ('MI' === p.type || 'single' === p.type) {
 
387
  jQuery(this.eID.vol + j).slider({
388
  value : p.vol,
389
  max: 100,
413
  e.stopPropagation();
414
  });
415
 
 
416
  sel = ('MI' === p.type) ? this.eID.play : this.eID.playW;
417
  jQuery(sel + j).click(function () { //play-pause click
418
  that.E_change_track(j, p.tr);
430
 
431
  //PLAYLISTERS
432
  if ('MI' === p.type) {
 
433
  jQuery(this.eID.pT + j).text('00:00');
434
  jQuery(this.eID.indiM + j).empty().append('<span class="mjp-ready">Ready</span>');
435
  jQuery(this.eID.stp + j).click(function () {
561
  }
562
  },
563
 
564
+ E_stop: function ( j, caller ) {
565
  var exData = { pT:'', tT:'', pState: '', pU: '', lp:'', ppA:'', jperror:'' };
566
  var l;
567
  var x;
569
  if (j === this.tID && j !== '') {
570
  var preL = (this.tID !== '' ) ? this.pl_info[this.tID].list : false;
571
  var pU = ( preL !== false ) ? preL[ this.pl_info[this.tID].tr ].mp3 : '';
572
+
573
+ if ( this.exData === false ) {
574
+ exData.pT = this.played_t;
575
+ exData.tT = this.total_t;
576
+ exData.pState = this.state;
577
+ exData.pU = pU;
578
+ exData.lp = this.load_pc;
579
+ exData.ppA = this.pp_abs;
580
+ } else {
581
+ exData = this.exData;
582
+ }
583
+ //if ( caller !== 'Echange' ) {
584
+ if ( caller !== 'Echange' && this.jperrorIDs[j] === false ) {
585
+ l = this.extCalls.change_pre.length;
586
+ for ( x = 0; x < l; x += 1 ) {
587
+ var callback = this.extCalls.change_pre[ x ];
588
+ callback( exData );
589
+ }
590
  }
591
+
592
  this.clearit();
593
  if ( jQuery(this.eID.pos + j + ' div.ui-widget-header').length > 0 ) {
594
  jQuery(this.eID.pos + j).off( 'click', MP3_JPLAYER.stopProp );
630
  var x;
631
  var l;
632
 
 
 
 
 
 
 
633
  if (j === this.tID && change === p.tr) {
634
  if ('playing' === this.state) {
635
  if (this.load_pc === 0) {
636
+ this.E_stop( j, 'Echange');
637
  } else {
638
  this.pauseit();
639
  this.button(j, 'play');
648
  return;
649
  }
650
  }
651
+ var exData = this.E_stop( this.tID, 'Echange' );
 
 
 
 
652
 
653
  if ('prev' === change) {
654
  track = (p.tr-1 < 0) ? p.list.length-1 : p.tr-1;
682
  //console.log('--------------');
683
  //console.log('p.list[track].formats (arr): ' + p.list[track].formats );
684
  //console.log('this.lastformats (str): ' +this.lastformats);
 
 
 
685
  var formatString = p.list[track].formats[0] + ( (typeof p.list[track].formats[1] !== 'undefined') ? ',' + p.list[track].formats[1] : '' );
 
 
 
 
686
  if ( formatString !== this.lastformats || this.jperrorIDs[ j ] ) {
687
  this.jperrorIDs[ j ] = false;
688
  this.destroy_jp();
697
  exData.mp3 = p.list[track].mp3;
698
  exData.name = p.list[track].name;
699
  exData.artist = p.list[track].artist;
700
+ this.exData = exData;
 
 
 
 
 
701
  },
702
 
703
  E_launchPP: function (j) {
889
  return { os:os, device:device, isMobile:isMobile };
890
  }
891
 
 
892
  };
893
 
894
  // Force browser download
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.0";
6
  var $M_no = 0;
7
  var $F_no = 0;
8
  var $S_no = 0;
@@ -1563,7 +1563,9 @@ if ( !class_exists("MP3j_Main") ) { class MP3j_Main {
1563
 
1564
  $styleKey = $mp3FoxAdminOptions['player_theme'];
1565
 
1566
- if ( $styleKey !== 'styleH' ) {
 
 
1567
  $mp3FoxAdminOptions['colour_settings']['titleBold'] = "false";
1568
  $mp3FoxAdminOptions['colour_settings']['captionItalic'] = "false";
1569
  }
2
  if ( !class_exists("MP3j_Main") ) { class MP3j_Main {
3
 
4
  // ---------------------- Update Me
5
+ var $version_of_plugin = "2.1";
6
  var $M_no = 0;
7
  var $F_no = 0;
8
  var $S_no = 0;
1563
 
1564
  $styleKey = $mp3FoxAdminOptions['player_theme'];
1565
 
1566
+ if ( $styleKey == 'styleH' ) {
1567
+ $mp3FoxAdminOptions['player_theme'] = 'defaultText';
1568
+ } else {
1569
  $mp3FoxAdminOptions['colour_settings']['titleBold'] = "false";
1570
  $mp3FoxAdminOptions['colour_settings']['captionItalic'] = "false";
1571
  }
mp3jplayer.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: MP3-jPlayer
4
  Plugin URI: http://mp3-jplayer.com
5
  Description: Easy, Flexible Audio for WordPress.
6
- Version: 2.0
7
  Author: Simon Ward
8
  Author URI: http://www.sjward.org
9
  License: GPL2
@@ -24,6 +24,12 @@ License: GPL2
24
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
  */
26
 
 
 
 
 
 
 
27
  $mp3j_path = dirname(__FILE__);
28
  include_once( $mp3j_path . '/main.php');
29
  include_once( $mp3j_path . '/frontend.php'); //extends main
@@ -140,23 +146,23 @@ if ( isset($mp3_fox) )
140
  add_shortcode('mp3j', array(&$mp3_fox, 'inline_play_graphic'));
141
  add_shortcode('mp3-jplayer', array(&$mp3_fox, 'primary_player'));
142
 
143
- if ( shortcode_exists('popout') ) {
144
- remove_shortcode('popout');
145
- }
146
  add_shortcode('popout', array(&$mp3_fox, 'popout_link_player'));
147
  add_shortcode('mp3-popout', array(&$mp3_fox, 'popout_link_player'));
148
 
149
  if ( $ops['replace_WP_playlist'] === 'true' && ! is_admin() ) {
150
- if ( shortcode_exists('playlist') ) {
151
- remove_shortcode('playlist');
152
- }
153
  add_shortcode('playlist', array(&$mp3_fox, 'replacePlaylistShortcode'));
154
  }
155
 
156
  if ( ! is_admin() && ($ops['replace_WP_audio'] === 'true' || $ops['replace_WP_embedded'] === 'true' || $ops['replace_WP_attached'] === 'true') ) {
157
- if ( shortcode_exists('audio') ) {
158
- remove_shortcode('audio');
159
- }
160
  add_shortcode('audio', array(&$mp3_fox, 'replaceAudioShortcode'));
161
  }
162
 
3
  Plugin Name: MP3-jPlayer
4
  Plugin URI: http://mp3-jplayer.com
5
  Description: Easy, Flexible Audio for WordPress.
6
+ Version: 2.1
7
  Author: Simon Ward
8
  Author URI: http://www.sjward.org
9
  License: GPL2
24
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
  */
26
 
27
+
28
+ if ( ! function_exists( 'get_bloginfo' ) ) {
29
+ die();
30
+ }
31
+
32
+
33
  $mp3j_path = dirname(__FILE__);
34
  include_once( $mp3j_path . '/main.php');
35
  include_once( $mp3j_path . '/frontend.php'); //extends main
146
  add_shortcode('mp3j', array(&$mp3_fox, 'inline_play_graphic'));
147
  add_shortcode('mp3-jplayer', array(&$mp3_fox, 'primary_player'));
148
 
149
+ //if ( shortcode_exists('popout') ) {
150
+ remove_shortcode('popout');
151
+ //}
152
  add_shortcode('popout', array(&$mp3_fox, 'popout_link_player'));
153
  add_shortcode('mp3-popout', array(&$mp3_fox, 'popout_link_player'));
154
 
155
  if ( $ops['replace_WP_playlist'] === 'true' && ! is_admin() ) {
156
+ //if ( shortcode_exists('playlist') ) {
157
+ remove_shortcode('playlist');
158
+ //}
159
  add_shortcode('playlist', array(&$mp3_fox, 'replacePlaylistShortcode'));
160
  }
161
 
162
  if ( ! is_admin() && ($ops['replace_WP_audio'] === 'true' || $ops['replace_WP_embedded'] === 'true' || $ops['replace_WP_attached'] === 'true') ) {
163
+ //if ( shortcode_exists('audio') ) {
164
+ remove_shortcode('audio');
165
+ //}
166
  add_shortcode('audio', array(&$mp3_fox, 'replaceAudioShortcode'));
167
  }
168
 
popout.php CHANGED
@@ -32,7 +32,7 @@
32
 
33
  if( window.opener && !window.opener.closed && window.opener.MP3_JPLAYER && window.opener.MP3_JPLAYER.launched_ID !== null ) {
34
 
35
- loadcss( window.opener.MP3_JPLAYER.vars.stylesheet_url );
36
 
37
  MP3_JPLAYER.vars.play_f = false; // always set false!
38
  MP3_JPLAYER.plugin_path = window.opener.MP3_JPLAYER.plugin_path;
32
 
33
  if( window.opener && !window.opener.closed && window.opener.MP3_JPLAYER && window.opener.MP3_JPLAYER.launched_ID !== null ) {
34
 
35
+ loadcss( window.opener.MP3_JPLAYER.vars.stylesheet_url );
36
 
37
  MP3_JPLAYER.vars.play_f = false; // always set false!
38
  MP3_JPLAYER.plugin_path = window.opener.MP3_JPLAYER.plugin_path;
readme.txt CHANGED
@@ -3,35 +3,34 @@ Author URI: http://sjward.org
3
  Plugin URI: http://mp3-jplayer.com
4
  Contributors: simon.ward
5
  Donate link: http://www.sjward.org/jplayer-for-wordpress
6
- Tags: audio, audio player, audio playlist, mp3 player, music player, playlist player, media player, audio widget, audio download, html5 audio, music player, create audio playlist, mp3, music, html5, flash, jplayer, playlist, jquery, shortcode, widget, css, post, page, sidebar, html 5
7
  License: GPLv2 or later
8
  Requires at least: 2.9
9
  Tested up to: 4.1
10
- Stable tag: 2.0
11
 
12
  Easy, Flexible Audio for WordPress.
13
 
14
  == Description ==
15
 
16
- = Mobile friendly HTML5 audio players and audio playlists =
17
 
18
- * Add player styling and colour options, flexible playlist players and single-file audio players, popout players and popout links, audio widgets, and downloads to your site.
19
 
20
- * Works with all built-in WordPress options for adding your audio, including the recently introduced *Create Audio Playlist* drag & drop interface.
21
 
22
 
23
- [Player Demos](http://mp3-jplayer.com/playlist-players/)
 
 
24
 
25
- [How to Add Your Players](http://mp3-jplayer.com/adding-players)
26
 
27
- [Help & Docs](http://mp3-jplayer.com/help-docs)
28
-
29
-
30
- 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 players. Here's a few of the features:
31
 
32
  * Flexible multi-player plugin, add unlimited players to pages, posts, sidebars, and template files.
33
  * Offer audio downloads to visitors or logged-in users.
34
  * Playlist entire folders with one simple command.
 
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 link.
37
  * Shortcode parameters to give you individual control of player heights, widths, volumes, downloads, player styling, and allow you to play from your library, local folders or urls.
@@ -104,6 +103,12 @@ Either on the [forum at Wordpress](https://wordpress.org/support/plugin/mp3-jpla
104
 
105
  == Changelog ==
106
 
 
 
 
 
 
 
107
  = 2.0 =
108
  * Improved plugin integration with core Wordpress media handling operations, such as those accessed with the 'Add Media' button, featured images for audio, embeded audio, attached audio, and pasted urls.
109
  * Added support for all common file formats, the plugin now supports mp3, m4a, mp4, oga, ogg, wav, webm, webma files. Caution - Please see [Audio Format Advice](http://mp3-jplayer.com/audio-format-advice/) for help with choosing good formats for the web.
3
  Plugin URI: http://mp3-jplayer.com
4
  Contributors: simon.ward
5
  Donate link: http://www.sjward.org/jplayer-for-wordpress
6
+ Tags: audio, audio player, audio playlist, mp3 player, music player, media, playlist player, media player, audio widget, audio download, html5 audio, music player, create audio playlist, mp3, music, html5, flash, jplayer, playlist, jquery, shortcode, widget, css, post, page, sidebar, html 5
7
  License: GPLv2 or later
8
  Requires at least: 2.9
9
  Tested up to: 4.1
10
+ Stable tag: 2.1
11
 
12
  Easy, Flexible Audio for WordPress.
13
 
14
  == Description ==
15
 
16
+ = Mobile friendly HTML5 audio players and audio playlist players =
17
 
18
+ * Add audio player styling and colour options, flexible music playlist players and single-file audio players, popout players and popout links, audio widget players, and downloads to your site.
19
 
20
+ * Works with all built-in WordPress options for adding your music, including the recently introduced *Create Audio Playlist* drag & drop interface.
21
 
22
 
23
+ [Player Demos](http://mp3-jplayer.com/player-skins/) <br>
24
+ [How to Add Your Players](http://mp3-jplayer.com/adding-players/) <br>
25
+ [Help & Docs](http://mp3-jplayer.com/help-docs/)
26
 
 
27
 
28
+ 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:
 
 
 
29
 
30
  * Flexible multi-player plugin, add unlimited players to pages, posts, sidebars, and template files.
31
  * Offer audio downloads to visitors or logged-in users.
32
  * Playlist entire folders with one simple command.
33
+ * Can be selectively integrated with WordPress default audio players.
34
  * Customise the colour scheme, fonts, title and image placements and more on the Player Design page.
35
  * A fully integrated Pop-out player that can be launched from playlist players, or from a stand-alone link.
36
  * Shortcode parameters to give you individual control of player heights, widths, volumes, downloads, player styling, and allow you to play from your library, local folders or urls.
103
 
104
  == Changelog ==
105
 
106
+ = 2.1 =
107
+ * Fixed plugin compatibility with old versions of WP pre 3.6.
108
+ * Fixed the widget's folder feed (it was picking up all audio regardless of chosen formats), and the admin-side info message that shows the track count.
109
+ * Added a 'Show images' tick option on the widget (this controls the display of any featured images that you've set for the audio).
110
+ * Made player's download link immediately visible upon page load (previously users needed to start a track in order to make the first download link available).
111
+
112
  = 2.0 =
113
  * Improved plugin integration with core Wordpress media handling operations, such as those accessed with the 'Add Media' button, featured images for audio, embeded audio, attached audio, and pasted urls.
114
  * Added support for all common file formats, the plugin now supports mp3, m4a, mp4, oga, ogg, wav, webm, webma files. Caution - Please see [Audio Format Advice](http://mp3-jplayer.com/audio-format-advice/) for help with choosing good formats for the web.
widget-ui.php CHANGED
@@ -92,7 +92,7 @@ if ( class_exists("WP_Widget") ) {
92
  return;
93
  }
94
  $SHORTCODE .= ' tracks="' . $urls . '"';
95
- $SHORTCODE .= ' images="true"';
96
  }
97
 
98
  //params
@@ -101,11 +101,13 @@ if ( class_exists("WP_Widget") ) {
101
  $loop = ( $instance['loop'] == "true" ) ? "y" : "n";
102
  $pn = ( $instance['pn_buttons'] == "true" ) ? "y" : "n";
103
  $stop = ( $instance['stop_button'] == "true" ) ? "y" : "n";
 
104
  $SHORTCODE .= ' list="' . $list . '"';
105
  $SHORTCODE .= ' autoplay="' . $autoplay . '"';
106
  $SHORTCODE .= ' loop="' . $loop . '"';
107
  $SHORTCODE .= ' pn="' . $pn . '"';
108
  $SHORTCODE .= ' stop="' . $stop . '"';
 
109
  //
110
  $SHORTCODE .= ' vol="' . $instance['volume'] . '"';
111
  $SHORTCODE .= ' dload="' . $instance['download_link'] . '"';
@@ -140,6 +142,8 @@ if ( class_exists("WP_Widget") ) {
140
  /* Updates the widget settings (required by api) */
141
  function update( $new_instance, $old_instance ) {
142
 
 
 
143
  $instance = $old_instance;
144
  $instance['title'] = $new_instance['title'];
145
  $instance['id_to_play'] = strip_tags( $new_instance['id_to_play'] );
@@ -163,7 +167,9 @@ if ( class_exists("WP_Widget") ) {
163
  $instance['stop_button'] = $new_instance['stop_button'];
164
  $instance['player_height'] = $new_instance['player_height'];
165
  $instance['style'] = $new_instance['style'];
 
166
 
 
167
  $instance['folder_to_play'] = strip_tags( $new_instance['folder_to_play'] );
168
  if ( strpos($instance['folder_to_play'], "http://") === false && strpos($instance['folder_to_play'], "www.") === false ) {
169
  if ( !empty($instance['folder_to_play']) ) {
@@ -174,6 +180,10 @@ if ( class_exists("WP_Widget") ) {
174
  }
175
  }
176
  }
 
 
 
 
177
 
178
  $instance['volume'] = preg_replace("/[^0-9]/", "", $new_instance['volume']);
179
  if ($instance['volume'] < 0 || $instance['volume']=="") { $instance['volume'] = "0"; }
@@ -201,7 +211,7 @@ if ( class_exists("WP_Widget") ) {
201
  'play_page' => 'false',
202
  'slice_size' => '',
203
  'play_folder' => 'false',
204
- 'folder_to_play' => '',
205
  'download_link' => $mp3_fox->theSettings['show_downloadmp3'],
206
  'playlist_mode' => $mp3_fox->theSettings['playlist_show'],
207
  'player_width' => '100%',
@@ -210,10 +220,11 @@ if ( class_exists("WP_Widget") ) {
210
  'volume' => $mp3_fox->theSettings['initial_vol'],
211
  'mods' => 'false',
212
  'position' => 'rel-L',
213
- 'pn_buttons' => 'true',
214
  'stop_button' => 'false',
215
  'player_height' => $mp3_fox->theSettings['playerHeight'],
216
- 'style' => 'nolistbutton'
 
217
  );
218
 
219
  $instance = wp_parse_args( (array) $instance, $defaultvalues );
@@ -241,21 +252,29 @@ if ( class_exists("WP_Widget") ) {
241
  My library</p>
242
 
243
  <?php
 
244
  if ( $instance['folder_to_play'] == "" ) {
245
  $folder = $mp3_fox->theSettings['mp3_dir'];
246
  } else {
247
  $folder = $instance['folder_to_play'];
248
  }
249
- $foldertracks = $mp3_fox->grabFolderURLs( $folder );
 
 
 
 
 
 
 
250
  if ( $foldertracks !== true && $foldertracks !== false ) {
251
  if ( ($c = count($foldertracks)) > 0 ) {
252
  $style = "color:#282;";
253
- $txt = $c . "&nbsp;mp3";
254
- if ( $c != 1 ) { $txt .= "'s"; }
255
- $txt .= "&nbsp;in this folder";
256
  } else {
257
  $style = "color:#aaa;";
258
- $txt = "There are no mp3's here";
259
  }
260
  } elseif ( $foldertracks === true ) {
261
  $txt = "Folder not found, check path<br />and permissions";
@@ -289,6 +308,9 @@ if ( class_exists("WP_Widget") ) {
289
 
290
  <p style="margin:0 0 2px 0;"><input type="checkbox" id="<?php echo $this->get_field_id( 'playlist_mode' ); ?>" name="<?php echo $this->get_field_name( 'playlist_mode' ); ?>" value="true" <?php if ($instance['playlist_mode'] == "true") { _e('checked="checked"', "mp3jplayerwidget"); }?> />
291
  <strong>Show playlist</strong></p>
 
 
 
292
 
293
  <p style="margin:0 0 2px 0;"><input type="checkbox" id="<?php echo $this->get_field_id( 'stop_button' ); ?>" name="<?php echo $this->get_field_name( 'stop_button' ); ?>" value="true" <?php if ($instance['stop_button'] == "true") { _e('checked="checked"', "mp3jplayerwidget"); }?> />
294
  <strong>Stop button</strong></p>
92
  return;
93
  }
94
  $SHORTCODE .= ' tracks="' . $urls . '"';
95
+ //$SHORTCODE .= ' images="true"';
96
  }
97
 
98
  //params
101
  $loop = ( $instance['loop'] == "true" ) ? "y" : "n";
102
  $pn = ( $instance['pn_buttons'] == "true" ) ? "y" : "n";
103
  $stop = ( $instance['stop_button'] == "true" ) ? "y" : "n";
104
+ $images = ( $instance['images'] == "true" ) ? "true" : "false";
105
  $SHORTCODE .= ' list="' . $list . '"';
106
  $SHORTCODE .= ' autoplay="' . $autoplay . '"';
107
  $SHORTCODE .= ' loop="' . $loop . '"';
108
  $SHORTCODE .= ' pn="' . $pn . '"';
109
  $SHORTCODE .= ' stop="' . $stop . '"';
110
+ $SHORTCODE .= ' images="' . $images . '"';
111
  //
112
  $SHORTCODE .= ' vol="' . $instance['volume'] . '"';
113
  $SHORTCODE .= ' dload="' . $instance['download_link'] . '"';
142
  /* Updates the widget settings (required by api) */
143
  function update( $new_instance, $old_instance ) {
144
 
145
+ global $mp3_fox;
146
+
147
  $instance = $old_instance;
148
  $instance['title'] = $new_instance['title'];
149
  $instance['id_to_play'] = strip_tags( $new_instance['id_to_play'] );
167
  $instance['stop_button'] = $new_instance['stop_button'];
168
  $instance['player_height'] = $new_instance['player_height'];
169
  $instance['style'] = $new_instance['style'];
170
+ $instance['images'] = $new_instance['images'];
171
 
172
+ /*
173
  $instance['folder_to_play'] = strip_tags( $new_instance['folder_to_play'] );
174
  if ( strpos($instance['folder_to_play'], "http://") === false && strpos($instance['folder_to_play'], "www.") === false ) {
175
  if ( !empty($instance['folder_to_play']) ) {
180
  }
181
  }
182
  }
183
+ */
184
+
185
+ //$instance['folder_to_play'] = $mp3_fox->prep_path( strip_tags( $new_instance['folder_to_play'] ) );
186
+ $instance['folder_to_play'] = $mp3_fox->prep_path( $new_instance['folder_to_play'] );
187
 
188
  $instance['volume'] = preg_replace("/[^0-9]/", "", $new_instance['volume']);
189
  if ($instance['volume'] < 0 || $instance['volume']=="") { $instance['volume'] = "0"; }
211
  'play_page' => 'false',
212
  'slice_size' => '',
213
  'play_folder' => 'false',
214
+ 'folder_to_play' => $mp3_fox->theSettings['mp3_dir'],
215
  'download_link' => $mp3_fox->theSettings['show_downloadmp3'],
216
  'playlist_mode' => $mp3_fox->theSettings['playlist_show'],
217
  'player_width' => '100%',
220
  'volume' => $mp3_fox->theSettings['initial_vol'],
221
  'mods' => 'false',
222
  'position' => 'rel-L',
223
+ 'pn_buttons' => 'false',
224
  'stop_button' => 'false',
225
  'player_height' => $mp3_fox->theSettings['playerHeight'],
226
+ 'style' => 'nolistbutton',
227
+ 'images' => 'true'
228
  );
229
 
230
  $instance = wp_parse_args( (array) $instance, $defaultvalues );
252
  My library</p>
253
 
254
  <?php
255
+ /*
256
  if ( $instance['folder_to_play'] == "" ) {
257
  $folder = $mp3_fox->theSettings['mp3_dir'];
258
  } else {
259
  $folder = $instance['folder_to_play'];
260
  }
261
+ */
262
+
263
+ $folder = $instance['folder_to_play'];
264
+ //$folder = '/music/sub';
265
+ //$foldertracks = $mp3_fox->grabFolderURLs( $folder );
266
+ $fdetails = $mp3_fox->grabFolderURLs( $folder, $mp3_fox->formatsFeedRegex );
267
+ $foldertracks = ( isset($fdetails['files']) ) ? $fdetails['files'] : false;
268
+
269
  if ( $foldertracks !== true && $foldertracks !== false ) {
270
  if ( ($c = count($foldertracks)) > 0 ) {
271
  $style = "color:#282;";
272
+ $txt = $c . "&nbsp;file";
273
+ if ( $c != 1 ) { $txt .= "s"; }
274
+ $txt .= "&nbsp; available";
275
  } else {
276
  $style = "color:#aaa;";
277
+ $txt = "There are no audio files here";
278
  }
279
  } elseif ( $foldertracks === true ) {
280
  $txt = "Folder not found, check path<br />and permissions";
308
 
309
  <p style="margin:0 0 2px 0;"><input type="checkbox" id="<?php echo $this->get_field_id( 'playlist_mode' ); ?>" name="<?php echo $this->get_field_name( 'playlist_mode' ); ?>" value="true" <?php if ($instance['playlist_mode'] == "true") { _e('checked="checked"', "mp3jplayerwidget"); }?> />
310
  <strong>Show playlist</strong></p>
311
+
312
+ <p style="margin:0 0 2px 0;"><input type="checkbox" id="<?php echo $this->get_field_id( 'images' ); ?>" name="<?php echo $this->get_field_name( 'images' ); ?>" value="true" <?php if ($instance['images'] == "true") { _e('checked="checked"', "mp3jplayerwidget"); }?> />
313
+ <strong>Show images</strong></p>
314
 
315
  <p style="margin:0 0 2px 0;"><input type="checkbox" id="<?php echo $this->get_field_id( 'stop_button' ); ?>" name="<?php echo $this->get_field_name( 'stop_button' ); ?>" value="true" <?php if ($instance['stop_button'] == "true") { _e('checked="checked"', "mp3jplayerwidget"); }?> />
316
  <strong>Stop button</strong></p>