AppName
value (live
by default). AppName
is used to differentiate the paths of applications under the same domain name.StreamName
value.Note:
AppName
is a custom value and can contain only letters, numbers, and special characters.- Here is another way to generate publishing addresses: In Domain Management, find the publishing domain name you want use to generate a publishing address, click Manage, select Push Configuration, enter an expiration time for the address and a custom
StreamName value
, and click Generate Push Address.
Go to Domain Management of the CSS console, find the publishing domain name you created, click Manage, and select Push Configuration. Scroll down and you will find Push Address Sample Code (for PHP and Java). The code demonstrates how to generate a hotlink protection address. For detailed directions, see Push Configuration.
If you run a large number of live streaming rooms, it is impossible to manually generate a publishing and playback URL for each host. In such cases, you can use the server to automatically splice the URLs. Any URL that meets Tencent Cloud standards can be used for publishing. A standard publishing URL consists of four parts, as shown below:
live
by defaulttxSecret
and txTime
: txSecret=Md5(key+StreamName+hex(time))&txTime=hex(time)
.Note:For example,
5867D600
means that the URL expires at 00:00:00, January 1, 2017. The validity period should neither be too short nor too long. Most of our clients settxTime
to a point 24 hours or longer from the current time. If the validity period is too short, if a host is disconnected during a live stream, he or she may be unable to resume publishing due to the expiration of the publishing URL.
txSecret
can prevent attackers from forging your backend to generate publishing URLs. For the calculation method, see Best Practice > Hotlink Protection URL Calculation.A playback URL consists of a playback protocol prefix, domain name (domain
), application name (AppName
), stream name (StreamName
), playback protocol suffix, authentication key, and other custom parameters. Below are a few examples.
webrtc://domain/AppName/StreamName?txSecret=Md5(key+StreamName+hex(time))&txTime=hex(time)
http://domain/AppName/StreamName.flv?txSecret=Md5(key+StreamName+hex(time))&txTime=hex(time)
rtmp://domain/AppName/StreamName?txSecret=Md5(key+StreamName+hex(time))&txTime=hex(time)
http://domain/AppName/StreamName.m3u8?txSecret=Md5(key+StreamName+hex(time))&txTime=hex(time)
Playback Protocol | Playback Prefix | Notes |
---|---|---|
WebRTC | webrtc:// |
Strongly recommended; best instant streaming performance; ultra-high concurrency |
HTTP-FLV | http:// or https:// |
Recommended, excellent instant streaming performance; high concurrency |
RTMP | rtmp:// |
Not recommend; poor instant streaming performance; unable to handle high concurrency |
HLS (M3U8) | http:// or https:// |
We recommend HLS for mobile clients and for the Safari browser on macOS. |
live
by default) that identifies the storage path of a live streaming media filetxSecret
and txTime
: txSecret=Md5(key+StreamName+hex(time))&txTime=hex(time)
.You need to splice publishing and playback URLs for RTC-based mic connect and host competition.
Publishing URL
You need to splice a publishing URL by yourself in your project code. The format is as shown below.
trtc://cloud.tencent.com/push/streamid?sdkappid=1400188888&userId=A&usersig=xxxxx
The table below lists the key fields in a publishing URL and their meanings.
Field | Description |
---|---|
trtc:// | Prefix of a publishing URL for interactive live streaming |
cloud.tencent.com | Dedicated domain name for interactive live streaming, which you must not modify |
push | Identifier, which indicates publishing |
streamid | Stream ID, which is a custom value specified by yourself |
sdkappid | The `SDKAppID` generated in “Activate TRTC” |
userId | User ID of the host, which is a custom value specified by yourself |
usersig | User signature calculated from the key obtained in “Activate TRTC” |
Playback URL
You need to splice a playback URL by yourself in your project code. The format is as shown below.
trtc://cloud.tencent.com/play/streamid?sdkappid=1400188888&userId=A&usersig=xxxxx
The table below lists the key fields in a playback URL and their meanings.
Field | Description |
---|---|
trtc:// | Prefix of a playback URL for interactive live streaming |
cloud.tencent.com | Dedicated domain name for interactive live streaming, which you must not modify |
play | Identifier, which indicates playback |
streamid | Stream ID, which is a custom value specified by yourself |
sdkappid | The `SDKAppID` generated in “Activate TRTC” |
userId | User ID of the host, which is a custom value specified by yourself |
usersig | User signature calculated from the key obtained in “Activate TRTC” |
Was this page helpful?