the-muda-organization / vimeo-lazyload

LazyLoad Embed Vimeo Player - simple and lightweight plugin - pure JavaScript
MIT License
27 stars 10 forks source link

[Feature request] specify an external URL #4

Closed badpenguin closed 3 years ago

badpenguin commented 3 years ago

Instead of hacking settings_thumb_base_url in the code and having to create a custom file on the server specific for this task simply add a data-img-url="" to specifiy any full URL

jakubmuda commented 3 years ago

It is a simple script and you can customize it however you want.

It is easier the way it is now, but if you want to provide full url to each video just remove settings_thumb_base_url, settings_thumb_extension etc, and edit line 93.

BEFORE: this_content.style.setProperty('--vi-lazyload-img','url("' + settings_thumb_base_url + this_data_id + this_data_thumb + '.' + settings_thumb_extension + '")');

AFTER: this_content.style.setProperty('--vi-lazyload-img','url("' + this_data_thumb + '")');

HTML should look like this: <div class="vi-lazyload" data-id="272532681" data-thumb="https://example.com/path/to/image/asfgterggsdf.webp" data-logo="3"></div>

badpenguin commented 3 years ago

Yes thanks. I've already modified it for my custom needs :)