Question: I am still having problems with the code not stopping the video from rewinding to the beginning. The code that John posted doesn't seem to be working for me.

He said:

> 
> I believe that the default behavior of the element is to go back to the beginning so you'd just need to override this by listening for the ended event.
> 
> 
> 

```
var player = $('#myvideo').mediaelementplayer();

player.media.addEventListener('ended', function(e) {
    player.media.setCurrentTime(player.media.duration);
}, false);

```

I placed the code in the `<head>` and in the `<script type="text/javascript">` on the page with the video and it isn't working... it still rewinds to the start.

What am I doing wrong?

Answer: 
This worked for me, you need to call the methods on the DOM object not the jQuery object.

```
var player = $('video');
player[0].addEventListener('ended', function(e) {
                player[0].setCurrentTime(player[0].duration);
            }, false);

```
I think the best solution is to edit 'mediaelement-and-player.min.js' (if you are using that)... do a text search for c.media.setCurrentTime(0) and comment it out or delete it.