Plyr: Load Video only when clicked

Created on 12 May 2017  路  2Comments  路  Source: sampotts/plyr

To prevent big pageload when several videos are embedded, i'm trying to figure out how to load the video when the user clicks on the video-thumbnail. By now plyr is setting up all videos when i click on one thumbnail.

Most helpful comment

@moesphemie have you tried to add preload attribute?

<video poster="pathToPoster" controls preload="none">
     <source src="pathToSource" type="video/mp4">
</video>

All 2 comments

@moesphemie have you tried to add preload attribute?

<video poster="pathToPoster" controls preload="none">
     <source src="pathToSource" type="video/mp4">
</video>

The current answer should be working for html5 video and audio. It also doesn't load the metadata (including duration) so you have to use the duration option or use preload="metadata" instead (not recommended since browsers load much more than the metadata with this option). For hls see #957. For other streaming libraries look at their API docs.

By now plyr is setting up all videos when i click on one thumbnail.

This shouldn't be the case with v3, but comment if it is and I'll reopen the issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

frumbert picture frumbert  路  3Comments

tomByrer picture tomByrer  路  3Comments

jwjcmw picture jwjcmw  路  4Comments

elliottcoe picture elliottcoe  路  4Comments

osamay picture osamay  路  4Comments