logo
On this page
2022-02-11

Stream publishing issues

Products / Plugins:Video Call / Audio Call / Live streaming
Platform / Framework:iOS / Android / macOS / Windows / Web

EnableTrafficControl There is no "channel" parameter in the method, and it only takes effect for the mainstream by default. When two streams are pushed at the same time, the auxiliary stream cannot use flow control.

Call the startpublish method and set the sourceType parameter in publishOption to "CDN" to get the CDN push address, which can be used for push.

const {url} = await zg.startPublishingStream(data.pushStreamID,{sourceType:"CDN"})

It can be handled in the following two ways:

  • Need to set the autoplay property to the video object to automatically play.
  • You can set the controls property to the video object, and the user can manually click the playback control to play it.
Note

The autoplay attribute is invalid in the iOS Safari browser and needs to be handled in the second way.

The SDK internally pushes audio and video by default. If you want to push a pure audio stream, you need to set the attribute video of the camera object to "false" when calling the createStream method.

let localStream = await zg.createStream({
        camera: {
            video: false,//Do not push the video
            audio: true,
       }
  });
  • audioInput: audio input device, if it is not passed, it is the default device, optional.
  • videoInput: video input device, if not transmitted, it is the default device, optional. If the audioInput and videoInput parameters are not passed (the entire parameters do not need to be carried), the SDK will use the default device. If an empty string is passed, the device cannot be obtained, which can be written as audioInput: undefined and videoInput:undefined.

Please refer to the following methods:

  1. The browser does not have the permission to obtain the media device, please check whether the page is allowed to obtain the media device information.
  2. The media device is occupied. If the camera is occupied, please check whether other programs are using the camera device.
  • Based on the privacy requirements of the browser's security policy, the web terminal calls the camera to force "https". This security policy is a requirement of the browser and the SDK must comply with it.
  • You can use "localhost" for integration testing first, and the "https" environment is still required for subsequent launches.

Web screen sharing can choose the target window for sharing. Different platforms and different choices will have different performances:

Windows system:

  • Share the entire desktop and be able to push out the sound of the system.
  • Share browser tabs, only the sound of the tabs can be pushed out.
  • When sharing other application windows, the application sound cannot be pushed out.
  • Screen sharing cannot collect the sound of the microphone. The SDK needs to push the second stream to push the sound collected by the microphone.

Mac system: Unable to push out the sound of the system, only the video data can be pushed.

It is necessary. It is recommended to call this interface in pairs and reset it to "false" every time you stop streaming.

  1. Set in the configuration file: "pageOrientation": "auto".
  2. Cancel the lock screen of the mobile phone, and the applet will automatically switch when it is pushed to the horizontal screen.
  3. When the page is switched between horizontal and vertical screens, it will be re-layout, requiring the user to make layout adaptation.

External collection supports the push of pictures with transparent channels, but when using SDK rendering (including local preview and streaming viewing), the transparent part of the picture will be displayed in black. The reasons are as follows:

  • SDK currently does not support rendering transparent channels.
  • When streaming from CDN, other players do not support transparent channel.

Express SDK 1.19.0 and later versions support this function. The push end uses "setPublishStreamEncryptionKey" to set the push key, and the pull end needs to use "setPlayStreamDecryptionKey" to set the corresponding key to pull the stream successfully.

Note

This function is only supported on ZEGO Lianmai low-latency servers, not CDN.

Developers can add css styles to the "video" tags of preview and play stream, such as transform: scale(-1, 1);.

Previous

How can I listen for the event callbacks related to room users' login/logout in live streaming?

Next

Common integration issues