janus

package module
v0.0.0-...-a52dbbf Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Copyright 2018 Cibifang. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientBody

type ClientBody struct {
	Request    string `json:"request,omitempty"`
	Room       uint64 `json:"room,omitempty"`
	Ptype      string `json:"ptype,omitempty"`
	Feed       uint64 `json:"feed,omitempty"`
	PrivateId  uint64 `json:"private_id,omitempty"`
	Display    string `json:"display,omitempty"`
	Audio      bool   `json:"audio,omitempty"`
	Video      bool   `json:"video,omitempty"`
	Audiocodec string `json:"audiocodec,omitempty"`
	Videocodec string `json:"videocodec,omitempty"`
}

type ClientMsg

type ClientMsg struct {
	Janus       string     `json:"janus,omitempty"`
	Plugin      string     `json:"plugin,omitempty"`
	Transaction string     `json:"transaction,omitempty"`
	SessionId   uint64     `json:"session_id,omitempty"`
	HandleId    uint64     `json:"handle_id,omitempty"`
	Body        ClientBody `json:"body,omitempty"`
}

WebSocket message send to janus.

type Handle

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

func (*Handle) DefaultMsgChan

func (h *Handle) DefaultMsgChan() chan []byte

func (*Handle) MsgChan

func (h *Handle) MsgChan(tid string) (msgChan chan []byte, exist bool)

func (*Handle) NewTransaction

func (h *Handle) NewTransaction() string

type Janus

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

func NewJanus

func NewJanus(rs string) *Janus

func (*Janus) Close

func (j *Janus) Close()

func (*Janus) DefaultMsgChan

func (j *Janus) DefaultMsgChan() chan []byte

func (*Janus) Handle

func (j *Janus) Handle(sid uint64, hid uint64) (*Handle, bool)

func (*Janus) MsgChan

func (j *Janus) MsgChan(tid string) (msgChan chan []byte, exist bool)

func (*Janus) NewSess

func (j *Janus) NewSess(id uint64) *Session

func (*Janus) NewTransaction

func (j *Janus) NewTransaction() string

func (*Janus) Send

func (j *Janus) Send(msg interface{})

func (*Janus) Session

func (j *Janus) Session(id uint64) (sess *Session, exist bool)

type Jsep

type Jsep struct {
	Type string `json:"type,omitempty"`
	Sdp  string `json:"sdp,omitempty"`
}

type ServerData

type ServerData struct {
	Id int `json:"id,omitempty"`
}

type ServerMsg

type ServerMsg struct {
	Janus       string     `json:"janus,omitempty"`
	Transaction string     `json:"transaction,omitempty"`
	Data        ServerData `json:"data,omitempty"`
	SessionId   int        `json:"session_id,omitempty"`
	HandleId    int        `json:"handle_id,omitempty"`
	Plugindata  struct {
		Plugin string `json:"plugin,omitempty"`
		Data   struct {
			Videoroom   string `json:"videoroom,omitempty"`
			Room        int64  `json:"room,omitempty"`
			Permanent   bool   `json:"permanent,omitempty"`
			Description string `json:"description,omitempty"`
			Id          int64  `json:"id,omitempty"`
			PrivateId   int64  `json:"private_id,omitempty"`
			Publishers  []struct {
				Id         int64  `json:"id,omitempty"`
				Display    string `json:"display,omitempty"`
				AudioCodec string `json:"audio_codec,omitempty"`
				VideoCodec string `json:"video_codec,omitempty"`
			} `json:"publishers,omitempty"`
		} `json:"data,omitempty"`
	} `json:"plugindata,omitempty"`
	Jsep struct {
		Type string `json:"type,omitempty"`
		Sdp  string `json:"sdp,omitempty"`
	} `json:"jsep,omitempty"`
}

type ServerMsgChan

type ServerMsgChan interface {
	MsgChan(string) (chan []byte, bool)
}

type Session

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

func (*Session) Attach

func (s *Session) Attach(id uint64) *Handle

because now we just use one plugin, so don't create plugin.go

func (*Session) DefaultMsgChan

func (s *Session) DefaultMsgChan() chan []byte

func (*Session) MsgChan

func (s *Session) MsgChan(tid string) (msgChan chan []byte, exist bool)

func (*Session) NewTransaction

func (s *Session) NewTransaction() string

Directories

Path Synopsis
example

Jump to

Keyboard shortcuts

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