Documentation
¶
Overview ¶
Package protocol is the Go owner of the Piik wire contract. Its shared fixtures and scalar helpers are kept semantics-compatible with the Browser implementation. The package performs no I/O and imports nothing from other internal packages.
Index ¶
- Constants
- Variables
- func AssertEndpointMediaCopyCapacity(capacity int) error
- func EncodeServerMessage(message ServerMessage) ([]byte, error)
- func EndpointMediaCopyCountFits(count, capacity int, phase EndpointMediaCopyPhase) bool
- func EndpointMediaCopyLimit(capacity int, phase EndpointMediaCopyPhase) int
- func IsCanonicalVideoCodecEvidence(codec, codecProfile, codecParameters string) bool
- func IsEndpointMediaCopyCapacity(capacity int) bool
- func IsJSWhitespace(character rune) bool
- func NormalizeDisplayName(value string) (string, bool)
- func PacketLossPercentFromDeltas(packetsReceivedDelta, packetsLostDelta *float64) (float64, bool)
- func UTF16Length(value string) int
- func ValidDisplayName(value string) bool
- func ValidOpaqueID(value string) bool
- func ValidRoomCode(value string) bool
- func ValidStunURL(value string) bool
- func ValidStunURLValue(value string) bool
- func ValidToken(value string) bool
- func ValidViewerGrant(value string) bool
- func ValidViewerPassword(value string) bool
- type AbandonRoomMessage
- type AuthenticateHostMessage
- type AuthenticateViewerMessage
- type AuthenticatedHostMessage
- type AuthenticatedViewerMessage
- type CandidateSignalOrigin
- type ClientMessage
- type ClientRestartRequestMessage
- type ClientSignalMessage
- type CodeEntryPolicy
- type CodeEntryPolicyUpdatedResponse
- type ConnectionAttempt
- type CreateRoomRequest
- type CreateRoomResponse
- type DisplayName
- type EndpointMediaCopyPhase
- type ErrorMessage
- type HostStatusMessage
- type IceCandidate
- type IceConfig
- type IceServer
- type IceServerURLs
- type Int
- type InteractionPayload
- type InteractionSender
- type MediaRouteUpstream
- type Nullable
- type Num
- type ParticipantPresenceEntry
- type ParticipantRouteAssignment
- type PauseSharingSourceMessage
- type PreparedRouteCandidate
- type QualitySettings
- type QualitySettingsMessage
- type RefreshSfuMessage
- type RelayCapacityMessage
- type ReplaceRoomRequest
- type RequestRouteDiagnosticMessage
- type ResetSenderQualityMessage
- type RevokeViewerGrantRequest
- type Role
- type RoomAccessUpdateRequest
- type RoomAccessUpdateResponse
- type RoomClosedMessage
- type RoomInteractionMessage
- type RoomInteractionRejectedMessage
- type RoomInteractionsReadyMessage
- type RotateViewerGrantRequest
- type RouteDiagnosticChild
- type RouteDiagnosticOperation
- type RouteDiagnosticParent
- type RouteDiagnosticQuality
- type RouteDiagnosticSnapshot
- type RouteDiagnosticSnapshotMessage
- type RouteFailedMessage
- type RouteMediaUnavailableMessage
- type RoutePolicy
- type RoutePolicyMessage
- type RouteReadyMessage
- type RouteStatusMessage
- type RouteTransportConnectedMessage
- type RouteUpdateActiveMessage
- type RouteUpdatePrepareMessage
- type RuntimeCapabilities
- type SendRoomInteractionMessage
- type SenderQualityDiagnostics
- type SenderQualityEvidenceMessage
- type ServerMessage
- type ServerRestartRequestMessage
- type ServerSignalMessage
- type ServerViewerQualityEvidenceMessage
- type SessionDescription
- type SetCodeEntryPolicyRequest
- type SetDisplayNameMessage
- type SetQualitySettingsMessage
- type SetSharingPausedMessage
- type SetViewerPasswordRequest
- type SfuConfigMessage
- type SfuLayer
- type SfuMedia
- type SfuPublisherQualityEvidenceMessage
- type SfuSignalMessage
- type SharingStartFailedMessage
- type SharingStartedMessage
- type SharingStoppedMessage
- type SignalCloseCode
- type SignalPayload
- type SignalingChallengeMessage
- type SignalingChallengeResponseMessage
- type StartSharingMessage
- type StopSharingMessage
- type SubscribeRoomInteractionsMessage
- type ViewerGrantRevokedMessage
- type ViewerGrantUpdatedResponse
- type ViewerPasswordUpdatedResponse
- type ViewerPresenceMessage
- type ViewerQualityEvidenceGuard
- type ViewerQualityEvidenceMessage
- type ViewerQualityEvidenceMetrics
Constants ¶
const ( MaxViewersPerRoomLimit = 20 MaxParticipantsPerRoomLimit = MaxViewersPerRoomLimit + 1 MaxSignalBytes = 64 * 1024 SignalingProtocol = "piik-v23" RoomCodeLength = 4 MaxMediaRouteRevision = MaxSafeInteger MaxIceServerURLs = 8 MaxNatPredictionAuxiliaryStunURLs = 2 MaxViewerQualityEvidenceBytes = 2 * 1024 ViewerQualityEvidenceIntervalMs = 2_000 ViewerQualityEvidenceExpiryMs = 5_000 PersistentNativeEdgeDegradedWindows = 3 MaxDisplayNameCodePoints = 24 DefaultViewerDisplayName = "观众" DefaultHostDisplayNamePrefix = "房主" MinViewerPasswordLength = 1 MaxViewerPasswordLength = 64 // MaxStunURLLength is stunUrlSchema's .max(512), in UTF-16 code units. MaxStunURLLength = 512 )
Limits and identifiers in the Piik wire contract.
const ( DefaultEndpointMediaCopyCapacity = 2 MaxEndpointMediaCopyCapacity = 3 )
Endpoint media copy accounting bounds, from src/shared/media-copy-accounting.ts.
const InteractionIntervalMs = 800
const MaxChatCodePoints = 280
const MaxSafeInteger = 9007199254740991
MaxSafeInteger is JavaScript's Number.MAX_SAFE_INTEGER.
Variables ¶
var DefaultQualitySettings = QualitySettings{
Resolution: "1080p",
MaxFramerate: 30,
MaxBitrate: 5_000_000,
DegradationPreference: "balanced",
ScreenAudioQuality: "music",
}
DefaultQualitySettings mirrors DEFAULT_QUALITY_SETTINGS.
var DefaultRoutePolicy = RoutePolicy{ PeerOnly: false, TopologyOptimization: true, NatPrediction: false, }
DefaultRoutePolicy mirrors DEFAULT_ROUTE_POLICY.
var ErrEndpointMediaCopyCapacity = errors.New(
"Endpoint media copy capacity must be 1, 2, or 3")
ErrEndpointMediaCopyCapacity is the assertEndpointMediaCopyCapacity throw.
var NatTraversalPaths = [...]string{"unknown", "ordinary", "predicted"}
NatTraversalPaths mirrors NAT_TRAVERSAL_PATHS in src/shared/nat-candidate.ts.
Functions ¶
func EncodeServerMessage ¶
func EncodeServerMessage(message ServerMessage) ([]byte, error)
EncodeServerMessage serializes one server message with the key order of the TypeScript object literal that produces it.
func EndpointMediaCopyCountFits ¶
func EndpointMediaCopyCountFits(count, capacity int, phase EndpointMediaCopyPhase) bool
func EndpointMediaCopyLimit ¶
func EndpointMediaCopyLimit(capacity int, phase EndpointMediaCopyPhase) int
EndpointMediaCopyLimit panics on an invalid capacity, where TypeScript throws.
func IsCanonicalVideoCodecEvidence ¶
IsCanonicalVideoCodecEvidence uses empty strings for TypeScript nulls; the schema rejects an empty codec string before this refinement runs.
func IsEndpointMediaCopyCapacity ¶
Go's int makes the fractional-value part of Number.isSafeInteger implicit.
func IsJSWhitespace ¶
IsJSWhitespace matches the JavaScript regular-expression \s class, which is also what String.prototype.trim and Number(string) strip. It is the single owner of that predicate for the server packages.
func NormalizeDisplayName ¶
NormalizeDisplayName returns false where the shared TypeScript normalizer returns null.
func PacketLossPercentFromDeltas ¶
PacketLossPercentFromDeltas maps nil arguments to TypeScript null; ok is false where the shared calculation returns null.
func UTF16Length ¶
UTF16Length counts UTF-16 code units, which is what zod's string .min/.max/ .length and String.prototype.length measure: not bytes, not code points. It is the single owner of that measurement for the server packages.
func ValidDisplayName ¶
ValidDisplayName mirrors displayNameSchema's bounds and canonical refine.
func ValidOpaqueID ¶
ValidOpaqueID mirrors opaqueIdSchema: 8..128 code units of [A-Za-z0-9_-].
func ValidStunURL ¶
ValidStunURL ports isValidStunUrl from src/shared/protocol.ts. The TypeScript feeds "http://<authority>" to the WHATWG URL parser; net/url is more permissive in several places, so the extra checks below restore the WHATWG answers (see stun_test.go for the recorded comparisons).
func ValidStunURLValue ¶
ValidStunURLValue mirrors stunUrlSchema: 1..512 UTF-16 code units plus isValidStunUrl. It is the single owner of that bound; config validates STUN_URLS and the Client's local STUN list through it.
func ValidToken ¶
ValidToken mirrors tokenSchema: 32..128 code units of [A-Za-z0-9_-].
func ValidViewerGrant ¶
ValidViewerGrant mirrors viewerGrantSchema.
func ValidViewerPassword ¶
ValidViewerPassword mirrors viewerPasswordSchema.
Types ¶
type AbandonRoomMessage ¶
type AbandonRoomMessage struct {
Type string `json:"type"`
}
AbandonRoomMessage is { type: "abandon-room" }.
type AuthenticateHostMessage ¶
type AuthenticateHostMessage struct {
Type string `json:"type"`
Protocol string `json:"protocol"`
RoomID string `json:"roomId"`
Role Role `json:"role"`
Token string `json:"token"`
ClientID string `json:"clientId"`
SharingPaused *bool `json:"sharingPaused,omitempty"`
QualitySettings *QualitySettings `json:"qualitySettings,omitempty"`
RoutePolicy RoutePolicy `json:"routePolicy"`
ViewerPresence bool `json:"viewerPresence,omitempty"`
ConnectionAttemptProgress4 bool `json:"connectionAttemptProgress4,omitempty"`
DisplayName *DisplayName `json:"displayName,omitempty"`
RoomOnly bool `json:"roomOnly,omitempty"`
RoomSession bool `json:"roomSession,omitempty"`
}
AuthenticateHostMessage is the host member of authenticateMessageSchema.
type AuthenticateViewerMessage ¶
type AuthenticateViewerMessage struct {
Type string `json:"type"`
Protocol string `json:"protocol"`
RoomID string `json:"roomId"`
Role Role `json:"role"`
ClientID string `json:"clientId"`
ViewerGrant string `json:"viewerGrant,omitempty"`
ViewerPassword string `json:"viewerPassword,omitempty"`
DisplayName *DisplayName `json:"displayName,omitempty"`
ViewerPresence bool `json:"viewerPresence,omitempty"`
ConnectionAttemptProgress4 bool `json:"connectionAttemptProgress4,omitempty"`
}
AuthenticateViewerMessage is the viewer member of authenticateMessageSchema.
type AuthenticatedHostMessage ¶
type AuthenticatedHostMessage struct {
Type string `json:"type"`
Protocol string `json:"protocol"`
PeerID string `json:"peerId"`
MaxViewers Int `json:"maxViewers"`
EndpointMediaCopyCapacity Int `json:"endpointMediaCopyCapacity"`
HostOnline bool `json:"hostOnline"`
HostPaused *bool `json:"hostPaused,omitempty"`
ConnectionID *string `json:"connectionId"`
IceConfig IceConfig `json:"iceConfig"`
RoutePolicy RoutePolicy `json:"routePolicy"`
CodeEntryPolicy CodeEntryPolicy `json:"codeEntryPolicy"`
ViewerAuthorizationGeneration string `json:"viewerAuthorizationGeneration"`
MediaMode string `json:"mediaMode"`
RouteRevision Int `json:"routeRevision"`
RouteAssignment ParticipantRouteAssignment `json:"routeAssignment"`
QualitySettings QualitySettings `json:"qualitySettings"`
Role Role `json:"role"`
ViewerPasswordEnabled bool `json:"viewerPasswordEnabled"`
}
AuthenticatedHostMessage returns the Host's current room and transport facts.
type AuthenticatedViewerMessage ¶
type AuthenticatedViewerMessage struct {
Type string `json:"type"`
Protocol string `json:"protocol"`
PeerID string `json:"peerId"`
MaxViewers Int `json:"maxViewers"`
EndpointMediaCopyCapacity Int `json:"endpointMediaCopyCapacity"`
HostOnline bool `json:"hostOnline"`
HostPaused *bool `json:"hostPaused,omitempty"`
ConnectionID *string `json:"connectionId"`
IceConfig IceConfig `json:"iceConfig"`
RoutePolicy RoutePolicy `json:"routePolicy"`
CodeEntryPolicy CodeEntryPolicy `json:"codeEntryPolicy"`
ViewerAuthorizationGeneration string `json:"viewerAuthorizationGeneration"`
MediaMode string `json:"mediaMode"`
RouteRevision Int `json:"routeRevision"`
RouteAssignment ParticipantRouteAssignment `json:"routeAssignment"`
QualitySettings QualitySettings `json:"qualitySettings"`
Role Role `json:"role"`
}
AuthenticatedViewerMessage is the viewer member of authenticatedMessageSchema.
type CandidateSignalOrigin ¶
type CandidateSignalOrigin string
CandidateSignalOrigin is CandidateSignalOrigin.
const ( CandidateOriginEnd CandidateSignalOrigin = "end" CandidateOriginOrdinary CandidateSignalOrigin = "ordinary" CandidateOriginPredicted CandidateSignalOrigin = "predicted" )
Candidate signal origins.
func CandidateSignalOriginOf ¶
func CandidateSignalOriginOf(candidate string) CandidateSignalOrigin
CandidateSignalOriginOf treats an empty string as TypeScript null (both yield "end").
type ClientMessage ¶
type ClientMessage interface {
// contains filtered or unexported methods
}
ClientMessage is one member of clientMessageSchema. The interface is sealed: only the message structs in this file implement it.
func DecodeClientMessage ¶
func DecodeClientMessage(data []byte) (ClientMessage, error)
DecodeClientMessage parses JSON and validates the message schema. Every member carries a distinct `type` literal, so that key resolves the union.
type ClientRestartRequestMessage ¶
type ClientRestartRequestMessage struct {
Type string `json:"type"`
TargetPeerID string `json:"targetPeerId,omitempty"`
ConnectionID string `json:"connectionId"`
Rebuild bool `json:"rebuild"`
}
ClientRestartRequestMessage is the client "restart-request" message.
type ClientSignalMessage ¶
type ClientSignalMessage struct {
Type string `json:"type"`
TargetPeerID string `json:"targetPeerId,omitempty"`
Payload SignalPayload `json:"payload"`
}
ClientSignalMessage is the client "signal" message.
type CodeEntryPolicy ¶
type CodeEntryPolicy = string
CodeEntryPolicy mirrors codeEntryPolicySchema.
const ( CodeEntryOpen CodeEntryPolicy = "open" CodeEntryPrivate CodeEntryPolicy = "private" )
Code entry policies.
type CodeEntryPolicyUpdatedResponse ¶
type CodeEntryPolicyUpdatedResponse struct {
Type string `json:"type"`
CodeEntryPolicy CodeEntryPolicy `json:"codeEntryPolicy"`
ViewerPasswordEnabled bool `json:"viewerPasswordEnabled"`
}
CodeEntryPolicyUpdatedResponse is type "code-entry-policy-updated".
type ConnectionAttempt ¶
ConnectionAttempt mirrors preparedRouteCandidateSchema.connectionAttempt.
func (*ConnectionAttempt) UnmarshalJSON ¶
func (v *ConnectionAttempt) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type CreateRoomRequest ¶
type CreateRoomRequest struct {
CodeEntryPolicy CodeEntryPolicy `json:"codeEntryPolicy"`
RoomPassword Nullable[string] `json:"roomPassword,omitzero"`
PreferredRoomID string `json:"preferredRoomId,omitempty"`
}
CreateRoomRequest mirrors createRoomRequestSchema.
func DecodeCreateRoomRequest ¶
func DecodeCreateRoomRequest(data []byte) (CreateRoomRequest, error)
DecodeCreateRoomRequest parses createRoomRequestSchema.
type CreateRoomResponse ¶
type CreateRoomResponse struct {
RoomID string `json:"roomId"`
HostToken string `json:"hostToken"`
InviteURL string `json:"inviteUrl"`
CodeEntryPolicy CodeEntryPolicy `json:"codeEntryPolicy"`
}
CreateRoomResponse mirrors createRoomResponseSchema.
type DisplayName ¶
type DisplayName string
DisplayName mirrors displayNameSchema: 1..96 UTF-16 code units that normalizeDisplayName leaves unchanged.
func (*DisplayName) UnmarshalJSON ¶
func (d *DisplayName) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type EndpointMediaCopyPhase ¶
type EndpointMediaCopyPhase string
EndpointMediaCopyPhase is EndpointMediaCopyPhase.
const ( EndpointMediaCopySteady EndpointMediaCopyPhase = "steady" EndpointMediaCopyTransition EndpointMediaCopyPhase = "transition" )
Endpoint media copy phases.
type ErrorMessage ¶
type ErrorMessage struct {
Type string `json:"type"`
Code string `json:"code"`
Message string `json:"message"`
}
ErrorMessage is { type: "error", code, message }.
type HostStatusMessage ¶
type HostStatusMessage struct {
Type string `json:"type"`
Online bool `json:"online"`
Paused bool `json:"paused"`
}
HostStatusMessage reports host presence and pause state.
type IceCandidate ¶
type IceCandidate struct {
Candidate string `json:"candidate"`
SDPMid Nullable[string] `json:"sdpMid,omitzero"`
SDPMLineIndex Nullable[Int] `json:"sdpMLineIndex,omitzero"`
UsernameFragment Nullable[string] `json:"usernameFragment,omitzero"`
}
IceCandidate mirrors iceCandidateSchema.
func (*IceCandidate) UnmarshalJSON ¶
func (v *IceCandidate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type IceConfig ¶
type IceConfig struct {
IceServers []IceServer `json:"iceServers"`
NatPredictionStunURLs []string `json:"natPredictionStunUrls"`
}
IceConfig mirrors iceConfigSchema.
func (IceConfig) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*IceConfig) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type IceServer ¶
type IceServer struct {
URLs IceServerURLs `json:"urls"`
}
IceServer mirrors iceServerSchema.
func (*IceServer) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type IceServerURLs ¶
IceServerURLs mirrors z.union([stunUrlSchema, z.array(stunUrlSchema)]).
func IceServerURLList ¶
func IceServerURLList(urls ...string) IceServerURLs
IceServerURLList builds the array form.
func (IceServerURLs) MarshalJSON ¶
func (v IceServerURLs) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*IceServerURLs) UnmarshalJSON ¶
func (v *IceServerURLs) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type Int ¶
type Int int64
Int is a JSON number restricted to an integral value, mirroring zod's z.number().int(): 5.0 is an integer, 5.5 is not, and values outside the safe integer range are rejected (zod 4 rejects them too, and every `.int()` field in the contract is bounded by MAX_SAFE_INTEGER anyway).
func (*Int) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type InteractionPayload ¶ added in v1.7.0
type InteractionPayload struct {
Kind string `json:"kind"`
Text string `json:"text,omitempty"`
Reaction string `json:"reaction,omitempty"`
TargetPeerID string `json:"targetPeerId,omitempty"`
}
func (*InteractionPayload) UnmarshalJSON ¶ added in v1.7.0
func (payload *InteractionPayload) UnmarshalJSON(data []byte) error
type InteractionSender ¶ added in v1.7.0
type InteractionSender struct {
PeerID string `json:"peerId"`
Role Role `json:"role"`
DisplayName DisplayName `json:"displayName"`
}
func (*InteractionSender) UnmarshalJSON ¶ added in v1.7.0
func (sender *InteractionSender) UnmarshalJSON(data []byte) error
type MediaRouteUpstream ¶
type MediaRouteUpstream struct {
Kind string `json:"kind"`
PeerID string `json:"peerId,omitempty"`
}
MediaRouteUpstream mirrors mediaRouteUpstreamSchema.
func PeerUpstream ¶
func PeerUpstream(peerID string) MediaRouteUpstream
PeerUpstream builds { kind: "peer", peerId }.
func (*MediaRouteUpstream) UnmarshalJSON ¶
func (v *MediaRouteUpstream) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type Nullable ¶
Nullable carries a value that is both `.nullable()` and `.optional()`, so the three wire states (absent, null, value) survive a decode/encode round trip.
func (Nullable[T]) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Nullable[T]) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type Num ¶
type Num float64
Num is a JSON number restricted to a finite value, mirroring zod's z.number().finite().
func (*Num) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type ParticipantPresenceEntry ¶
type ParticipantPresenceEntry struct {
Role Role `json:"role"`
PeerID string `json:"peerId"`
DisplayName DisplayName `json:"displayName"`
Upstream MediaRouteUpstream `json:"upstream"`
MediaReady bool `json:"mediaReady,omitempty"`
}
ParticipantPresenceEntry mirrors participantPresenceEntrySchema. The viewer variant is viewerPresenceEntrySchema.
func HostPresenceEntry ¶
func HostPresenceEntry(peerID string, displayName DisplayName) ParticipantPresenceEntry
HostPresenceEntry builds the host entry, whose upstream is always { kind: "none" } and which never carries mediaReady.
func NewViewerPresenceEntry ¶
func NewViewerPresenceEntry( peerID string, displayName DisplayName, upstream MediaRouteUpstream, mediaReady bool, ) ParticipantPresenceEntry
NewViewerPresenceEntry builds a viewer entry; mediaReady is emitted only when true, matching `...(mediaReady ? { mediaReady: true } : {})`.
func (*ParticipantPresenceEntry) UnmarshalJSON ¶
func (v *ParticipantPresenceEntry) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ParticipantRouteAssignment ¶
type ParticipantRouteAssignment struct {
Upstream MediaRouteUpstream `json:"upstream"`
ChildPeerIDs []string `json:"childPeerIds"`
SfuPublicationGeneration *string `json:"sfuPublicationGeneration"`
}
ParticipantRouteAssignment mirrors participantRouteAssignmentSchema.
func (ParticipantRouteAssignment) MarshalJSON ¶
func (v ParticipantRouteAssignment) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*ParticipantRouteAssignment) UnmarshalJSON ¶
func (v *ParticipantRouteAssignment) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type PauseSharingSourceMessage ¶
type PauseSharingSourceMessage struct {
Type string `json:"type"`
}
PauseSharingSourceMessage asks the host to pause its capture source.
type PreparedRouteCandidate ¶
type PreparedRouteCandidate struct {
ChildPeerID string `json:"childPeerId"`
ConnectionID string `json:"connectionId"`
Transport string `json:"transport"`
QualityProbe bool `json:"qualityProbe"`
ConnectionAttempt *ConnectionAttempt `json:"connectionAttempt,omitempty"`
}
PreparedRouteCandidate mirrors preparedRouteCandidateSchema.
func (*PreparedRouteCandidate) UnmarshalJSON ¶
func (v *PreparedRouteCandidate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type QualitySettings ¶
type QualitySettings struct {
Resolution string `json:"resolution"`
MaxFramerate Int `json:"maxFramerate"`
MaxBitrate Int `json:"maxBitrate"`
DegradationPreference string `json:"degradationPreference"`
ScreenAudioQuality string `json:"screenAudioQuality,omitempty"`
}
QualitySettings mirrors qualitySettingsSchema.
func (*QualitySettings) UnmarshalJSON ¶
func (v *QualitySettings) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type QualitySettingsMessage ¶
type QualitySettingsMessage struct {
Type string `json:"type"`
QualitySettings QualitySettings `json:"qualitySettings"`
}
QualitySettingsMessage broadcasts the host's quality settings.
type RefreshSfuMessage ¶
RefreshSfuMessage is { type: "refresh-sfu", revision }.
type RelayCapacityMessage ¶
type RelayCapacityMessage struct {
Type string `json:"type"`
DownstreamEdges Int `json:"downstreamEdges"`
}
RelayCapacityMessage is { type: "relay-capacity", downstreamEdges }.
type ReplaceRoomRequest ¶
type ReplaceRoomRequest struct {
CodeEntryPolicy CodeEntryPolicy `json:"codeEntryPolicy"`
RoomPassword Nullable[string] `json:"roomPassword,omitzero"`
}
ReplaceRoomRequest mirrors replaceRoomRequestSchema.
func DecodeReplaceRoomRequest ¶
func DecodeReplaceRoomRequest(data []byte) (ReplaceRoomRequest, error)
DecodeReplaceRoomRequest parses replaceRoomRequestSchema.
type RequestRouteDiagnosticMessage ¶
type RequestRouteDiagnosticMessage struct {
Type string `json:"type"`
}
RequestRouteDiagnosticMessage is { type: "request-route-diagnostic" }.
type ResetSenderQualityMessage ¶
type ResetSenderQualityMessage struct {
Type string `json:"type"`
}
ResetSenderQualityMessage is { type: "reset-sender-quality" }.
type RevokeViewerGrantRequest ¶
type RevokeViewerGrantRequest struct {
Action string `json:"action"`
}
RevokeViewerGrantRequest is action "revoke-viewer-grant".
type RoomAccessUpdateRequest ¶
type RoomAccessUpdateRequest interface {
// contains filtered or unexported methods
}
RoomAccessUpdateRequest is one member of roomAccessUpdateRequestSchema.
func DecodeRoomAccessUpdateRequest ¶
func DecodeRoomAccessUpdateRequest(data []byte) (RoomAccessUpdateRequest, error)
DecodeRoomAccessUpdateRequest parses roomAccessUpdateRequestSchema.
type RoomAccessUpdateResponse ¶
type RoomAccessUpdateResponse interface {
// contains filtered or unexported methods
}
RoomAccessUpdateResponse is one member of roomAccessUpdateResponseSchema.
type RoomClosedMessage ¶
RoomClosedMessage is { type: "room-closed", reason }.
type RoomInteractionMessage ¶ added in v1.7.0
type RoomInteractionMessage struct {
Type string `json:"type"`
ID string `json:"id"`
RequestID string `json:"requestId"`
OccurredAt Int `json:"occurredAt"`
Sender InteractionSender `json:"sender"`
Payload InteractionPayload `json:"payload"`
}
type RoomInteractionRejectedMessage ¶ added in v1.7.0
type RoomInteractionsReadyMessage ¶ added in v1.7.0
type RotateViewerGrantRequest ¶
type RotateViewerGrantRequest struct {
Action string `json:"action"`
}
RotateViewerGrantRequest is action "rotate-viewer-grant".
type RouteDiagnosticChild ¶
type RouteDiagnosticChild struct {
Ordinal Int `json:"ordinal"`
Parent RouteDiagnosticParent `json:"parent"`
EffectiveCapacity Int `json:"effectiveCapacity"`
ChildCount Int `json:"childCount"`
DemandAgeMs *Int `json:"demandAgeMs"`
QueueWaitMs *Int `json:"queueWaitMs"`
CandidateStartMs *Int `json:"candidateStartMs"`
FirstDecodedFrameMs *Int `json:"firstDecodedFrameMs"`
FinalMs *Int `json:"finalMs"`
FinalRoute string `json:"finalRoute"`
RejectionBucket string `json:"rejectionBucket"`
Quality *RouteDiagnosticQuality `json:"quality"`
}
RouteDiagnosticChild mirrors routeDiagnosticChildSchema.
func (*RouteDiagnosticChild) UnmarshalJSON ¶
func (v *RouteDiagnosticChild) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type RouteDiagnosticOperation ¶
type RouteDiagnosticOperation struct {
ChildOrdinal Int `json:"childOrdinal"`
Reason string `json:"reason"`
Stage string `json:"stage"`
Cursor Int `json:"cursor"`
CandidateCount Int `json:"candidateCount"`
}
RouteDiagnosticOperation mirrors routeDiagnosticOperationSchema.
func (*RouteDiagnosticOperation) UnmarshalJSON ¶
func (v *RouteDiagnosticOperation) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type RouteDiagnosticParent ¶
type RouteDiagnosticParent struct {
Kind string `json:"kind"`
Ordinal Int `json:"ordinal,omitempty"`
}
RouteDiagnosticParent mirrors routeDiagnosticParentSchema.
func (*RouteDiagnosticParent) UnmarshalJSON ¶
func (v *RouteDiagnosticParent) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type RouteDiagnosticQuality ¶
type RouteDiagnosticQuality struct {
EligibleWindows Int `json:"eligibleWindows"`
EligibleDurationMs Int `json:"eligibleDurationMs"`
FreezeWindows Int `json:"freezeWindows"`
FreezeCount Int `json:"freezeCount"`
FreezeDurationMs Int `json:"freezeDurationMs"`
PauseCount Int `json:"pauseCount"`
PauseDurationMs Int `json:"pauseDurationMs"`
}
RouteDiagnosticQuality mirrors routeDiagnosticQualitySchema.
func (*RouteDiagnosticQuality) UnmarshalJSON ¶
func (v *RouteDiagnosticQuality) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type RouteDiagnosticSnapshot ¶
type RouteDiagnosticSnapshot struct {
Children []RouteDiagnosticChild `json:"children"`
Operation *RouteDiagnosticOperation `json:"operation"`
}
RouteDiagnosticSnapshot mirrors routeDiagnosticSnapshotSchema.
func (RouteDiagnosticSnapshot) MarshalJSON ¶
func (v RouteDiagnosticSnapshot) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*RouteDiagnosticSnapshot) UnmarshalJSON ¶
func (v *RouteDiagnosticSnapshot) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type RouteDiagnosticSnapshotMessage ¶
type RouteDiagnosticSnapshotMessage struct {
Type string `json:"type"`
Snapshot RouteDiagnosticSnapshot `json:"snapshot"`
}
RouteDiagnosticSnapshotMessage carries the privacy-safe route snapshot.
type RouteFailedMessage ¶
type RouteFailedMessage struct {
Type string `json:"type"`
Revision Int `json:"revision"`
Phase string `json:"phase"`
ConnectionID *string `json:"connectionId"`
}
RouteFailedMessage is { type: "route-failed", revision, phase, connectionId }.
type RouteMediaUnavailableMessage ¶
type RouteMediaUnavailableMessage struct {
}
RouteMediaUnavailableMessage is the "route-media-unavailable" message.
type RoutePolicy ¶
type RoutePolicy struct {
PeerOnly bool `json:"peerOnly"`
TopologyOptimization bool `json:"topologyOptimization"`
NatPrediction bool `json:"natPrediction"`
}
RoutePolicy mirrors routePolicySchema.
func (*RoutePolicy) UnmarshalJSON ¶
func (v *RoutePolicy) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type RoutePolicyMessage ¶
type RoutePolicyMessage struct {
Type string `json:"type"`
RoutePolicy RoutePolicy `json:"routePolicy"`
}
RoutePolicyMessage broadcasts the host's route policy.
type RouteReadyMessage ¶
type RouteReadyMessage struct {
Type string `json:"type"`
Revision Int `json:"revision"`
Phase string `json:"phase"`
QualityApproved bool `json:"qualityApproved,omitempty"`
}
RouteReadyMessage is { type: "route-ready", revision, phase, qualityApproved? }.
type RouteStatusMessage ¶
type RouteStatusMessage struct {
Type string `json:"type"`
Revision Int `json:"revision"`
State string `json:"state"`
Reason string `json:"reason"`
}
RouteStatusMessage is the crossed (state, reason) union: "waiting" pairs with "sfu-admission" and "failed" pairs with "route-exhausted".
type RouteTransportConnectedMessage ¶
type RouteTransportConnectedMessage struct {
Type string `json:"type"`
Revision Int `json:"revision"`
ConnectionID string `json:"connectionId"`
}
RouteTransportConnectedMessage is the "route-transport-connected" message.
type RouteUpdateActiveMessage ¶
type RouteUpdateActiveMessage struct {
Type string `json:"type"`
Revision Int `json:"revision"`
Phase string `json:"phase"`
Assignment ParticipantRouteAssignment `json:"assignment"`
}
RouteUpdateActiveMessage is the phase "active" member of route-update.
type RouteUpdatePrepareMessage ¶
type RouteUpdatePrepareMessage struct {
Type string `json:"type"`
Revision Int `json:"revision"`
Phase string `json:"phase"`
Assignment ParticipantRouteAssignment `json:"assignment"`
Candidate PreparedRouteCandidate `json:"candidate"`
}
RouteUpdatePrepareMessage is the phase "prepare" member of route-update.
type RuntimeCapabilities ¶
type RuntimeCapabilities struct {
ConnectionAttemptProgress4 bool `json:"connectionAttemptProgress4,omitempty"`
Sfu bool `json:"sfu"`
SfuOnly bool `json:"sfuOnly,omitempty"`
NatPrediction bool `json:"natPrediction"`
RoomInteractions bool `json:"roomInteractions,omitempty"`
HostRoomSession bool `json:"hostRoomSession,omitempty"`
}
RuntimeCapabilities mirrors runtimeCapabilitiesSchema.
func (*RuntimeCapabilities) UnmarshalJSON ¶
func (v *RuntimeCapabilities) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type SendRoomInteractionMessage ¶ added in v1.7.0
type SendRoomInteractionMessage struct {
Type string `json:"type"`
RequestID string `json:"requestId"`
Payload InteractionPayload `json:"payload"`
}
type SenderQualityDiagnostics ¶
type SenderQualityDiagnostics struct {
NatTraversalPath string `json:"natTraversalPath"`
Reason *string `json:"reason"`
FramesPerSecond *Num `json:"framesPerSecond"`
BitrateKbps *Num `json:"bitrateKbps"`
CaptureFramesPerSecond Nullable[Num] `json:"captureFramesPerSecond,omitzero"`
MediaSourceFramesPerSecond Nullable[Num] `json:"mediaSourceFramesPerSecond,omitzero"`
Width Nullable[Int] `json:"width,omitzero"`
Height Nullable[Int] `json:"height,omitzero"`
VideoEncodingCount Nullable[Int] `json:"videoEncodingCount,omitzero"`
ActiveVideoEncodingCount Nullable[Int] `json:"activeVideoEncodingCount,omitzero"`
AvailableOutgoingKbps Nullable[Num] `json:"availableOutgoingKbps,omitzero"`
RttMs Nullable[Num] `json:"rttMs,omitzero"`
PacketLossPercent Nullable[Num] `json:"packetLossPercent,omitzero"`
}
SenderQualityDiagnostics mirrors senderQualityDiagnosticsSchema.
func (*SenderQualityDiagnostics) UnmarshalJSON ¶
func (v *SenderQualityDiagnostics) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type SenderQualityEvidenceMessage ¶
type SenderQualityEvidenceMessage struct {
Type string `json:"type"`
ChildPeerID string `json:"childPeerId"`
ConnectionID string `json:"connectionId"`
RtpStatsID *string `json:"rtpStatsId"`
TrackIdentifier *string `json:"trackIdentifier"`
SampleTimestampMs *Num `json:"sampleTimestampMs"`
RouteRevision Int `json:"routeRevision"`
State string `json:"state"`
Diagnostics SenderQualityDiagnostics `json:"diagnostics"`
}
SenderQualityEvidenceMessage is senderQualityEvidenceMessageSchema.
type ServerMessage ¶
type ServerMessage interface {
// contains filtered or unexported methods
}
ServerMessage is one member of serverMessageSchema. The interface is sealed: only the message structs in this file implement it.
func DecodeServerMessage ¶
func DecodeServerMessage(data []byte) (ServerMessage, error)
DecodeServerMessage supports replaying the shared wire fixture from Go. The server never reads its own messages in production.
type ServerRestartRequestMessage ¶
type ServerRestartRequestMessage struct {
Type string `json:"type"`
FromPeerID string `json:"fromPeerId"`
ConnectionID string `json:"connectionId"`
Rebuild bool `json:"rebuild"`
}
ServerRestartRequestMessage is the forwarded "restart-request" message.
type ServerSignalMessage ¶
type ServerSignalMessage struct {
Type string `json:"type"`
FromPeerID string `json:"fromPeerId"`
Payload SignalPayload `json:"payload"`
}
ServerSignalMessage is the forwarded "signal" message.
type ServerViewerQualityEvidenceMessage ¶
type ServerViewerQualityEvidenceMessage struct {
Type string `json:"type"`
ViewerPeerID string `json:"viewerPeerId"`
Upstream MediaRouteUpstream `json:"upstream"`
Guard ViewerQualityEvidenceGuard `json:"guard"`
Sequence Int `json:"sequence"`
WindowMs Int `json:"windowMs"`
Metrics ViewerQualityEvidenceMetrics `json:"metrics"`
}
ServerViewerQualityEvidenceMessage is the forwarded evidence envelope.
type SessionDescription ¶
SessionDescription mirrors sessionDescriptionSchema.
func (*SessionDescription) UnmarshalJSON ¶
func (v *SessionDescription) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type SetCodeEntryPolicyRequest ¶
type SetCodeEntryPolicyRequest struct {
Action string `json:"action"`
Policy CodeEntryPolicy `json:"policy"`
}
SetCodeEntryPolicyRequest is action "set-code-entry-policy".
type SetDisplayNameMessage ¶
type SetDisplayNameMessage struct {
Type string `json:"type"`
DisplayName DisplayName `json:"displayName"`
}
SetDisplayNameMessage is { type: "set-display-name", displayName }.
type SetQualitySettingsMessage ¶
type SetQualitySettingsMessage struct {
Type string `json:"type"`
QualitySettings QualitySettings `json:"qualitySettings"`
}
SetQualitySettingsMessage is { type: "set-quality-settings", qualitySettings }.
type SetSharingPausedMessage ¶
SetSharingPausedMessage is { type: "set-sharing-paused", shareGeneration, paused }.
type SetViewerPasswordRequest ¶
type SetViewerPasswordRequest struct {
Action string `json:"action"`
Password *string `json:"password"`
}
SetViewerPasswordRequest is action "set-viewer-password".
type SfuConfigMessage ¶
type SfuConfigMessage struct {
Type string `json:"type"`
Revision Int `json:"revision"`
PublicationGeneration string `json:"publicationGeneration"`
ConnectionID string `json:"connectionId"`
}
SfuConfigMessage authorizes one embedded media connection.
type SfuLayer ¶
type SfuLayer struct {
RID string `json:"rid"`
Width Int `json:"width"`
Height Int `json:"height"`
Bitrate Int `json:"bitrate"`
}
func (*SfuLayer) UnmarshalJSON ¶
type SfuMedia ¶
type SfuMedia struct {
Codec string `json:"codec"`
Layers []SfuLayer `json:"layers"`
Audio bool `json:"audio"`
AudioBitrate Int `json:"audioBitrate"`
}
SfuMedia describes the publisher's real encodings, ordered low to high.
func (*SfuMedia) UnmarshalJSON ¶
type SfuPublisherQualityEvidenceMessage ¶
type SfuPublisherQualityEvidenceMessage struct {
Type string `json:"type"`
PublicationGeneration string `json:"publicationGeneration"`
RouteRevision Int `json:"routeRevision"`
State string `json:"state"`
SampleTimestampMs *Num `json:"sampleTimestampMs"`
Diagnostics SenderQualityDiagnostics `json:"diagnostics"`
}
SfuPublisherQualityEvidenceMessage is sfuPublisherQualityEvidenceMessageSchema.
type SfuSignalMessage ¶
type SfuSignalMessage struct {
Type string `json:"type"`
Revision Int `json:"revision"`
PublicationGeneration string `json:"publicationGeneration"`
ConnectionID string `json:"connectionId"`
Kind string `json:"kind"`
Description *SessionDescription `json:"description,omitempty"`
Candidate *IceCandidate `json:"candidate,omitempty"`
Media *SfuMedia `json:"media,omitempty"`
ActiveCount *Int `json:"activeCount,omitempty"`
}
SfuSignalMessage travels only on the room's authenticated WebSocket.
type SharingStartFailedMessage ¶ added in v1.7.0
type SharingStartedMessage ¶ added in v1.7.0
type SharingStartedMessage struct {
Type string `json:"type"`
RoutePolicy RoutePolicy `json:"routePolicy"`
RouteRevision Int `json:"routeRevision"`
RouteAssignment ParticipantRouteAssignment `json:"routeAssignment"`
QualitySettings QualitySettings `json:"qualitySettings"`
Paused bool `json:"paused"`
}
SharingStartedMessage acknowledges a new media publication on an existing Host session.
type SharingStoppedMessage ¶
type SharingStoppedMessage struct {
Type string `json:"type"`
}
SharingStoppedMessage is { type: "sharing-stopped" }.
type SignalCloseCode ¶
type SignalCloseCode int
SignalCloseCode is one of SIGNAL_CLOSE_CODES.
const ( SignalCloseServiceRestart SignalCloseCode = 1012 SignalCloseSessionReplaced SignalCloseCode = 4001 SignalCloseClientReconnect SignalCloseCode = 4002 SignalCloseAuthenticationFailed SignalCloseCode = 4003 SignalCloseViewerAccessRevoked SignalCloseCode = 4004 )
SIGNAL_CLOSE_CODES.
type SignalPayload ¶
type SignalPayload struct {
Kind string
ConnectionID string
Description *SessionDescription
Candidate *IceCandidate
}
SignalPayload mirrors signalPayloadSchema. Candidate is nil for the JSON null the "candidate" variant requires.
func (SignalPayload) MarshalJSON ¶
func (v SignalPayload) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*SignalPayload) UnmarshalJSON ¶
func (v *SignalPayload) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type SignalingChallengeMessage ¶
SignalingChallengeMessage is { type: "signaling-challenge", sequence }.
type SignalingChallengeResponseMessage ¶
type SignalingChallengeResponseMessage struct {
Type string `json:"type"`
Sequence Int `json:"sequence"`
}
SignalingChallengeResponseMessage is the challenge echo.
type StartSharingMessage ¶ added in v1.7.0
type StartSharingMessage struct {
Type string `json:"type"`
SharingPaused bool `json:"sharingPaused,omitempty"`
QualitySettings *QualitySettings `json:"qualitySettings,omitempty"`
RoutePolicy RoutePolicy `json:"routePolicy"`
}
StartSharingMessage begins a new media publication on an existing Host room session.
type StopSharingMessage ¶
type StopSharingMessage struct {
Type string `json:"type"`
}
StopSharingMessage is { type: "stop-sharing", shareGeneration? }.
type SubscribeRoomInteractionsMessage ¶ added in v1.7.0
type SubscribeRoomInteractionsMessage struct {
Type string `json:"type"`
}
type ViewerGrantRevokedMessage ¶
type ViewerGrantRevokedMessage struct {
Type string `json:"type"`
ViewerAuthorizationGeneration string `json:"viewerAuthorizationGeneration"`
}
ViewerGrantRevokedMessage announces a superseded viewer authorization.
type ViewerGrantUpdatedResponse ¶
type ViewerGrantUpdatedResponse struct {
Type string `json:"type"`
ViewerAuthorizationGeneration string `json:"viewerAuthorizationGeneration"`
InviteURL *string `json:"inviteUrl"`
}
ViewerGrantUpdatedResponse is type "viewer-grant-updated". InviteURL is nil for the explicit null a revoke returns.
type ViewerPasswordUpdatedResponse ¶
type ViewerPasswordUpdatedResponse struct {
Type string `json:"type"`
Enabled bool `json:"enabled"`
}
ViewerPasswordUpdatedResponse is type "viewer-password-updated".
type ViewerPresenceMessage ¶
type ViewerPresenceMessage struct {
Type string `json:"type"`
Viewers []ParticipantPresenceEntry `json:"viewers"`
}
ViewerPresenceMessage carries the ordered participant roster.
func (ViewerPresenceMessage) MarshalJSON ¶
func (v ViewerPresenceMessage) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type ViewerQualityEvidenceGuard ¶
type ViewerQualityEvidenceGuard struct {
ConnectionID string `json:"connectionId"`
RouteRevision Int `json:"routeRevision"`
PresentationEpoch Int `json:"presentationEpoch"`
}
ViewerQualityEvidenceGuard mirrors viewerQualityEvidenceGuardSchema.
func (*ViewerQualityEvidenceGuard) UnmarshalJSON ¶
func (v *ViewerQualityEvidenceGuard) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ViewerQualityEvidenceMessage ¶
type ViewerQualityEvidenceMessage struct {
Type string `json:"type"`
Guard ViewerQualityEvidenceGuard `json:"guard"`
Sequence Int `json:"sequence"`
WindowMs Int `json:"windowMs"`
Metrics ViewerQualityEvidenceMetrics `json:"metrics"`
}
ViewerQualityEvidenceMessage is viewerQualityEvidenceMessageSchema.
type ViewerQualityEvidenceMetrics ¶
type ViewerQualityEvidenceMetrics struct {
NatTraversalPath string `json:"natTraversalPath"`
Width *Int `json:"width"`
Height *Int `json:"height"`
FramesPerSecond *Num `json:"framesPerSecond"`
BitrateKbps *Num `json:"bitrateKbps"`
PacketsReceivedDelta *Int `json:"packetsReceivedDelta"`
PacketsLostDelta *Int `json:"packetsLostDelta"`
RttMs *Num `json:"rttMs"`
JitterMs *Num `json:"jitterMs"`
FramesDecodedDelta *Int `json:"framesDecodedDelta"`
FramesDroppedDelta *Int `json:"framesDroppedDelta"`
DecodeMsPerFrame *Num `json:"decodeMsPerFrame"`
FreezeCountDelta *Int `json:"freezeCountDelta"`
FreezeDurationMsDelta *Num `json:"freezeDurationMsDelta"`
PauseCountDelta *Int `json:"pauseCountDelta"`
PauseDurationMsDelta *Num `json:"pauseDurationMsDelta"`
Codec *string `json:"codec"`
CodecProfile *string `json:"codecProfile"`
CodecParameters *string `json:"codecParameters"`
AudioBitrateKbps *Num `json:"audioBitrateKbps"`
AudioPacketLossPercent *Num `json:"audioPacketLossPercent"`
AudioJitterMs *Num `json:"audioJitterMs"`
AudioVideoPlayoutDeltaMs *Num `json:"audioVideoPlayoutDeltaMs"`
VideoJitterBufferDelayMs *Num `json:"videoJitterBufferDelayMs"`
AudioJitterBufferDelayMs *Num `json:"audioJitterBufferDelayMs"`
AudioConcealedSamplesPercent *Num `json:"audioConcealedSamplesPercent"`
AudioConcealmentEventsDelta *Int `json:"audioConcealmentEventsDelta"`
AudioCodec *string `json:"audioCodec"`
}
ViewerQualityEvidenceMetrics mirrors viewerQualityEvidenceMetricsSchema.
func (*ViewerQualityEvidenceMetrics) UnmarshalJSON ¶
func (v *ViewerQualityEvidenceMetrics) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.