Index: trunk/extensions/MetavidWiki/skins/mv_stream.js |
— | — | @@ -309,19 +309,21 @@ |
310 | 310 | if(previus_scroll2Time_time!=sec_time){ |
311 | 311 | var scroll_mvd_id = null; |
312 | 312 | //init pMvd_id |
313 | | - var pMvd_id=$j('.mv_fd_mvd:first').attr("id").split('_').pop(); |
314 | | - $j('.mv_fd_mvd').each(function(){ |
315 | | - var curTitle = get_titleObject($j(this).attr('name')); |
316 | | - if( curTitle.start_time >= sec_time ){ |
317 | | - //js_log('found mvd pos: ' + curTitle.start_time + ' for sec time: ' + sec_time); |
318 | | - if(previus_scrollMvd_id != pMvd_id){ |
319 | | - scroll_to_pos( pMvd_id ) ; |
320 | | - previus_scrollMvd_id = pMvd_id; |
321 | | - } |
322 | | - return false;//break out of for loop: |
323 | | - } |
324 | | - pMvd_id = $j(this).attr("id").split('_').pop(); |
325 | | - }); |
| 313 | + if($j('.mv_fd_mvd:first')){ |
| 314 | + var pMvd_id=$j('.mv_fd_mvd:first').attr("id").split('_').pop(); |
| 315 | + $j('.mv_fd_mvd').each(function(){ |
| 316 | + var curTitle = get_titleObject($j(this).attr('name')); |
| 317 | + if( curTitle.start_time >= sec_time ){ |
| 318 | + //js_log('found mvd pos: ' + curTitle.start_time + ' for sec time: ' + sec_time); |
| 319 | + if(previus_scrollMvd_id != pMvd_id){ |
| 320 | + scroll_to_pos( pMvd_id ) ; |
| 321 | + previus_scrollMvd_id = pMvd_id; |
| 322 | + } |
| 323 | + return false;//break out of for loop: |
| 324 | + } |
| 325 | + pMvd_id = $j(this).attr("id").split('_').pop(); |
| 326 | + }); |
| 327 | + } |
326 | 328 | } |
327 | 329 | } |
328 | 330 | /*function mv_doShowVideoDownload(){ |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js |
— | — | @@ -2182,6 +2182,7 @@ |
2183 | 2183 | } |
2184 | 2184 | }else{ |
2185 | 2185 | js_log('no annotative track found'); |
| 2186 | + $j('#liks_info_'+this.id).html('no metadata found for next, prev links'); |
2186 | 2187 | } |
2187 | 2188 | //query current request time +|- 60s to get prev next speech links. |
2188 | 2189 | }, |
— | — | @@ -2196,21 +2197,31 @@ |
2197 | 2198 | |
2198 | 2199 | var s_sec = ntp2seconds(curTime[0]); |
2199 | 2200 | var e_sec = ntp2seconds(curTime[1]); |
2200 | | - |
| 2201 | + js_log('showNextPrevLinks: req time: '+ s_sec + ' to ' + e_sec); |
2201 | 2202 | //now we have all the data in anno_data_cache |
| 2203 | + var current_done=false; |
2202 | 2204 | for(var clip_id in this.anno_data_cache){ |
2203 | 2205 | var clip = this.anno_data_cache[clip_id]; |
2204 | 2206 | //js_log('on clip:'+ clip_id); |
2205 | 2207 | //set prev_link (if cur_link is still empty) |
2206 | | - if( s_sec < clip.start_time_sec && e_sec < clip.start_time_sec && link.prev=='') |
| 2208 | + if( s_sec > clip.end_time_sec){ |
2207 | 2209 | link.prev = clip_id; |
| 2210 | + js_log('showNextPrevLinks: ' + s_sec + ' < ' + clip.end_time_sec + ' set prev'); |
| 2211 | + } |
2208 | 2212 | |
2209 | | - //clip is not done e_sec < clip |
2210 | | - if( s_sec > clip.start_time_sec && e_sec < clip.end_time_sec ) |
| 2213 | + if(e_sec==clip.end_time_sec && s_sec== clip.start_time_sec) |
| 2214 | + current_done = true; |
| 2215 | + //current clip is not done: |
| 2216 | + if( e_sec < clip.end_time_sec && link.current=='' && !current_done){ |
2211 | 2217 | link.current = clip_id; |
2212 | | - |
2213 | | - if( e_sec > clip.start_time_sec && link.next=='') |
| 2218 | + js_log('showNextPrevLinks: ' + e_sec + ' < ' + clip.end_time_sec + ' set current'); |
| 2219 | + } |
| 2220 | + |
| 2221 | + //set end clip (first clip where start time is > end_time of req |
| 2222 | + if( e_sec < clip.start_time_sec && link.next==''){ |
2214 | 2223 | link.next = clip_id; |
| 2224 | + js_log('showNextPrevLinks: '+ e_sec + ' < '+ clip.start_time_sec + ' && ' + link.next ); |
| 2225 | + } |
2215 | 2226 | } |
2216 | 2227 | var html=''; |
2217 | 2228 | for(var link_type in link){ |
— | — | @@ -2219,7 +2230,7 @@ |
2220 | 2231 | var clip = this.anno_data_cache[link_id]; |
2221 | 2232 | var title_msg=''; |
2222 | 2233 | for(var j in clip['meta']){ |
2223 | | - title_msg+=j.replace(/_/g,' ') +': ' +clip['meta'][j].replace(/_/g,' ') +" \n"; |
| 2234 | + title_msg+=j.replace(/_/g,' ') +': ' +clip['meta'][j].replace(/_/g,' ') +" <br>"; |
2224 | 2235 | } |
2225 | 2236 | var time_req = clip.time_req; |
2226 | 2237 | if(link_type=='current') //if current start from end of current clip play to end of current meta: |