forked from go-rod/rod
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cast.go
144 lines (106 loc) · 3.54 KB
/
cast.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
// This file is generated by "./lib/proto/generate"
package proto
/*
Cast
A domain for interacting with Cast, Presentation API, and Remote Playback API
functionalities.
*/
// CastSink ...
type CastSink struct {
// Name ...
Name string `json:"name"`
// ID ...
ID string `json:"id"`
// Session (optional) Text describing the current session. Present only if there is an active
// session on the sink.
Session string `json:"session,omitempty"`
}
// CastEnable Starts observing for sinks that can be used for tab mirroring, and if set,
// sinks compatible with |presentationUrl| as well. When sinks are found, a
// |sinksUpdated| event is fired.
// Also starts observing for issue messages. When an issue is added or removed,
// an |issueUpdated| event is fired.
type CastEnable struct {
// PresentationURL (optional) ...
PresentationURL string `json:"presentationUrl,omitempty"`
}
// ProtoReq name
func (m CastEnable) ProtoReq() string { return "Cast.enable" }
// Call sends the request
func (m CastEnable) Call(c Client) error {
return call(m.ProtoReq(), m, nil, c)
}
// CastDisable Stops observing for sinks and issues.
type CastDisable struct {
}
// ProtoReq name
func (m CastDisable) ProtoReq() string { return "Cast.disable" }
// Call sends the request
func (m CastDisable) Call(c Client) error {
return call(m.ProtoReq(), m, nil, c)
}
// CastSetSinkToUse Sets a sink to be used when the web page requests the browser to choose a
// sink via Presentation API, Remote Playback API, or Cast SDK.
type CastSetSinkToUse struct {
// SinkName ...
SinkName string `json:"sinkName"`
}
// ProtoReq name
func (m CastSetSinkToUse) ProtoReq() string { return "Cast.setSinkToUse" }
// Call sends the request
func (m CastSetSinkToUse) Call(c Client) error {
return call(m.ProtoReq(), m, nil, c)
}
// CastStartDesktopMirroring Starts mirroring the desktop to the sink.
type CastStartDesktopMirroring struct {
// SinkName ...
SinkName string `json:"sinkName"`
}
// ProtoReq name
func (m CastStartDesktopMirroring) ProtoReq() string { return "Cast.startDesktopMirroring" }
// Call sends the request
func (m CastStartDesktopMirroring) Call(c Client) error {
return call(m.ProtoReq(), m, nil, c)
}
// CastStartTabMirroring Starts mirroring the tab to the sink.
type CastStartTabMirroring struct {
// SinkName ...
SinkName string `json:"sinkName"`
}
// ProtoReq name
func (m CastStartTabMirroring) ProtoReq() string { return "Cast.startTabMirroring" }
// Call sends the request
func (m CastStartTabMirroring) Call(c Client) error {
return call(m.ProtoReq(), m, nil, c)
}
// CastStopCasting Stops the active Cast session on the sink.
type CastStopCasting struct {
// SinkName ...
SinkName string `json:"sinkName"`
}
// ProtoReq name
func (m CastStopCasting) ProtoReq() string { return "Cast.stopCasting" }
// Call sends the request
func (m CastStopCasting) Call(c Client) error {
return call(m.ProtoReq(), m, nil, c)
}
// CastSinksUpdated This is fired whenever the list of available sinks changes. A sink is a
// device or a software surface that you can cast to.
type CastSinksUpdated struct {
// Sinks ...
Sinks []*CastSink `json:"sinks"`
}
// ProtoEvent name
func (evt CastSinksUpdated) ProtoEvent() string {
return "Cast.sinksUpdated"
}
// CastIssueUpdated This is fired whenever the outstanding issue/error message changes.
// |issueMessage| is empty if there is no issue.
type CastIssueUpdated struct {
// IssueMessage ...
IssueMessage string `json:"issueMessage"`
}
// ProtoEvent name
func (evt CastIssueUpdated) ProtoEvent() string {
return "Cast.issueUpdated"
}