暂停,需要解决一些问题
This commit is contained in:
parent
dc9b5ce0b1
commit
c22c399f40
@ -61,7 +61,7 @@ func New(o *Options) (*Connection, error) {
|
||||
}
|
||||
|
||||
func (c *Connection) Regist(offer *webrtc.SessionDescription) (*webrtc.SessionDescription, error) {
|
||||
logrus.Debug("received offer ", offer)
|
||||
logrus.Debug("received offer ")
|
||||
|
||||
rtc, err := c.api.NewPeerConnection(webrtc.Configuration{
|
||||
ICEServers: []webrtc.ICEServer{
|
||||
@ -78,6 +78,10 @@ func (c *Connection) Regist(offer *webrtc.SessionDescription) (*webrtc.SessionDe
|
||||
logrus.Debug("connection state has changed: ", connectionState.String())
|
||||
})
|
||||
|
||||
rtc.OnICECandidate(func(i *webrtc.ICECandidate) {
|
||||
logrus.Debug("cadidate: ", i)
|
||||
})
|
||||
|
||||
for _, track := range c.stream.GetTracks() {
|
||||
track.OnEnded(func(err error) {
|
||||
logrus.Errorf("Track (ID: %s, kind: %s) ended with error: %v", track.ID(), track.Kind().String(), err)
|
||||
|
@ -130,6 +130,7 @@ func (s *Server) Run() error {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
logrus.Debug("start reading PCM")
|
||||
defer close(s.pcm)
|
||||
for {
|
||||
b := make([]byte, 2048) // to be configured
|
||||
|
@ -101,7 +101,7 @@ onMounted(() => {
|
||||
el.oncontextmenu = () => false;
|
||||
document.getElementById("data").appendChild(el);
|
||||
|
||||
if (el.track.kind === "video") {
|
||||
if (ev.track.kind === "video") {
|
||||
const ctx = video.getContext("2d");
|
||||
setTimeout(() => {
|
||||
ctx.drawImage(this.video, 0, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user