Skip to content
This repository has been archived by the owner on Jan 8, 2021. It is now read-only.

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 2d5337f + d0da56c commit 2146d35
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 2146d35

Please sign in to comment.