During actual service use, if there are many live rooms, you will not be able to manually create push and playback URLs for each host. In this case, you can splice such addresses on the server. Any URL that meets Tencent Cloud standards can be used for push. A standard push URL consists of four parts, as shown below:
Push domain name, which can be the default push domain name provided by Tencent Cloud LVB or your own push domain name with a successfully configured CNAME record.
LVB application name, which is
live by default and customizable.
StreamName (stream ID)
Custom stream name and unique ID of a live stream. We recommend you use a random numerical or alphanumerical string.
Authentication key (optional)
It consists of
If push authentication is enabled, the URL used for push should contain the authentication key. If push authentication has not been enabled, the URL used for push does not need to contain "?" and the content following it.
txTime (address expiration time)
It indicates the time when the URL expires, which is expressed as a hexadecimal Unix timestamp.
5867D600indicates that the URL will expire at 00:00:00, January 1, 2017. Generally,
txTimeis set to 24 hours later. The expiration time should be neither too early nor too late. If it is too early, when the host encounters network jitters during live streaming, the push will not be resumed because the push URL will have expired.
txSecret (hotlink protection signature)
It is used to prevent attackers from forging your backend to generate push URLs. For more information on the calculation method, please see Best Practices - Hotlink Protection URL Calculation.
A playback address is mainly composed of the playback prefix, playback domain name (
domain), application name (
AppName), stream name (
StreamName), playback protocol suffix, authentication parameter, and other custom parameters, as shown below:
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|
||We do not recommend RTMP as it has poor instant streaming performance and does not support high concurrence.|
||We recommend HTTP-FLV as it has good instant streaming performance and supports high concurrence.|
||We recommend HLS for mobile users and for the Safari browser on macOS.|
liveby default and customizable.
Go to the LVB Console > Domain Management, select a pre-configured push domain name, and click Manage > Push Configuration to display the Push Address Sample Code (for both PHP and Java) that demonstrates how to generate a hotlink protection address. For detailed directions, please see Push Configuration.