browser_protocol/media/
mod.rs1use serde::{Serialize, Deserialize};
3use serde_json::Value as JsonValue;
4
5pub type PlayerId = String;
8
9
10pub type Timestamp = f64;
11
12#[derive(Debug, Clone, Serialize, Deserialize, Default)]
16#[serde(rename_all = "camelCase")]
17pub struct PlayerMessage {
18 pub level: String,
29
30 pub message: String,
31}
32
33#[derive(Debug, Clone, Serialize, Deserialize, Default)]
36#[serde(rename_all = "camelCase")]
37pub struct PlayerProperty {
38
39 pub name: String,
40
41 pub value: String,
42}
43
44#[derive(Debug, Clone, Serialize, Deserialize, Default)]
47#[serde(rename_all = "camelCase")]
48pub struct PlayerEvent {
49
50 pub timestamp: Timestamp,
51
52 pub value: String,
53}
54
55#[derive(Debug, Clone, Serialize, Deserialize, Default)]
59#[serde(rename_all = "camelCase")]
60pub struct PlayerErrorSourceLocation {
61
62 pub file: String,
63
64 pub line: i64,
65}
66
67#[derive(Debug, Clone, Serialize, Deserialize, Default)]
70#[serde(rename_all = "camelCase")]
71pub struct PlayerError {
72
73 pub errorType: String,
74 pub code: i64,
78 pub stack: Vec<PlayerErrorSourceLocation>,
81 pub cause: Vec<PlayerError>,
85 pub data: serde_json::Map<String, JsonValue>,
88}
89
90
91#[derive(Debug, Clone, Serialize, Deserialize, Default)]
92#[serde(rename_all = "camelCase")]
93pub struct Player {
94
95 pub playerId: PlayerId,
96
97 #[serde(skip_serializing_if = "Option::is_none")]
98 pub domNodeId: Option<crate::dom::BackendNodeId>,
99}
100
101#[derive(Debug, Clone, Serialize, Deserialize, Default)]
102pub struct EnableParams {}
103
104impl EnableParams { pub const METHOD: &'static str = "Media.enable"; }
105
106impl crate::CdpCommand for EnableParams {
107 const METHOD: &'static str = "Media.enable";
108 type Response = crate::EmptyReturns;
109}
110
111#[derive(Debug, Clone, Serialize, Deserialize, Default)]
112pub struct DisableParams {}
113
114impl DisableParams { pub const METHOD: &'static str = "Media.disable"; }
115
116impl crate::CdpCommand for DisableParams {
117 const METHOD: &'static str = "Media.disable";
118 type Response = crate::EmptyReturns;
119}