Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to obtain the abnormal state of WeChat Mini Programs live broadcast

2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to obtain the abnormal state of WeChat Mini Programs live broadcast". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Next, let's let the editor take you to learn how to get the abnormal state of WeChat Mini Programs live broadcast.

API description: get the first time to return to the LVB status immediately, and then poll to obtain the LVB status at intervals of 1 minute or less.

LVB status description:

101 LVB: indicates that the VJ starts broadcasting normally and the live broadcast is normal.

102 not started: indicates that the VJ has not started broadcasting yet.

103 terminated: indicates that the live broadcast is normally closed by clicking the "end" button on the live broadcast side, or the live broadcast is forced to end by the system 15 minutes after the live broadcast is abnormal.

104 banned: it indicates that it has been banned because of operational penalties for violations.

Pausing: LVB has been suspended in the MP Mini Program backend-console.

106 exception: indicates that the VJ leaves, cuts off the background, disconnects the network, etc. The LVB is determined to be abnormal and can be resumed within 15 minutes. If it is not restored after 15 minutes, the LVB room will be forced by the system to end the LVB.

107 expired: if the live broadcast room has not been started all the time, and the end time of the live broadcast plan entered when the studio was created at the backend of MP Mini Program has been reached, the live broadcast is determined to expire and cannot be started again.

Calling method: to call the [get LVB status] API getLiveStatus, you need to reference [LVB component] live-player-plugin at the top of the Mini Program page.

The sample code is as follows:

Let livePlayer = requirePlugin ('live-player-plugin')

/ / get the first time and return to LVB immediately

Const roomId = xxx / / Room id

LivePlayer.getLiveStatus ({room_id: roomId})

.then (res = > {

/ / 101: in live broadcasting, 102: not started, 103: finished, 104: banned, 105: paused, 106: exception, 107: expired

Const liveStatus = res.liveStatus

Console.log ('get live status', liveStatus)

})

.catch (err = > {

Console.log ('get live status', err)

})

/ / an interval of 1 minute or less is used to poll for LVB status.

SetInterval () = > {

LivePlayer.getLiveStatus ({room_id: roomId})

.then (res = > {

/ / 101: in live broadcasting, 102: not started, 103: finished, 104: banned, 105: paused, 106: exception, 107: expired

Const liveStatus = res.liveStatus

Console.log ('get live status', liveStatus)

})

.catch (err = > {

Console.log ('get live status', err)

})

}, 60000)

At this point, I believe you have a deeper understanding of "how to obtain the abnormal state of WeChat Mini Programs live broadcast". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report