common

package module
v0.0.0-...-7371c5b Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2022 License: Apache-2.0 Imports: 24 Imported by: 0

README

Build

  • Update paths in build.sh
  • Run build.sh

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitLoggerFile

func InitLoggerFile(filesDir string, filename string)

func Initialize

func Initialize()

func InsecureHttpTransport

func InsecureHttpTransport()

func PreserveLogFile

func PreserveLogFile(filesDir string, filename string)

func SetStorage

func SetStorage(s PublicStorage)

Types

type BaseRoom

type BaseRoom struct {
	// contains filtered or unexported fields
}

func (*BaseRoom) Admins

func (r *BaseRoom) Admins() []byte

func (*BaseRoom) Hands

func (r *BaseRoom) Hands() []byte

func (*BaseRoom) IsThereOtherAdmin

func (r *BaseRoom) IsThereOtherAdmin() bool

type DatatrackDelegate

type DatatrackDelegate interface {
	OnMessage(json string)
	OnReaction(json []byte)
	OnPath(userId string, x float64, y float64, duration float64)
	OnNativeState(json []byte)
	OnRadarVolume(json []byte)
	OnConnectionState(json []byte)
	OnPopupUsers(json string)
	OnChangeRoomMode(mode string, isFirstConnection bool)
	OnParticipantsVisibilityChanged(json string)
	OnStateChanged(newState int)
}

type DeviceCurrentUser

type DeviceCurrentUser struct {
	IsAdmin           bool   `json:"isAdmin"`
	IsHandRaised      bool   `json:"isHandRaised"`
	Mode              string `json:"mode"`
	IsAbsoluteSpeaker bool   `json:"isAbsoluteSpeaker"`
}

type DeviceRoomUser

type DeviceRoomUser struct {
	Id                string   `json:"id"`
	Size              float64  `json:"size"`
	IsLocal           bool     `json:"isLocal"`
	HasRadar          bool     `json:"hasRadar"`
	Name              string   `json:"name"`
	Surname           string   `json:"surname"`
	Avatar            string   `json:"avatar"`
	Mode              string   `json:"mode"`
	IsAdmin           bool     `json:"isAdmin"`
	IsExpired         bool     `json:"isExpired"`
	InRadar           bool     `json:"inRadar"`
	Video             bool     `json:"video"`
	Audio             bool     `json:"audio"`
	PhoneCall         bool     `json:"phoneCall"`
	IsSpecialGuest    bool     `json:"isSpecialGuest"`
	IsAbsoluteSpeaker bool     `json:"isAbsoluteSpeaker"`
	Badges            []string `json:"badges"`
}

type DeviceState

type DeviceState struct {
	Current                *DeviceCurrentUser `json:"current"`
	Room                   []*DeviceRoomUser  `json:"room"`
	ListenersCount         int                `json:"listenersCount"`
	RaisedHandsCount       int                `json:"raisedHandsCount"`
	HandsAllowed           bool               `json:"handsAllowed"`
	AbsoluteSpeakerPresent bool               `json:"absoluteSpeakerPresent"`
}

type JvBusterDelegate

type JvBusterDelegate interface {
	Init(callbacks JvbusterCallbacks)
	InitializeRTCPeerConnection(userId string, id string, isMain bool, isSpeaker bool, sdpOffer string, callbacks JvbusterPeerConnectionCallbacks) string
	SetLocalRTCPeerConnectionDescription(id string, description string)
	SendMessageToDataChannel(id string, message string)
	ProcessMetaAdd(json string)
	ProcessMetaRemove(json string)
	OnError(error string)
	DestroyPeerConnections()
}

type JvbusterCallbacks

type JvbusterCallbacks interface {
	UpdateAudioLevel(level int)
	UpdateVideoAudioPhoneState(videoEnabled bool, audioEnabled bool, isOnPhoneCall bool)
}

type JvbusterPeerConnectionCallbacks

type JvbusterPeerConnectionCallbacks interface {
	ProcessDataChannelMessage(message string)
	ProcessState(state int)
}

type LiveRoom

type LiveRoom struct {
	BaseRoom
	// contains filtered or unexported fields
}

func ConnectToLiveRoom

func ConnectToLiveRoom(
	datatrackDelegate DatatrackDelegate, wsUrl, roomId, accessToken, roomPass string, roomWidthMul, roomHeightMul, adaptiveBubbleSize, screenPositionX, screenPositionY, screenPositionWidth, screenPositionHeight, devicePixelRatio float64,
	jvbusterDelegate JvBusterDelegate, jvbusterAddress, jvbusterToken string, fullResCircleDiameterInch, viewportWidthInch float64, videoBandwidth, audioBandwidth int,
) (*LiveRoom, error)

func (*LiveRoom) Disconnect

func (r *LiveRoom) Disconnect()

func (*LiveRoom) FullScreen

func (r *LiveRoom) FullScreen(val bool)

func (*LiveRoom) ProcessDataChannelMessage

func (r *LiveRoom) ProcessDataChannelMessage(peerConnectionId, message string)

func (*LiveRoom) ProcessPeerConnectionState

func (r *LiveRoom) ProcessPeerConnectionState(peerConnectionId string, state int)

func (*LiveRoom) RemoveReaction

func (r *LiveRoom) RemoveReaction(id string)

func (*LiveRoom) SendMessage

func (r *LiveRoom) SendMessage(message string)

func (*LiveRoom) SendUserPath

func (r *LiveRoom) SendUserPath(toX float64, toY float64)

func (*LiveRoom) SetJvbusterSubscriptionType

func (r *LiveRoom) SetJvbusterSubscriptionType(subscriptionType string)

func (*LiveRoom) SetViewport

func (r *LiveRoom) SetViewport(x1, y1, x2, y2 float64)

func (*LiveRoom) UpdateAudioLevel

func (r *LiveRoom) UpdateAudioLevel(level int)

func (*LiveRoom) UpdateVideoAudioPhoneState

func (r *LiveRoom) UpdateVideoAudioPhoneState(videoEnabled bool, audioEnabled bool, isOnPhoneCall bool)

type LiveRoomState

type LiveRoomState int32
const (
	LiveRoomStateConnecting LiveRoomState = iota
	LiveRoomStateConnected
	LiveRoomStateClosed
)

func (LiveRoomState) String

func (s LiveRoomState) String() string

type MediaDelegate

type MediaDelegate interface {
	OnPrepare(url, userId string)
	OnPlay(url, userId string)
}

type PeerConnectionState

type PeerConnectionState int32
const (
	PeerConnectionStateNew PeerConnectionState = iota
	PeerConnectionStateConnecting
	PeerConnectionStateConnected
	PeerConnectionStateDisconnected
	PeerConnectionStateFailed
	PeerConnectionStateClosed
)

func (PeerConnectionState) String

func (s PeerConnectionState) String() string

type Point

type Point struct {
	X, Y float64
}

type PublicHttpClient

type PublicHttpClient interface {
	request.HttpClient
}

func HttpClient

func HttpClient(
	endpoint string,
	platform string,
	version string,
	versionName string,
	buildNumber string,
) PublicHttpClient

type PublicLogger

type PublicLogger interface {
	logs.Logger
}

func NewLogger

func NewLogger(caller string) PublicLogger

type PublicStorage

type PublicStorage interface {
	storage.Storage
}

type RecordedRoom

type RecordedRoom struct {
	BaseRoom
	// contains filtered or unexported fields
}

func ReplayRecordedRoom

func ReplayRecordedRoom(
	roomHttpUrl string,
	datatrackDelegate DatatrackDelegate, roomWidthMul, roomHeightMul, adaptiveBubbleSize, devicePixelRatio float64,
	mediaDelegate MediaDelegate,
) (*RecordedRoom, error)

todo: add timeout

func (*RecordedRoom) Stop

func (r *RecordedRoom) Stop()

type RecordedRoomState

type RecordedRoomState int32
const (
	RecordedRoomStateStarted RecordedRoomState = iota
	RecordedRoomStatePaused
	RecordedRoomStateStopped
)

func (RecordedRoomState) String

func (s RecordedRoomState) String() string

type Rectangle

type Rectangle struct {
	P1, P2 Point
}

func (Rectangle) Center

func (r Rectangle) Center() Point

func (Rectangle) IsInside

func (r Rectangle) IsInside(point Point) bool

func (Rectangle) IsInsideWithBorder

func (r Rectangle) IsInsideWithBorder(point Point, border float64) bool

func (Rectangle) IsZero

func (r Rectangle) IsZero() bool

type UserPoint

type UserPoint struct {
	X, Y float64
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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