Skip to content

Commit

Permalink
Start playing video after first chunk is appended
Browse files Browse the repository at this point in the history
  • Loading branch information
ebidel committed Aug 14, 2012
1 parent 3028475 commit 652a588
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions html5-demos.appspot.com/static/media-source.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -192,11 +192,11 @@ <h3>Appending .webm video chunks using the Media Source API</h3>
sourceBuffer.append(new Uint8Array(e.target.result)); sourceBuffer.append(new Uint8Array(e.target.result));
logger.log('appending chunk:' + i); logger.log('appending chunk:' + i);
if (i == NUM_CHUNKS - 1) { if (i == NUM_CHUNKS - 1) {
if (video.paused) {
video.play(); // insure video starts playing.
}
mediaSource.endOfStream(); mediaSource.endOfStream();
} else { } else {
if (video.paused) {
video.play(); // Start playing after 1st chunk is appended.
}
readChunk_(++i); readChunk_(++i);
} }
}; };
Expand Down

0 comments on commit 652a588

Please sign in to comment.