wbstream

package
v0.0.0-...-32d77e8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APIBase = "https://stream.wb.ru"
	Origin  = "https://stream.wb.ru"
)
View Source
const (
	TunnelModeVideo = "video"
	TunnelModeDC    = "dc"
)

Variables

View Source
var ModeratorPermissions = []string{
	"ROOM_PERMISSION_SEND_CHAT",
	"ROOM_PERMISSION_SHARE_AUDIO",
	"ROOM_PERMISSION_SHARE_SCREEN",
	"ROOM_PERMISSION_SHARE_VIDEO",
	"ROOM_PERMISSION_MODIFY_PERMISSIONS",
	"ROOM_PERMISSION_MODERATE_ROOM",
	"ROOM_PERMISSION_CALL_DATA_ACCESS",
	"ROOM_PERMISSION_LOCAL_RECORD",
}
View Source
var WBStreamCookieAllowlist = []string{
	"wbx-refresh",
	"x_wbaas_token",
	"_wbauid",
	"wbx-validation-key",
}

Functions

func AuthAndGetToken

func AuthAndGetToken(client *http.Client, roomID, displayName string) (string, string, string, string, error)

func AuthAsLoggedIn

func AuthAsLoggedIn(client *http.Client, cookieHeader, accessToken, roomID, displayName string) (string, string, string, string, error)

func CreateRoom

func CreateRoom(client *http.Client, accessToken string) (string, error)

func GetConnectionDetails

func GetConnectionDetails(client *http.Client, accessToken, roomID, displayName string) (string, string, error)

func JoinRoom

func JoinRoom(client *http.Client, accessToken, roomID string) error

func KickParticipant

func KickParticipant(client *http.Client, accessToken, roomID, participantID string) error

func ParseRoomID

func ParseRoomID(input string) string

ParseRoomID accepts a bare room id, a wbstream://<id> link, or a https://stream.wb.ru/room/<id> URL and returns the room id.

func RefreshAccessToken

func RefreshAccessToken(client *http.Client, cookieHeader, deviceID string) (string, error)

func RegisterGuest

func RegisterGuest(client *http.Client, displayName string) (string, error)

func SetParticipantPermissions

func SetParticipantPermissions(client *http.Client, accessToken, roomID, participantID string, permissions []string) error

Types

type Session

type Session struct {
	OnConnected   func(tunnel.DataTunnel)
	OnPeerRestart func()
	// OnRemoteCandidate is forwarded from the underlying LiveKit client.
	// It fires for every trickle ICE candidate sent by the SFU, plus
	// once with target=-1 for every SDP description (carrying inline
	// candidates) before the description is applied to Pion.
	OnRemoteCandidate func(target int, candidateOrSDP string)
	// contains filtered or unexported fields
}

func NewSession

func NewSession(cfg SessionConfig) *Session

func (*Session) AdaptTrackCount

func (s *Session) AdaptTrackCount(peerCount int)

func (*Session) Close

func (s *Session) Close()

func (*Session) Done

func (s *Session) Done() <-chan struct{}

func (*Session) MarkConfigAcked

func (s *Session) MarkConfigAcked()

func (*Session) Start

func (s *Session) Start() error

type SessionConfig

type SessionConfig struct {
	RoomToken      string
	ServerURL      string
	DisplayName    string
	TunnelMode     string
	Obfuscator     *tunnel.TunnelObfuscator
	LogFn          func(string, ...any)
	SettingEngine  *webrtc.SettingEngine
	NetDialContext func(ctx context.Context, network, addr string) (net.Conn, error)
	ResolveICEHost func(host string) (string, error)
	VP8FPS         int
	VP8Batch       int
	RoomID         string
	AccessToken    string
	ReadBuf        int
	ScreenShare    bool // when true, publish a second VP8 track as ScreenShare and shard outbound across both
	IsJoiner       bool // when true, run the configPingPong loop; only the joiner sends VP8 config to the peer
	Reliable       bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL