ayame

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package ayame は Ayame クライアントライブラリです。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLogger

func SetLogger(l *log.Logger)

SetLogger は ayame パッケージ内で出力される *log.Logger を任意のものに設定します。

Types

type Connection

type Connection struct {
	// シグナリングに利用する URL
	SignalingURL string

	// Ayame のルームID
	RoomID string

	// Ayame の接続オプション
	Options *ConnectionOptions

	// デバッグログの出力の可否
	Debug bool

	// 送信する認証用のメタデータ
	AuthnMetadata *interface{}
	// contains filtered or unexported fields
}

Connection は PeerConnection 接続を管理します。

func NewConnection

func NewConnection(signalingURL string, roomID string, options *ConnectionOptions, debug bool, isRelay bool) *Connection

NewConnection は Ayame Connection を生成して返します。

func (*Connection) Connect

func (c *Connection) Connect() error

Connect は PeerConnection 接続を開始します。

func (*Connection) CreateDataChannel

func (c *Connection) CreateDataChannel(label string, options *webrtc.DataChannelInit) (*webrtc.DataChannel, error)

CreateDataChannel は指定した label と options から新しい DataChannel 作成して、追加します。

func (*Connection) Disconnect

func (c *Connection) Disconnect()

Disconnect は PeerConnection 接続を切断します。

func (*Connection) OnBye

func (c *Connection) OnBye(f func())

OnBye は bye イベント発生時のコールバック関数を設定します。

func (*Connection) OnConnect

func (c *Connection) OnConnect(f func())

OnConnect は connect イベント発生時のコールバック関数を設定します。

func (*Connection) OnDataChannel

func (c *Connection) OnDataChannel(f func(dc *webrtc.DataChannel))

OnDataChannel は datachannel イベント発生時のコールバック関数を設定します。

func (*Connection) OnDisconnect

func (c *Connection) OnDisconnect(f func(reason string, err error))

OnDisconnect は disconnect イベント発生時のコールバック関数を設定します。

func (*Connection) OnOpen

func (c *Connection) OnOpen(f func(metadata *interface{}))

OnOpen は open イベント発生時のコールバック関数を設定します。

func (*Connection) OnTrackPacket

func (c *Connection) OnTrackPacket(f func(track *webrtc.TrackRemote, packet *rtp.Packet))

OnTrackPacket は RTP Packet 受診時に発生するコールバック関数を設定します。

type ConnectionAudioOption

type ConnectionAudioOption struct {
	// 送受信方向。現在、'recvonly' のみサポート
	Direction webrtc.RTPTransceiverDirection

	// 有効かどうかのフラグ
	Enabled bool

	// 対応しているコーデックの設定
	Codecs []*webrtc.RTPCodecParameters
}

ConnectionAudioOption は Audio に関数するオプションです。

type ConnectionOptions

type ConnectionOptions struct {
	// Audio の設定
	Audio ConnectionAudioOption

	// Video の設定
	Video ConnectionVideoOption

	// クライアントID
	ClientID string

	// Ayame から ICEServer 情報が返って来なかった場合に使われる ICEServer の情報
	ICEServers []webrtc.ICEServer

	// 認証が必要なルームへの接続時に必要なシグナリングキー
	SignalingKey string

	// TrickleICE を利用するかどうかのフラグ
	UseTrickeICE bool
}

ConnectionOptions は Ayame 接続オプションです。

func DefaultOptions

func DefaultOptions() *ConnectionOptions

DefaultOptions は Ayame 接続オプションのデフォルト値を生成して返します。

type ConnectionVideoOption

type ConnectionVideoOption struct {
	// 送受信方向。現在、'recvonly' のみサポート
	Direction webrtc.RTPTransceiverDirection

	// 有効かどうかのフラグ
	Enabled bool

	// 対応しているコーデックの設定
	Codecs []*webrtc.RTPCodecParameters
}

ConnectionVideoOption は Video に関するオプションです。

Jump to

Keyboard shortcuts

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