Index: trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js |
— | — | @@ -29,7 +29,7 @@ |
30 | 30 | "share" : "Share", |
31 | 31 | "credits" : "Credits", |
32 | 32 | "clip_linkback" : "Clip source page", |
33 | | - "chose_player" : "Choose video player", |
| 33 | + "chose_player" : "Choose Video Player", |
34 | 34 | "share_this_video" : "Share this video", |
35 | 35 | "video_credits" : "Video credits", |
36 | 36 | "menu_btn" : "Menu", |
— | — | @@ -139,11 +139,21 @@ |
140 | 140 | this.supports['closed_captions']=true; |
141 | 141 | |
142 | 142 | var o=''; |
| 143 | + //get the length of the scruber |
| 144 | + this.player_head_length = embedObj.playerPixelWidth(); |
143 | 145 | for( var i in this.components ){ |
144 | 146 | if( this.supports[i] ){ |
| 147 | + if( i != 'play_head'){ |
| 148 | + js_log(this.player_head_length + ' - ph: ' + this.components[i].w ); |
| 149 | + this.player_head_length -= this.components[i].w; |
| 150 | + } |
| 151 | + } |
| 152 | + } |
| 153 | + for(var i in this.components){ |
| 154 | + if( this.supports[i] ){ |
145 | 155 | if( this.available_width > this.components[i].w ){ |
146 | 156 | //special case with playhead don't add unless we have 60px |
147 | | - if( i == 'play_head' && ctrlBuilder.available_width < 60 ) |
| 157 | + if( i == 'play_head' && this.player_head_length < 60 ) |
148 | 158 | continue; |
149 | 159 | o+=this.components[i].o(); |
150 | 160 | this.available_width -= this.components[i].w; |
— | — | @@ -151,7 +161,7 @@ |
152 | 162 | js_log('not enough space for control component:' + i); |
153 | 163 | } |
154 | 164 | } |
155 | | - } |
| 165 | + } |
156 | 166 | return o; |
157 | 167 | }, |
158 | 168 | /* |
— | — | @@ -227,7 +237,7 @@ |
228 | 238 | }); |
229 | 239 | |
230 | 240 | //fullscreen binding: |
231 | | - $j('#fullscreen_'+embedObj.id).unbind().btnBind().click(function(){ |
| 241 | + $j('#fullscreen_' + embedObj.id).unbind().btnBind().click(function(){ |
232 | 242 | $j('#' +embedObj.id).get(0).fullscreen(); |
233 | 243 | }); |
234 | 244 | |
— | — | @@ -454,7 +464,7 @@ |
455 | 465 | } |
456 | 466 | }, |
457 | 467 | 'pause':{ |
458 | | - 'w':147, //28 147 |
| 468 | + 'w':28, //28 147 |
459 | 469 | 'o':function(){ |
460 | 470 | return '<button class="play-btn ui-state-default ui-corner-all" title="' + |
461 | 471 | gM('play_clip') + '" ><span class="ui-icon ui-icon-play"></span></button>' |
— | — | @@ -464,7 +474,7 @@ |
465 | 475 | 'w':0, //special case (takes up remaining space) |
466 | 476 | 'o':function(){ |
467 | 477 | return '<div class="ui-slider ui-slider-horizontal ui-corner-all j-scrubber"' + |
468 | | - ' style="width:' + ( ctrlBuilder.available_width - 30 ) + 'px;"></div>' |
| 478 | + ' style="width:' + ( ctrlBuilder.player_head_length - 30 ) + 'px;"></div>' |
469 | 479 | } |
470 | 480 | }, |
471 | 481 | 'time_display':{ |
— | — | @@ -474,7 +484,7 @@ |
475 | 485 | } |
476 | 486 | }, |
477 | 487 | 'volume_control':{ |
478 | | - 'w':47, |
| 488 | + 'w':40, |
479 | 489 | 'o':function(){ |
480 | 490 | return '<button class="ui-state-default ui-corner-all k-volume">' + |
481 | 491 | '<span class="ui-icon ui-icon-volume-on"></span>' + |
— | — | @@ -1748,7 +1758,7 @@ |
1749 | 1759 | html_code +='</div>'; |
1750 | 1760 | //block out some space by encapulating the top level div |
1751 | 1761 | $j(this).wrap('<div style="width:'+parseInt(this.width)+'px;height:' |
1752 | | - + (parseInt(this.height) + ctrlBuilder.height )+'px" id="k-player_' + this.id + '" class="k-player"></div>'); |
| 1762 | + + (parseInt(this.height) + ctrlBuilder.height )+'px" id="k-player_' + this.id + '" class="k-player ui-widget"></div>'); |
1753 | 1763 | } |
1754 | 1764 | |
1755 | 1765 | //js_log('should set: '+this.id); |
— | — | @@ -2106,11 +2116,10 @@ |
2107 | 2117 | showPlayerselect:function( target ){ |
2108 | 2118 | //get id (in case where we have a parent container) |
2109 | 2119 | var this_id = (this.pc!=null)?this.pc.pp.id:this.id; |
2110 | | - |
2111 | 2120 | var _this=this; |
2112 | 2121 | // var out= '<span style="color:#FFF;background-color:black;"><blockquote style="background-color:black;">'; |
2113 | | - var out= ''; |
2114 | | - out+='<h2>' + gM('chose_player') + '</h2>'; |
| 2122 | + var o= ''; |
| 2123 | + o+='<h2>' + gM('chose_player') + '</h2>'; |
2115 | 2124 | var _this=this; |
2116 | 2125 | //js_log('selected src'+ _this.media_element.selected_source.url); |
2117 | 2126 | $j.each( this.media_element.getPlayableSources(), function(source_id, source){ |
— | — | @@ -2120,7 +2129,7 @@ |
2121 | 2130 | var image_src = mv_skin_img_path ; |
2122 | 2131 | |
2123 | 2132 | //set the Playable source type: |
2124 | | - if( source.mime_type == 'video/x-flv' ){ |
| 2133 | + /*if( source.mime_type == 'video/x-flv' ){ |
2125 | 2134 | image_src += 'flash_icon_'; |
2126 | 2135 | }else if( source.mime_type == 'video/h264'){ |
2127 | 2136 | //for now all mp4 content is pulled from archive.org (so use archive.org icon) |
— | — | @@ -2130,37 +2139,40 @@ |
2131 | 2140 | } |
2132 | 2141 | image_src += is_selected ? 'color':'bw'; |
2133 | 2142 | image_src += '.png'; |
2134 | | - |
2135 | | - if (default_player) |
2136 | | - { |
2137 | | - out+=' <ul>'; |
| 2143 | + */ |
| 2144 | + if (default_player){ |
| 2145 | + o+='<ul>'; |
2138 | 2146 | //output the player select code: |
2139 | 2147 | var supporting_players = embedTypes.players.getMIMETypePlayers( source.getMIMEType() ); |
2140 | 2148 | |
2141 | 2149 | for(var i=0; i < supporting_players.length ; i++){ |
2142 | 2150 | if( _this.selected_player.id == supporting_players[i].id && is_selected ){ |
2143 | | - out+='<li>' + supporting_players[i].getName() +'</li>'; |
| 2151 | + o+='<li>' + |
| 2152 | + '<a href="#" class="active" rel="sel_source" id="sc_' + source_id + '_' + supporting_players[i].id +'">' + |
| 2153 | + supporting_players[i].getName() + |
| 2154 | + '</li>'; |
2144 | 2155 | }else{ |
2145 | 2156 | //else gray plugin and the plugin with link to select |
2146 | | -// out+='<li style="margin-left:20px;">'+ |
2147 | | -// '<a href="#" class="sel_source" id="sc_' + source_id + '_' + supporting_players[i].id +'">'+ |
2148 | | -// '<img border="0" width="16" height="16" src="' + mv_skin_img_path + 'plugin_disabled.png">'+ |
2149 | | -// supporting_players[i].getName() + |
2150 | | -// '</a>'+ |
2151 | | - out+='<li>' + |
2152 | | - '<a href="#" id="dc_' + source_id + '_' + supporting_players[i].id +'">' + |
2153 | | - supporting_players[i].getName() + '</a><li>'; |
| 2157 | + /*out+='<li style="margin-left:20px;">'+ |
| 2158 | + '<a href="#" class="sel_source" id="sc_' + source_id + '_' + supporting_players[i].id +'">'+ |
| 2159 | + '<img border="0" width="16" height="16" src="' + mv_skin_img_path + 'plugin_disabled.png">'+ |
| 2160 | + supporting_players[i].getName() + |
| 2161 | + '</a>'+*/ |
| 2162 | + o+='<li>' + |
| 2163 | + '<a href="#" rel="sel_source" id="sc_' + source_id + '_' + supporting_players[i].id +'">' + |
| 2164 | + supporting_players[i].getName() + '</a>' + |
| 2165 | + '</li>'; |
2154 | 2166 | } |
2155 | 2167 | } |
2156 | | - out+='</ul></div>'; |
2157 | | - }else |
2158 | | - out+= source.getTitle() + ' - no player available'; |
| 2168 | + o+='</ul>'; |
| 2169 | + }else{ |
| 2170 | + o+= source.getTitle() + ' - no player available'; |
| 2171 | + } |
2159 | 2172 | }); |
2160 | | -// out+='</blockquote></span>'; |
2161 | | - $j(target).html(out); |
| 2173 | + $j(target).html(o); |
2162 | 2174 | |
2163 | 2175 | //set up the click bindings: |
2164 | | - $j('.sel_source').each(function(){ |
| 2176 | + $j(target).find("[rel='sel_source']").each(function(){ |
2165 | 2177 | $j(this).click(function(){ |
2166 | 2178 | var iparts = $j(this).attr( 'id' ).replace(/sc_/,'').split('_'); |
2167 | 2179 | var source_id = iparts[0]; |