Skip to content

Commit

Permalink
Fix source switching on Webkit in SourceChooser
Browse files Browse the repository at this point in the history
  • Loading branch information
moust committed Dec 5, 2012
1 parent 1796588 commit 58acc9b
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 58acc9b

Please sign in to comment.