AdamMoses-GitHub / MMM-ImageSlideshow

Displays images one-at-a-time from local folders.
MIT License
43 stars 24 forks source link

Support for *.webm #32

Open p145085 opened 1 year ago

p145085 commented 1 year ago

I'm a noob when it comes to these things but I managed to ugly-edit the code such that it plays .webm files.

var image = document.createElement("img"); -> var image = document.createElement("video"); ... image.autoplay = true; image.loop = true;

Also configure "slideshowSpeed" to be "60000" to allow the full length of the webm to play out before looping. Maximum length of a webm is therefore 1 minute. Include 'webm' in the "validImageFileExtensions" configuration option.

These minor adjustments allow .webm files to be played.

What I would like to do despite my lack of interpreting the source code is to check each image filepath for their file extension and if it is a .webm file I would branch off and do a video tag instead of a img one. I would also set 'slideshowSpeed' to be equal to the video length.

Anyway, one of my first edits to a source code project (like ever). Here's a pat on the back for me.

p145085 commented 1 year ago

It doesn't seem to be functioning with more than 2 .webm files though.