直播:后台 JWT 推流、前台画中画;WebRTC 服务与 Nginx WebSocket 代理
Made-with: Cursor
This commit is contained in:
35
server/vendor/github.com/pion/webrtc/v3/api_js.go
generated
vendored
Normal file
35
server/vendor/github.com/pion/webrtc/v3/api_js.go
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
//go:build js && wasm
|
||||
// +build js,wasm
|
||||
|
||||
package webrtc
|
||||
|
||||
// API bundles the global funcions of the WebRTC and ORTC API.
|
||||
type API struct {
|
||||
settingEngine *SettingEngine
|
||||
}
|
||||
|
||||
// NewAPI Creates a new API object for keeping semi-global settings to WebRTC objects
|
||||
func NewAPI(options ...func(*API)) *API {
|
||||
a := &API{}
|
||||
|
||||
for _, o := range options {
|
||||
o(a)
|
||||
}
|
||||
|
||||
if a.settingEngine == nil {
|
||||
a.settingEngine = &SettingEngine{}
|
||||
}
|
||||
|
||||
return a
|
||||
}
|
||||
|
||||
// WithSettingEngine allows providing a SettingEngine to the API.
|
||||
// Settings should not be changed after passing the engine to an API.
|
||||
func WithSettingEngine(s SettingEngine) func(a *API) {
|
||||
return func(a *API) {
|
||||
a.settingEngine = &s
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user