Closed Captioning
Set up CC for VidyoPlatform WebRTC SDK
First of all, Closed Captioning has to be enabled in Portal Features -> flag CcEnabled. For the VidyoPlatform <<*.platform.vidyo.io>> it has been configured already.
The next step would be to discover the Closed Captioning Service URL that we will be talking to.
CC Service Discovery
You can trigger a GET request at https://getservices.platform.vidyo.io with the corresponding response:
Now we know that the service is Available and the URL is:
https://vidyoclosedcaptioning-vidyoplatform-gc6c3x2x3a-uc.a.run.app/cc/api/v1
CC Workflow
You have to /Start & /Stop the CC service in order to use it AND Subscribe /Unsubscribe from the CC topic to receive the CC callbacks.
Start Service
Call /startClosedCaptioning
Web Services API in order to start the CC Service. So, you have to obtain the JWT token first with the VidyoClient JS API since any WebServices REST API requires a JWT token:
Now we are good to start a service:
closedCaptionServiceUrl
- our service URL was discovered earlier.
In response, you’ll receive a subscriptionToken:
which we’re going to use to subscribe to the topic and receive CC updates:
Stop Service
In order to stop the service, you have to call /stopClosedCaptioning
WebServices API and Unsubscribe from the Topic. For this, you need the JWT token and subscriptionToken
you used to subscribe earlier.
this.closedCaptionServiceUrl
- cached service URL
this.jwtToken
- cached Token, however, it’s better to obtain since the old one might expire.
this.subscriptionToken
- cached subscription token.
At this point, your CC service has been stopped.
Last updated