tencent cloud

Feedback

TCPlayer Swift Live Streaming Downgrade Notice

Last updated: 2024-05-13 17:49:25

    Downgrade Scenarios

    Live Event Broadcasting (LEB) relies on WebRTC technology, requiring both the operating system and browser to support WebRTC.
    Currently, the SDK has been tested on the following operating systems and browsers, with the test results as follows.
    Operating System
    OS Version
    Browser
    Browser Version
    Support for Stream Pull
    Windows
    Windows 10
    Chrome
    86+
    Firefox
    88+
    Microsoft Edge
    86+
    macOS
    10.5+
    Safari
    13.1+
    Chrome
    86+
    Firefox
    88+
    Microsoft Edge
    86+
    iOS
    13.1.1+
    Safari
    13.7+
    Chrome
    86+
    Firefox
    33+
    Microsoft Edge
    89
    WeChat embedded
    -
    Android
    -
    Chrome
    86+
    Firefox
    88+
    WeChat embedded
    X5 kernel
    WeChat embedded
    XWeb kernel
    Additionally, in some browsers that support WebRTC, there may be decoding failures or server-side issues. In these cases, the player will convert the WebRTC URL to a more compatible HLS URL for playback. This behavior is known as downgrade processing.
    To summarize, there are several scenarios that trigger downgrading:
    The browser environment does not support WebRTC.
    Failed to connect to the server, and the number of retries has exceeded the preset value (internal status code -2004).
    Failed to decode during playback (internal status code -2005).
    Other WebRTC-related errors (internal status code -2001).

    Downgrade Methods

    1. Automatic Downgrade

    During player initialization, the LEB URL is received through the sources field. In environments requiring downgrade processing, the player automatically converts the LEB URL to the HLS URL.
    For example, the LEB URL
    webrtc://global-lebtest-play.myqcloud.com/live/lebtest?txSecret=f22a813b284137ed10d3259a7b5c224b&txTime=69f1eb8c
    will automatically convert to:
    https://global-lebtest-play.myqcloud.com/live/lebtest.m3u8?txSecret=f22a813b284137ed10d3259a7b5c224b&txTime=69f1eb8c

    2. Specified Downgrade

    In ABR playback scenarios, downgrade processing requires manually specifying an HLS URL. Direct format conversion is not supported. This method can also be used for scenarios where users require manual configuration of downgrade URLs, and it is compatible with protocols beyond HLS.
    var player = TCPlayer('player-container-id',{
    sources: 'webrtc://global-lebtest-play.myqcloud.com/live/lebtest?txSecret=f22a813b284137ed10d3259a7b5c224b&txTime=69f1eb8c&tabr_bitrates=d1080p,d540p,d360p&tabr_start_bitrate=d1080p',
    webrtcConfig: {
    fallbackUrl: 'https://global-lebtest-play.myqcloud.com/live/lebtest_HLSABR.m3u8',
    },
    });

    Downgrade Callback

    When a downgrade is triggered, the player will initiate a callback.
    player.on('webrtcfallback', function(event) {
    console.log(event);
    });
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support