The content of this page has been automatically translated by AI. If you encounter any problems while reading, you can view the corresponding content in Chinese.
Document Transcoding Access Process (Active Polling Method)
Active Polling Method, due to the limitation of polling interval duration (recommended interval 2s for polling transcoding progress), it is not possible to get the transcoding result in a timely manner, so it is more recommended to use Registration Callback Method.
Preparations
Bucket Configuration (CFS resources after document transcoding rely on COS, before using the document transcoding feature, please first perform Bucket Configuration)
Note:
Due to the time-consuming nature and queuing time of document transcoding, it is recommended to use the server-side API for pre-transcoding, and directly use the transcoding result on the client. It is not recommended to directly call the transcoding interface applyFileTranscode of the Interactive Whiteboard SDK on the client to avoid long waiting times, affecting the product experience.
Interaction Process (Active Polling Method):
Access Steps
1. Upload Document (using Tencent Cloud COS as an example)
To enable the Tencent Cloud transcoding server to obtain your courseware for transcoding, you need to provide a URL that the transcoding server can use to download the courseware.
Note:
1. It is recommended to use Tencent Cloud's COS service to provide the download address. Of course, you can also upload to other storage servers or upload in other ways.
2. Here, using Tencent Cloud COS in the Go language as an example. For more language implementations, please refer to Tencent Cloud COS.
Sample code:
package main
import (
"context"
"fmt"
"log"
"net/http"
"net/url"
"github.com/tencentyun/cos-go-sdk-v5"
"os"
)
func main(){
// Initialize COS resources TODO: Replace `examplebucket-1250000000` and `COS_REGION` with the actual information
// The object key is the unique identifier of the object in the bucket.
// For example, in the access domain name `examplebucket-1250000000.cos.COS_REGION.myqcloud.com/test/objectPut.go`, the object key is `test/objectPut.go`
Due to the dynamic transcoding time and queuing delays, it is recommended to use the server-side API for transcoding in advance. The client can directly use the transcoding results. It is not recommended to call the transcoding interface directly on the client side addTranscodeFile to avoid long waits and affecting user experience.
// SdkAppId is the user's own interactive whiteboard application ID. TaskId is the task ID returned by the transcoding server when the transcoding task is initiated