Skip to content

Commit

Permalink
Merge pull request mediaelement#675 from moust/master
Browse files Browse the repository at this point in the history
Fix source switching on Webkit in SourceChooser
  • Loading branch information
johndyer committed Dec 20, 2012
2 parents 1e95a09 + 58acc9b commit 6d586d2
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/js/mep-feature-sourcechooser.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,15 @@
currentTime = media.currentTime;
paused = media.paused;
media.setSrc(src);
if (!paused) {
media.play();
}
media.load();
media.addEventListener('loadedmetadata', function(e){
this.currentTime = currentTime;
}, true);
media.addEventListener('canplay', function(e){
if (!paused) {
this.play();
}
}, true);
}
});

Expand Down

0 comments on commit 6d586d2

Please sign in to comment.