Clean up whitespace in inner loop
Open a new scope so that we can make a local alias for the first tag left in the segment parser. Avoid breaking lines in weird places.
Showing
1 changed file
with
12 additions
and
9 deletions
... | @@ -393,17 +393,20 @@ var | ... | @@ -393,17 +393,20 @@ var |
393 | // if we're refilling the buffer after a seek, scan through the muxed | 393 | // if we're refilling the buffer after a seek, scan through the muxed |
394 | // FLV tags until we find the one that is closest to the desired | 394 | // FLV tags until we find the one that is closest to the desired |
395 | // playback time | 395 | // playback time |
396 | if (typeof offset === 'number') { | 396 | if (typeof offset === 'number') { |
397 | while (segmentParser.getTags()[0].pts < offset) { | 397 | (function() { |
398 | segmentParser.getNextTag(); | 398 | var tag = segmentParser.getTags()[0]; |
399 | |||
400 | for (; tag.pts < offset; tag = segmentParser.getTags()[0]) { | ||
401 | segmentParser.getNextTag(); | ||
402 | } | ||
403 | |||
404 | // tell the SWF where we will be seeking to | ||
405 | player.hls.el().vjs_setProperty('currentTime', tag.pts * 0.001); | ||
406 | lastSeekedTime = null; | ||
407 | })(); | ||
399 | } | 408 | } |
400 | 409 | ||
401 | // tell the SWF where we will be seeking to | ||
402 | player.hls.el().vjs_setProperty('currentTime', | ||
403 | segmentParser.getTags()[0].pts * 0.001); | ||
404 | lastSeekedTime = null; | ||
405 | } | ||
406 | |||
407 | while (segmentParser.tagsAvailable()) { | 410 | while (segmentParser.tagsAvailable()) { |
408 | // queue up the bytes to be appended to the SourceBuffer | 411 | // queue up the bytes to be appended to the SourceBuffer |
409 | // the queue gives control back to the browser between tags | 412 | // the queue gives control back to the browser between tags | ... | ... |
-
Please register or sign in to post a comment