Index: trunk/phase3/js2/remoteMwEmbed.js |
— | — | @@ -84,13 +84,16 @@ |
85 | 85 | |
86 | 86 | // Parsed values: |
87 | 87 | var src = ''; |
88 | | - var duration = ''; |
| 88 | + var duration_attr = ''; |
89 | 89 | var wikiTitleKey = $j( '#'+vidId + ' img').filter(':first').attr('alt').replace(/ /g, '_'); |
90 | 90 | var re = new RegExp( /videoUrl(":?\s*)*([^&]*)/ ); |
91 | 91 | src = re.exec( $j( '#'+vidId ).html() )[2]; |
92 | 92 | |
93 | | - var re = new RegExp( /length(":?\s*)*([^&]*)/ ); |
94 | | - duration = re.exec( $j( '#'+vidId ).html() )[2]; |
| 93 | + var re = new RegExp( /length(":?\s*)*([^,]*)/ ); |
| 94 | + var dv = re.exec( $j( '#'+vidId ).html() )[2]; |
| 95 | + if( dv ){ |
| 96 | + duration_attr = 'durationHint="'+ dv +'" '; |
| 97 | + } |
95 | 98 | |
96 | 99 | var re = new RegExp( /offset(":?\s*)*([^&]*)/ ); |
97 | 100 | offset = re.exec( $j( '#'+vidId ).html() )[2]; |
— | — | @@ -99,10 +102,10 @@ |
100 | 103 | if( src ) { |
101 | 104 | var html_out = ''; |
102 | 105 | |
103 | | - var common_attr = ' id="vid_' + i +'" '+ |
| 106 | + var common_attr = ' id="mwe_' + vidId +'" '+ |
104 | 107 | 'wikiTitleKey="' + wikiTitleKey + '" ' + |
105 | 108 | 'src="' + src + '" ' + |
106 | | - 'durationHint="' + duration + '" ' + |
| 109 | + duration_attr + |
107 | 110 | offset_attr + ' '; |
108 | 111 | |
109 | 112 | if( tag_type == 'audio' ){ |
— | — | @@ -118,7 +121,7 @@ |
119 | 122 | .css('height', pheight + 30); |
120 | 123 | |
121 | 124 | } |
122 | | - rewrite_by_id( vidId, function(){ |
| 125 | + rewrite_by_id( 'mwe_' + vidId, function(){ |
123 | 126 | if(vidIdList.length != 0){ |
124 | 127 | alert('did first rewite now doing another'); |
125 | 128 | setTimeout( function(){ |