Browse Source

vedio.js播放bug

pull/112/head
张宏波 5 years ago
parent
commit
41ee68cfc0
  1. 8
      protocol/rtmp/core/conn_server.go

8
protocol/rtmp/core/conn_server.go

@ -3,10 +3,10 @@ package core
import ( import (
"bytes" "bytes"
"fmt" "fmt"
"io"
"github.com/gwuhaolin/livego/av" "github.com/gwuhaolin/livego/av"
"github.com/gwuhaolin/livego/protocol/amf" "github.com/gwuhaolin/livego/protocol/amf"
"io"
"strings"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
) )
@ -119,13 +119,13 @@ func (connServer *ConnServer) connect(vs []interface{}) error {
case amf.Object: case amf.Object:
obimap := v.(amf.Object) obimap := v.(amf.Object)
if app, ok := obimap["app"]; ok { if app, ok := obimap["app"]; ok {
connServer.ConnInfo.App = app.(string) connServer.ConnInfo.App = strings.Replace(app.(string), "/", "", 1)
} }
if flashVer, ok := obimap["flashVer"]; ok { if flashVer, ok := obimap["flashVer"]; ok {
connServer.ConnInfo.Flashver = flashVer.(string) connServer.ConnInfo.Flashver = flashVer.(string)
} }
if tcurl, ok := obimap["tcUrl"]; ok { if tcurl, ok := obimap["tcUrl"]; ok {
connServer.ConnInfo.TcUrl = tcurl.(string) connServer.ConnInfo.TcUrl = strings.Replace(tcurl.(string), connServer.ConnInfo.App+"/", connServer.ConnInfo.App, 1)
} }
if encoding, ok := obimap["objectEncoding"]; ok { if encoding, ok := obimap["objectEncoding"]; ok {
connServer.ConnInfo.ObjectEncoding = int(encoding.(float64)) connServer.ConnInfo.ObjectEncoding = int(encoding.(float64))

Loading…
Cancel
Save