The essential links first
Building web-service based on part.io
Recently we have received more and more inquiries from companies that want to build their services based on part.io. Usually this is pretty simple, all things necessary are described in due depth in the part.io knowledge hub: The technical things for connecting to the API are covered here and the individual steps for creating your videos under the various Basic Elements. However, as the saying goes 'what you hear, you forget; what you see, you remember', we have set up our own little web page as an example.
This page follows along pretty much the steps described in our Best Practices on Basic Branding. It requires just a few inputs: The video that needs to be branded, a logo, and a selection of background music. Once you have uploaded all this, you just need to start the process and will receive the result in a few minutes: The branded video starts with fading in to the full screen logo, then switches right to the video. We add the logo to the top right corner of the video throughout its entire duration. The selected background music is played softly whenever there's audio in the origianl video; if there's no audio the background music gets a little louder. There are for sure a hundred ways to brand videos differently, but this should be sufficient for a simple example. However, as the saying goes on 'what you see, you remember; what you do, you understand', we have put a basic version of the page into a public Repl.
You can access the public Repl here. The structure is very simple. Everything in the
/public/ folder is the front-end. That mainly consist of some html and css. It also contains all the audio files, pictures used, etc. The two files in the root folder are the back-end. The file
partio.js contains everything necessary for the communication with the part.io API - mainly the calls that defines the processing steps within part.io. The file
index.js in the root folder is the web-server itself. This file more or less waits for input from the front-end, does some security checks and log output, and then uses the code from partio.js to call the API. As the code is documentation enough - I'd recommend to check it out yourselves, fork and reuse it.