Skip to content

Instantly share code, notes, and snippets.

@kkotelczuk
Last active February 14, 2017 11:29
Show Gist options
  • Save kkotelczuk/08a97e0c4ae32cf71f7de0b47330ecf8 to your computer and use it in GitHub Desktop.
Save kkotelczuk/08a97e0c4ae32cf71f7de0b47330ecf8 to your computer and use it in GitHub Desktop.

#Add video to your website or application with Syncano and SYNQ#

Embedding video on your website or in an application is really easy when using Syncano and Synq. In this post, you will learn how to integrate Synq with Syncano and why you should do it.

Adding video to your website or app is really easy. There are a lot of providers of such solutions, but most of them have really problematic/tricky/rigid APIs or need a separate app to work. In this blog post, I will show you how to integrate the SYNQ video API with Syncano. First, let me answer few simple questions.

##What is Syncano?##

Syncano is a powerful backend provider. This serverless platform allows you to make great apps very fast in your favorite/preferred language. You don't need to know any frameworks or databases. You can easily start building your backend with scripts and data objects with real-time communication. In this case, we will work on real time video handling application.

##What is Synq?##

Synq is a flexible video API that allows you to easily implement video capabilities in an app or on a website. Upload any video directly or through the embedded uploader and the SYNQ video API takes care of transcoding to all necessary formats and qualities. After transcoding, you can access those videos from anyplace, and anytime, thanks to an efficient multi-CDN delivery system. The video can be embedded with a customizable player on any platform and screen size. All these features are available directly through the SYNQ video API.

##Why do I need to integrate Synq with Syncano?##

You can wonder why you should integrate Synq with Syncano? If you are already using Syncano in your application, there is no need to add any additional services. You just add an integration to the Syncano instance and it will take care of the process presented below: Imgur

As you can see, in your application you just have to upload a file to Syncano, as described in docs. Then Syncano communicates with the Synq video API with programmable Webhooks and returns link to your video when transcoding has completed. This will be notified by a status change in the Syncano Channel.

##How to start?##

First, you have to signup at Synq.fm and create a new project which will be your basic store for videos. As you can see there is an API Key, you will need it later. There is also something called programmable webhooks you also learn how to use them in next section.

If you don't have a Syncano account you can either create an account via website or syncano-cli. In this case, I will show you how to use Syncano in your console. First, you have to install Syncano CLI on your machine. Package manager like npm and node.js version 7 or later are required for this installation:

npm install -g syncano-cli

When it is done, you have to login into your Syncano account, if you don't have one it will be created automatically:

syncano-cli login

###Integrate Syncano with Synq###

After logging in you have to find a synq socket in the registry:

syncano-cli search synq

Then simply install it in your project:

syncano-cli socket install synq

After installation, you have to sync synq socket with your instance, but first please install all dependencies using your favorite package manager. When all packages are installed sync your socket:

syncano-cli sync

When it is done, you should see a massage:

Error validating socket config. "SYNQ_API_KEY" is required.

That means that you have to go to your admin panel at synq.fm and get project API Key. Now run again command to sync socket, but this time selects only this which need a key:

syncano-cli socket sync synq

After that your socket will be fully installed on your Syncano instance, so you can use endpoints in your application. If you want to see a list of endpoints just type:

syncano-cli socket list synq

When all is set in Syncano, go back to your Synq dashboard and select project which API Key was used. In section programmable webhooks please activate on_video_update and replace existing code with one you can find in socket Readme

The last thing you need to do is to add video uploading to your application. You can add it like any other file uploading. That’s all! The integration is ready to use in your application.

##Conclusion

As you can see, integrating Syncano with the SYNQ video API is really easy thanks to custom sockets. There is no need to write every single script, but only install a solution to your instance.

The socket is open source, so feel free to contribute. If you have any questions, feel free to contact us at hello@eyedea.io.

If you have any further questions about Syncano please join Syncano Slack community channel, or write to Syncano support team at support@syncano.io. For more documentation and feature descriptions on the SYNQ video API, check out their website synq.fm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment