I have the same problem as these people and tried all the solutions:
YouTube API loadVideoById startSeconds not working
Youtube IFrame Player API - Disable Youtube auto resume video where I left off
youtube api iframe loadvideobyid starts video where last one left off
Supposedly it was a Youtube bug that was fixed almost 3 years ago but it's still not working for me. I tried loading the video in multiple ways:
1-Normal function call:
player.loadVideoById(container.data('youtube_id'), 0, 'hd1080');
2-Object function call:
player.loadVideoById({
videoId: container.data('youtube_id'),
startSeconds: 0,
suggestedQuality: 'hd1080'
});
3-cueVideoById() then seekTo() (suggested on a blog):
player.cueVideoById(container.data('youtube_id'), 0, 'hd1080');
player.seekTo(0);
4-Stop the video, load the new one, seek to 0 (From another StackOverflow answer):
player.stopVideo();
player.loadVideoById(container.data('youtube_id'), 0, 'hd1080');
player.seekTo(0);
Whatever the approach, the startSeconds parameter from Youtube API is completely ignored and the video resumes from the last point.
However.. while in the browser, if I open the JavaScript console and type player.seekTo(0), then it's working. This is very frustrating, using Youtube's exact instructions and still being unable to do what it's supposed to.
NOTE:
I could use onPlayerStateChange() after loading the video, then seek to 0 manually after it's loaded, but it just seems stupid and annoying to have to do it myself when the YouTube API is supposed to do it. So I would really like to fix this issue the correct way.