Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

missionmike/video-placeholder-generator-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PRs Welcome

Video-Placeholder-Generator-Server

Server-side utility to generate a video placeholder image, especially useful for embedding in HTML email.

Accepts various GET parameters, and generates a static image with the imagemagick PHP extension.

Note: It is recommended to set up your own copy of this server-side installation to host your own thumbnails. Perpetual hosting on the default api.missionmike.dev domain is NOT guaranteed!

Customizable options include:

  • Thumbnail Width (width)
  • Play Button Image (from URL; play_button_url)
  • Play Button Width (play_button_width)
  • Play Button Opacity (play_button_opacity)

Sample URL Usage:

https://tools.missionmike.dev/video-placeholder-generator/thumbnails/H79gstz4qZI.jpg?pburl=https%3A%2F%2Ftools.missionmike.dev%2Fvideo-placeholder-generator%2Fassets%2Fyoutube_play.png&w=600&pbw=80&pbo=80&save=false

GET breakdown (URL Decoded):

Here's what happens under the hood:

  1. An attempt is made to fetch H79gstz4qZI.jpg
  2. If H79gstz4qZI.jpg does not exist on the server, .htaccess will then route the request to ../generator.php
  3. generator.php then parses the GET parameters, and uses imagemagick (PHP extension) to generate a graphic image.
  4. If &save=false is not set (or if &save=true), then H79gstz4qZI.jpg gets saved/written to the ./thumbnails/ directory -- if saved, subsequent calls do not consume any additional resources aside from serving the .jpg image!

Try out the front-end utility here: https://www.missionmike.dev/video-placeholder-generator/

Check out the front-end utilitiy repo here: https://github.com/missionmike/video-placeholder-generator-client

About

Server-side processing for Video Placeholder Generator Client

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages