Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js |
— | — | @@ -1417,8 +1417,15 @@ |
1418 | 1418 | */ |
1419 | 1419 | selectSource:function(index) |
1420 | 1420 | { |
1421 | | - js_log("selected source " + this.sources[index].getTitle()); |
1422 | | - this.selected_source = this.sources[index]; |
| 1421 | + var playable_sources = this.getPlayableSources(); |
| 1422 | + for(var i in playable_sources){ |
| 1423 | + if(i==index){ |
| 1424 | + this.selected_source = playable_sources[i]; |
| 1425 | + break; |
| 1426 | + } |
| 1427 | + } |
| 1428 | + js_log("selected source " + this.sources[index].getTitle()); |
| 1429 | + |
1423 | 1430 | }, |
1424 | 1431 | /** selects the default source via cookie preference, default marked, or by id order |
1425 | 1432 | * */ |
— | — | @@ -2504,13 +2511,13 @@ |
2505 | 2512 | }, |
2506 | 2513 | setSliderValue: function(perc){ |
2507 | 2514 | var id = (this.pc)?this.pc.pp.id:this.id; |
2508 | | - //this.slider.setValue(perc); |
2509 | | - //var cur_slider = $j('#mv_seeker_'+id).width(); |
2510 | | - //var offset_perc = 1-(cur_slider / $j('#mv_seeker_'+id).width()); |
2511 | | - //offset_perc* |
2512 | | - var val = Math.round( perc * $j('#mv_seeker_'+id).width() ); |
2513 | | - $j('#mv_seeker_slider_'+id).css('marginLeft',val); |
2514 | | - js_log('perc in: ' + perc + ' * ' + $j('#mv_seeker_'+id).width() + ' = set to: '+ val); |
| 2515 | + //alinment offset: |
| 2516 | + if(!this.mv_seeker_width) |
| 2517 | + this.mv_seeker_width = $j('#mv_seeker_slider_'+id).width(); |
| 2518 | + |
| 2519 | + var val = Math.round( perc * $j('#mv_seeker_'+id).width() - (this.mv_seeker_width*perc)); |
| 2520 | + $j('#mv_seeker_slider_'+id).css('marginLeft', val ); |
| 2521 | + //js_log('perc in: ' + perc + ' * ' + $j('#mv_seeker_'+id).width() + ' = set to: '+ val + ' - '+ Math.round(this.mv_seeker_width*perc) ); |
2515 | 2522 | //js_log('op:' + offset_perc + ' *('+perc+' * ' + $j('#slider_'+id).width() + ')'); |
2516 | 2523 | }, |
2517 | 2524 | setStatus:function(value){ |