|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Spatie\SchemaOrg; |
|
4
|
|
|
|
|
5
|
|
|
/** |
|
6
|
|
|
* A media object, such as an image, video, or audio object embedded in a web |
|
7
|
|
|
* page or a downloadable dataset i.e. DataDownload. Note that a creative work |
|
8
|
|
|
* may have many media objects associated with it on the same web page. For |
|
9
|
|
|
* example, a page about a single song (MusicRecording) may have a music video |
|
10
|
|
|
* (VideoObject), and a high and low bandwidth audio stream (2 AudioObject's). |
|
11
|
|
|
* |
|
12
|
|
|
* @see http://schema.org/MediaObject |
|
13
|
|
|
*/ |
|
14
|
|
|
class MediaObject extends CreativeWork |
|
15
|
|
|
{ |
|
16
|
|
|
/** |
|
17
|
|
|
* A NewsArticle associated with the Media Object. |
|
18
|
|
|
* |
|
19
|
|
|
* @param NewsArticle|NewsArticle[] $associatedArticle |
|
20
|
|
|
* |
|
21
|
|
|
* @return static |
|
22
|
|
|
* |
|
23
|
|
|
* @see http://schema.org/associatedArticle |
|
24
|
|
|
*/ |
|
25
|
|
|
public function associatedArticle($associatedArticle) |
|
26
|
|
|
{ |
|
27
|
|
|
return $this->setProperty('associatedArticle', $associatedArticle); |
|
28
|
|
|
} |
|
29
|
|
|
|
|
30
|
|
|
/** |
|
31
|
|
|
* The bitrate of the media object. |
|
32
|
|
|
* |
|
33
|
|
|
* @param string|string[] $bitrate |
|
34
|
|
|
* |
|
35
|
|
|
* @return static |
|
36
|
|
|
* |
|
37
|
|
|
* @see http://schema.org/bitrate |
|
38
|
|
|
*/ |
|
39
|
|
|
public function bitrate($bitrate) |
|
40
|
|
|
{ |
|
41
|
|
|
return $this->setProperty('bitrate', $bitrate); |
|
42
|
|
|
} |
|
43
|
|
|
|
|
44
|
|
|
/** |
|
45
|
|
|
* File size in (mega/kilo) bytes. |
|
46
|
|
|
* |
|
47
|
|
|
* @param string|string[] $contentSize |
|
48
|
|
|
* |
|
49
|
|
|
* @return static |
|
50
|
|
|
* |
|
51
|
|
|
* @see http://schema.org/contentSize |
|
52
|
|
|
*/ |
|
53
|
|
|
public function contentSize($contentSize) |
|
54
|
|
|
{ |
|
55
|
|
|
return $this->setProperty('contentSize', $contentSize); |
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
|
|
/** |
|
59
|
|
|
* Actual bytes of the media object, for example the image file or video |
|
60
|
|
|
* file. |
|
61
|
|
|
* |
|
62
|
|
|
* @param string|string[] $contentUrl |
|
63
|
|
|
* |
|
64
|
|
|
* @return static |
|
65
|
|
|
* |
|
66
|
|
|
* @see http://schema.org/contentUrl |
|
67
|
|
|
*/ |
|
68
|
|
|
public function contentUrl($contentUrl) |
|
69
|
|
|
{ |
|
70
|
|
|
return $this->setProperty('contentUrl', $contentUrl); |
|
71
|
|
|
} |
|
72
|
|
|
|
|
73
|
|
|
/** |
|
74
|
|
|
* The duration of the item (movie, audio recording, event, etc.) in [ISO |
|
75
|
|
|
* 8601 date format](http://en.wikipedia.org/wiki/ISO_8601). |
|
76
|
|
|
* |
|
77
|
|
|
* @param Duration|Duration[] $duration |
|
78
|
|
|
* |
|
79
|
|
|
* @return static |
|
80
|
|
|
* |
|
81
|
|
|
* @see http://schema.org/duration |
|
82
|
|
|
*/ |
|
83
|
|
|
public function duration($duration) |
|
84
|
|
|
{ |
|
85
|
|
|
return $this->setProperty('duration', $duration); |
|
86
|
|
|
} |
|
87
|
|
|
|
|
88
|
|
|
/** |
|
89
|
|
|
* A URL pointing to a player for a specific video. In general, this is the |
|
90
|
|
|
* information in the ```src``` element of an ```embed``` tag and should not |
|
91
|
|
|
* be the same as the content of the ```loc``` tag. |
|
92
|
|
|
* |
|
93
|
|
|
* @param string|string[] $embedUrl |
|
94
|
|
|
* |
|
95
|
|
|
* @return static |
|
96
|
|
|
* |
|
97
|
|
|
* @see http://schema.org/embedUrl |
|
98
|
|
|
*/ |
|
99
|
|
|
public function embedUrl($embedUrl) |
|
100
|
|
|
{ |
|
101
|
|
|
return $this->setProperty('embedUrl', $embedUrl); |
|
102
|
|
|
} |
|
103
|
|
|
|
|
104
|
|
|
/** |
|
105
|
|
|
* The CreativeWork encoded by this media object. |
|
106
|
|
|
* |
|
107
|
|
|
* @param CreativeWork|CreativeWork[] $encodesCreativeWork |
|
108
|
|
|
* |
|
109
|
|
|
* @return static |
|
110
|
|
|
* |
|
111
|
|
|
* @see http://schema.org/encodesCreativeWork |
|
112
|
|
|
*/ |
|
113
|
|
|
public function encodesCreativeWork($encodesCreativeWork) |
|
114
|
|
|
{ |
|
115
|
|
|
return $this->setProperty('encodesCreativeWork', $encodesCreativeWork); |
|
116
|
|
|
} |
|
117
|
|
|
|
|
118
|
|
|
/** |
|
119
|
|
|
* Media type typically expressed using a MIME format (see [IANA |
|
120
|
|
|
* site](http://www.iana.org/assignments/media-types/media-types.xhtml) and |
|
121
|
|
|
* [MDN |
|
122
|
|
|
* reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)) |
|
123
|
|
|
* e.g. application/zip for a SoftwareApplication binary, audio/mpeg for |
|
124
|
|
|
* .mp3 etc.). |
|
125
|
|
|
* |
|
126
|
|
|
* In cases where a [[CreativeWork]] has several media type representations, |
|
127
|
|
|
* [[encoding]] can be used to indicate each [[MediaObject]] alongside |
|
128
|
|
|
* particular [[encodingFormat]] information. |
|
129
|
|
|
* |
|
130
|
|
|
* Unregistered or niche encoding and file formats can be indicated instead |
|
131
|
|
|
* via the most appropriate URL, e.g. defining Web page or a |
|
132
|
|
|
* Wikipedia/Wikidata entry. |
|
133
|
|
|
* |
|
134
|
|
|
* @param string|string[] $encodingFormat |
|
135
|
|
|
* |
|
136
|
|
|
* @return static |
|
137
|
|
|
* |
|
138
|
|
|
* @see http://schema.org/encodingFormat |
|
139
|
|
|
*/ |
|
140
|
|
|
public function encodingFormat($encodingFormat) |
|
141
|
|
|
{ |
|
142
|
|
|
return $this->setProperty('encodingFormat', $encodingFormat); |
|
143
|
|
|
} |
|
144
|
|
|
|
|
145
|
|
|
/** |
|
146
|
|
|
* The height of the item. |
|
147
|
|
|
* |
|
148
|
|
|
* @param Distance|Distance[]|QuantitativeValue|QuantitativeValue[] $height |
|
149
|
|
|
* |
|
150
|
|
|
* @return static |
|
151
|
|
|
* |
|
152
|
|
|
* @see http://schema.org/height |
|
153
|
|
|
*/ |
|
154
|
|
|
public function height($height) |
|
155
|
|
|
{ |
|
156
|
|
|
return $this->setProperty('height', $height); |
|
157
|
|
|
} |
|
158
|
|
|
|
|
159
|
|
|
/** |
|
160
|
|
|
* Player type required—for example, Flash or Silverlight. |
|
161
|
|
|
* |
|
162
|
|
|
* @param string|string[] $playerType |
|
163
|
|
|
* |
|
164
|
|
|
* @return static |
|
165
|
|
|
* |
|
166
|
|
|
* @see http://schema.org/playerType |
|
167
|
|
|
*/ |
|
168
|
|
|
public function playerType($playerType) |
|
169
|
|
|
{ |
|
170
|
|
|
return $this->setProperty('playerType', $playerType); |
|
171
|
|
|
} |
|
172
|
|
|
|
|
173
|
|
|
/** |
|
174
|
|
|
* The production company or studio responsible for the item e.g. series, |
|
175
|
|
|
* video game, episode etc. |
|
176
|
|
|
* |
|
177
|
|
|
* @param Organization|Organization[] $productionCompany |
|
178
|
|
|
* |
|
179
|
|
|
* @return static |
|
180
|
|
|
* |
|
181
|
|
|
* @see http://schema.org/productionCompany |
|
182
|
|
|
*/ |
|
183
|
|
|
public function productionCompany($productionCompany) |
|
184
|
|
|
{ |
|
185
|
|
|
return $this->setProperty('productionCompany', $productionCompany); |
|
186
|
|
|
} |
|
187
|
|
|
|
|
188
|
|
|
/** |
|
189
|
|
|
* The regions where the media is allowed. If not specified, then it's |
|
190
|
|
|
* assumed to be allowed everywhere. Specify the countries in [ISO 3166 |
|
191
|
|
|
* format](http://en.wikipedia.org/wiki/ISO_3166). |
|
192
|
|
|
* |
|
193
|
|
|
* @param Place|Place[] $regionsAllowed |
|
194
|
|
|
* |
|
195
|
|
|
* @return static |
|
196
|
|
|
* |
|
197
|
|
|
* @see http://schema.org/regionsAllowed |
|
198
|
|
|
*/ |
|
199
|
|
|
public function regionsAllowed($regionsAllowed) |
|
200
|
|
|
{ |
|
201
|
|
|
return $this->setProperty('regionsAllowed', $regionsAllowed); |
|
202
|
|
|
} |
|
203
|
|
|
|
|
204
|
|
|
/** |
|
205
|
|
|
* Indicates if use of the media require a subscription (either paid or |
|
206
|
|
|
* free). Allowed values are ```true``` or ```false``` (note that an earlier |
|
207
|
|
|
* version had 'yes', 'no'). |
|
208
|
|
|
* |
|
209
|
|
|
* @param bool|bool[] $requiresSubscription |
|
210
|
|
|
* |
|
211
|
|
|
* @return static |
|
212
|
|
|
* |
|
213
|
|
|
* @see http://schema.org/requiresSubscription |
|
214
|
|
|
*/ |
|
215
|
|
|
public function requiresSubscription($requiresSubscription) |
|
216
|
|
|
{ |
|
217
|
|
|
return $this->setProperty('requiresSubscription', $requiresSubscription); |
|
218
|
|
|
} |
|
219
|
|
|
|
|
220
|
|
|
/** |
|
221
|
|
|
* Date when this media object was uploaded to this site. |
|
222
|
|
|
* |
|
223
|
|
|
* @param \DateTimeInterface|\DateTimeInterface[] $uploadDate |
|
224
|
|
|
* |
|
225
|
|
|
* @return static |
|
226
|
|
|
* |
|
227
|
|
|
* @see http://schema.org/uploadDate |
|
228
|
|
|
*/ |
|
229
|
|
|
public function uploadDate($uploadDate) |
|
230
|
|
|
{ |
|
231
|
|
|
return $this->setProperty('uploadDate', $uploadDate); |
|
232
|
|
|
} |
|
233
|
|
|
|
|
234
|
|
|
/** |
|
235
|
|
|
* The width of the item. |
|
236
|
|
|
* |
|
237
|
|
|
* @param Distance|Distance[]|QuantitativeValue|QuantitativeValue[] $width |
|
238
|
|
|
* |
|
239
|
|
|
* @return static |
|
240
|
|
|
* |
|
241
|
|
|
* @see http://schema.org/width |
|
242
|
|
|
*/ |
|
243
|
|
|
public function width($width) |
|
244
|
|
|
{ |
|
245
|
|
|
return $this->setProperty('width', $width); |
|
246
|
|
|
} |
|
247
|
|
|
|
|
248
|
|
|
} |
|
249
|
|
|
|