From 852a1e3e07e6cc8433175bba1ecc582883727e40 Mon Sep 17 00:00:00 2001 From: Michael Dale Date: Wed, 19 Aug 2009 11:42:38 +0000 Subject: [PATCH] * playhead width and player select fixes --- js2/mwEmbed/libEmbedVideo/embedVideo.js | 74 ++++++++++++++----------- 1 file changed, 43 insertions(+), 31 deletions(-) diff --git a/js2/mwEmbed/libEmbedVideo/embedVideo.js b/js2/mwEmbed/libEmbedVideo/embedVideo.js index 842c164e46..622b720706 100644 --- a/js2/mwEmbed/libEmbedVideo/embedVideo.js +++ b/js2/mwEmbed/libEmbedVideo/embedVideo.js @@ -29,7 +29,7 @@ loadGM({ "share" : "Share", "credits" : "Credits", "clip_linkback" : "Clip source page", - "chose_player" : "Choose video player", + "chose_player" : "Choose Video Player", "share_this_video" : "Share this video", "video_credits" : "Video credits", "menu_btn" : "Menu", @@ -139,11 +139,21 @@ var ctrlBuilder = { this.supports['closed_captions']=true; var o=''; + //get the length of the scruber + this.player_head_length = embedObj.playerPixelWidth(); for( var i in this.components ){ + if( this.supports[i] ){ + if( i != 'play_head'){ + js_log(this.player_head_length + ' - ph: ' + this.components[i].w ); + this.player_head_length -= this.components[i].w; + } + } + } + for(var i in this.components){ if( this.supports[i] ){ if( this.available_width > this.components[i].w ){ //special case with playhead don't add unless we have 60px - if( i == 'play_head' && ctrlBuilder.available_width < 60 ) + if( i == 'play_head' && this.player_head_length < 60 ) continue; o+=this.components[i].o(); this.available_width -= this.components[i].w; @@ -151,7 +161,7 @@ var ctrlBuilder = { js_log('not enough space for control component:' + i); } } - } + } return o; }, /* @@ -227,7 +237,7 @@ var ctrlBuilder = { }); //fullscreen binding: - $j('#fullscreen_'+embedObj.id).unbind().btnBind().click(function(){ + $j('#fullscreen_' + embedObj.id).unbind().btnBind().click(function(){ $j('#' +embedObj.id).get(0).fullscreen(); }); @@ -454,7 +464,7 @@ var ctrlBuilder = { } }, 'pause':{ - 'w':147, //28 147 + 'w':28, //28 147 'o':function(){ return '' @@ -464,7 +474,7 @@ var ctrlBuilder = { 'w':0, //special case (takes up remaining space) 'o':function(){ return '
' + ' style="width:' + ( ctrlBuilder.player_head_length - 30 ) + 'px;">' } }, 'time_display':{ @@ -474,7 +484,7 @@ var ctrlBuilder = { } }, 'volume_control':{ - 'w':47, + 'w':40, 'o':function(){ return '