responsive-youtube-player-with-playlist icon indicating copy to clipboard operation
responsive-youtube-player-with-playlist copied to clipboard

Show image when autoplay is false

Open nikbrockman opened this issue 7 years ago • 2 comments

When autoplay: false, is there a way to show the preview image of the initial video rather than having a blank screen with the play button?

Actually, now that I'm looking at it more closely, when autoplay is set to false, a video is not even loaded into the iframe . So if you click play without clicking from the list, you get an error because the iframe doesn't know which video to play.

nikbrockman avatar Nov 09 '17 23:11 nikbrockman

Ping @carloscabo. Any development on this? 😃 Noticing the same issue, which you can actually see in your demo page as well (last example at the bottom of the page). Thanks!

stebogit avatar Feb 22 '18 02:02 stebogit

Well, it seems that just commenting out this if case should fix the issue:

// Select first if none
if (D.$items.find('li.selected').length === 0) {
    // if (this.options.autoplay) {
        D.$items.find('li').first().click();
    // }
}

😄

stebogit avatar Feb 22 '18 19:02 stebogit