Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayer.js |
— | — | @@ -1042,78 +1042,13 @@ |
1043 | 1043 | }, |
1044 | 1044 | |
1045 | 1045 | /** |
1046 | | - * Updates the thumbnail if the thumbnail is being displayed |
1047 | | - * |
1048 | | - * @param {String} |
1049 | | - * src New src of thumbnail |
1050 | | - * @param {Boolean} |
1051 | | - * quickSwitch true switch happens instantly false / undefined |
1052 | | - * animated cross fade |
1053 | | - */ |
1054 | | - updatePosterSrc: function( src, quickSwitch ) { |
1055 | | - // make sure we don't go to the same url if we are not already updating: |
1056 | | - if ( !this.thumbnailUpdatingFlag && $( '#img_thumb_' + this.id ).attr( 'src' ) == src ) |
1057 | | - return false; |
1058 | | - // if we are already updating don't issue a new update: |
1059 | | - if ( this.thumbnailUpdatingFlag && $( '#new_img_thumb_' + this.id ).attr( 'src' ) == src ) |
1060 | | - return false; |
1061 | | - |
1062 | | - mw.log( 'update thumb: ' + src ); |
1063 | | - |
1064 | | - if ( quickSwitch ) { |
1065 | | - $( '#img_thumb_' + this.id ).attr( 'src', src ); |
1066 | | - return ; |
1067 | | - } |
1068 | | - var _this = this; |
1069 | | - // if still animating remove new_img_thumb_ |
1070 | | - if ( this.thumbnailUpdatingFlag == true ) |
1071 | | - $( '#new_img_thumb_' + this.id ).stop().remove(); |
1072 | | - |
1073 | | - if ( this.posterDisplayed ) { |
1074 | | - mw.log( 'set to thumb:' + src ); |
1075 | | - this.thumbnailUpdatingFlag = true; |
1076 | | - $( this ).append( |
1077 | | - $('<img />') |
1078 | | - .attr({ |
1079 | | - 'src' : src, |
1080 | | - 'id' : 'new_img_thumb_' + this.id, |
1081 | | - 'width' : this.width, |
1082 | | - 'height': this.height |
1083 | | - }) |
1084 | | - .css( { |
1085 | | - 'display' : 'none', |
1086 | | - 'position' : 'absolute', |
1087 | | - 'z-index' : 2, |
1088 | | - 'top' : '0px', |
1089 | | - 'left' : '0px' |
1090 | | - }) |
1091 | | - ); |
1092 | | - // mw.log('appended: new_img_thumb_'); |
1093 | | - $( '#new_img_thumb_' + this.id ).fadeIn( "slow", function() { |
1094 | | - // once faded in remove org and rename new: |
1095 | | - $( '#img_thumb_' + _this.id ) |
1096 | | - .replaceWith( $( '#new_img_thumb_' + _this.id ) ) |
1097 | | - .attr( 'id', 'img_thumb_' + _this.id ) |
1098 | | - .css( 'z-index', '1' ); |
1099 | | - |
1100 | | - _this.thumbnailUpdatingFlag = false; |
1101 | | - |
1102 | | - // if we have a thumb queued update to that |
1103 | | - if ( _this.lastThumbUrl ) { |
1104 | | - var src_url = _this.lastThumbUrl; |
1105 | | - _this.lastThumbUrl = null; |
1106 | | - _this.updatePosterSrc( src_url ); |
1107 | | - } |
1108 | | - } ); |
1109 | | - } |
1110 | | - }, |
1111 | | - |
1112 | | - /** |
1113 | 1046 | * Update the poster source |
1114 | | - * @param {String} url to poster src |
1115 | | - */ |
| 1047 | + * @param {String} |
| 1048 | + * posterSrc Poster src url |
| 1049 | + */ |
1116 | 1050 | updatePosterSrc: function( posterSrc ){ |
1117 | 1051 | this.poster = posterSrc; |
| 1052 | + this.updatePosterHTML(); |
1118 | 1053 | }, |
1119 | 1054 | /** |
1120 | 1055 | * Update the player with thumbnail and play button. |