Let's explore the overall flow and each steps of using the Shakr Editor SDK.
There are two major parts when using the Editor SDK — creating video and checking its URL. The video creation step will involve the process of creating a new RenderSession by retrieving the server access token, and launching the Editor using the RenderSession ID.
Firstly, let's retrieve the server access token, as it is required when making API requests to Shakr's backend server. The authentication process of retrieving the server access token is based on the Client Credentials Grant flow, in compliance to the OAuth 2.0 standard.
Once server access token is ready, you can create a new RenderSession by applying the
edit_token option, which issues the scoped access token for Editor SDK usage. Provide mapping, template information, and
edit_token option to the endpoint, and make sure to save the returned RenderSession ID.
Transfer the RenderSession ID and
edit_token to your web application, then create and launch the editor instance.
Once previous steps are completed and the video is created with the editor, it's time to check the video's URL for downloading or playing in your web application.
There are three ways of checking the video URL. By using the wait_rendering option, you can implement all business logic within your web application without having to set up any server-side code. By using another method, Automated Video Delivery, your users don't need to keep their browser window open, and video URL is not exposed to the browser.
By using the wait_rendering option, you can check the video's rendering status as well as its URL without making any changes to your server. Provide the wait_rendering option while initializing the editor, and it will show a rendering status indicator as a progress bar. Video URL can be obtained through the finish event upon its completion.
Please refer to Quickstart for more information about using the wait_rendering option.
By using the external_uploads option while creating a new RenderSession, video can be automatically uploaded to your designated cloud storage destinations such as the AWS S3. You can use event handling services(such as AWS SNS) in conjunction to handle video completion, or use the Webhook feature to get notified to your HTTP endpoint.
One of the more basic methods of retrieving the video URL is by checking the
GET /v2/render_sessions API endpoint periodically. Here, you can retrieve the video URL when the
video_url key is populated. However, we recommend using the other above methods as this method increases the overall amount of API calls, which may result in slower response time and may be subject to rate limits.
Please refer to Reference for more information about using the API endpoint.