vodkabears / Vide

No longer actively maintained.
http://vodkabears.github.io/vide/
MIT License
3.29k stars 524 forks source link

automatically define poster type if posterpath contains extension #78

Open sergeykaul opened 9 years ago

sergeykaul commented 9 years ago

Hi Ilya, A possible draft is inserted below. Thank you.

// Get a poster path
poster = vide.path;
if (typeof vide.path === 'object') {
  if (vide.path.poster) {
    poster = vide.path.poster;

//------------////////////////////////////////////////////////////////// var extpos = poster.lastIndexOf('.'); if (extpos > 0){ var ext = poster.substring(extpos+1); if ((ext === 'jpeg')||(ext === 'jpg')||(ext === 'png')||(ext === 'gif')){ vide.settings.posterType = ext; } } //------------///////////////////////////////////////////////////////// } else { if (vide.path.mp4) { poster = vide.path.mp4; } else if (vide.path.webm) { poster = vide.path.webm; } else if (vide.path.ogv) { poster = vide.path.ogv; } } }

vodkabears commented 9 years ago

What is about a pull request? https://github.com/VodkaBears/Vide/blob/master/CONTRIBUTING.md