Skip to content

Commit

Permalink
Merge pull request mediaelement#725 from simonschuh/autorewind
Browse files Browse the repository at this point in the history
Make rewinding at the end optional
  • Loading branch information
johndyer committed Jan 23, 2013
2 parents 790da61 + f2aebf5 commit e7e5731
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/js/mep-player.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
startVolume: 0.8,
// useful for <audio> player loops
loop: false,
// rewind to beginning when media ends
autoRewind: true,
// resize to media dimensions
enableAutosize: true,
// forces the hour marker (##:00:00)
Expand Down Expand Up @@ -613,10 +615,12 @@

// ended for all
t.media.addEventListener('ended', function (e) {
try{
t.media.setCurrentTime(0);
} catch (exp) {

if(t.options.autoRewind) {
try{
t.media.setCurrentTime(0);
} catch (exp) {

}
}
t.media.pause();

Expand Down

0 comments on commit e7e5731

Please sign in to comment.