001// ***************************************************************************************************************************
002// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file *
003// * distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file        *
004// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance            *
005// * with the License.  You may obtain a copy of the License at                                                              *
006// *                                                                                                                         *
007// *  http://www.apache.org/licenses/LICENSE-2.0                                                                             *
008// *                                                                                                                         *
009// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an  *
010// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the        *
011// * specific language governing permissions and limitations under the License.                                              *
012// ***************************************************************************************************************************
013package org.apache.juneau.dto.html5;
014
015import java.net.*;
016import java.net.URI;
017
018import org.apache.juneau.*;
019import org.apache.juneau.annotation.*;
020
021/**
022 * DTO for an HTML {@doc HTML5.embedded-content-0#the-video-element <video>}
023 * element.
024 *
025 * <h5 class='section'>See Also:</h5>
026 * <ul class='doctree'>
027 *    <li class='link'>{@doc juneau-dto.HTML5}
028 * </ul>
029 */
030@Bean(typeName="video")
031public class Video extends HtmlElementContainer {
032
033   /**
034    * {@doc HTML5.embedded-content-0#attr-media-autoplay autoplay}
035    * attribute.
036    *
037    * <p>
038    * Hint that the media resource can be started automatically when the page is loaded.
039    *
040    * @param autoplay
041    *    The new value for this attribute.
042    *    Typically a {@link Boolean} or {@link String}.
043    * @return This object (for method chaining).
044    */
045   public final Video autoplay(Object autoplay) {
046      attr("autoplay", deminimize(autoplay, "autoplay"));
047      return this;
048   }
049
050   /**
051    * {@doc HTML5.embedded-content-0#attr-media-controls controls}
052    * attribute.
053    *
054    * <p>
055    * Show user agent controls.
056    *
057    * @param controls
058    *    The new value for this attribute.
059    *    Typically a {@link Boolean} or {@link String}.
060    * @return This object (for method chaining).
061    */
062   public final Video controls(Object controls) {
063      attr("controls", deminimize(controls, "controls"));
064      return this;
065   }
066
067   /**
068    * {@doc HTML5.embedded-content-0#attr-media-crossorigin crossorigin}
069    * attribute.
070    *
071    * <p>
072    * How the element handles cross-origin requests.
073    *
074    * @param crossorigin The new value for this attribute.
075    * @return This object (for method chaining).
076    */
077   public final Video crossorigin(String crossorigin) {
078      attr("crossorigin", crossorigin);
079      return this;
080   }
081
082   /**
083    * {@doc HTML5.embedded-content-0#attr-dim-height height}
084    * attribute.
085    *
086    * <p>
087    * Vertical dimension.
088    *
089    * @param height
090    *    The new value for this attribute.
091    *    Typically a {@link Number} or {@link String}.
092    * @return This object (for method chaining).
093    */
094   public final Video height(Object height) {
095      attr("height", height);
096      return this;
097   }
098
099   /**
100    * {@doc HTML5.embedded-content-0#attr-media-loop loop} attribute.
101    *
102    * <p>
103    * Whether to loop the media resource.
104    *
105    * @param loop
106    *    The new value for this attribute.
107    *    Typically a {@link Boolean} or {@link String}.
108    * @return This object (for method chaining).
109    */
110   public final Video loop(Object loop) {
111      attr("loop", loop);
112      return this;
113   }
114
115   /**
116    * {@doc HTML5.embedded-content-0#attr-media-mediagroup mediagroup}
117    * attribute.
118    *
119    * <p>
120    * Groups media elements together with an implicit MediaController.
121    *
122    * @param mediagroup The new value for this attribute.
123    * @return This object (for method chaining).
124    */
125   public final Video mediagroup(String mediagroup) {
126      attr("mediagroup", mediagroup);
127      return this;
128   }
129
130   /**
131    * {@doc HTML5.embedded-content-0#attr-media-muted muted}
132    * attribute.
133    *
134    * <p>
135    * Whether to mute the media resource by default.
136    *
137    * @param muted
138    *    The new value for this attribute.
139    *    Typically a {@link Boolean} or {@link String}.
140    * @return This object (for method chaining).
141    */
142   public final Video muted(Object muted) {
143      attr("muted", muted);
144      return this;
145   }
146
147   /**
148    * {@doc HTML5.embedded-content-0#attr-video-poster poster}
149    * attribute.
150    *
151    * <p>
152    * Poster frame to show prior to video playback.
153    *
154    * @param poster The new value for this attribute.
155    * @return This object (for method chaining).
156    */
157   public final Video poster(String poster) {
158      attr("poster", poster);
159      return this;
160   }
161
162   /**
163    * {@doc HTML5.embedded-content-0#attr-media-preload preload}
164    * attribute.
165    *
166    * <p>
167    * Hints how much buffering the media resource will likely need.
168    *
169    * @param preload The new value for this attribute.
170    * @return This object (for method chaining).
171    */
172   public final Video preload(String preload) {
173      attr("preload", preload);
174      return this;
175   }
176
177   /**
178    * {@doc HTML5.embedded-content-0#attr-media-src src} attribute.
179    *
180    * <p>
181    * Address of the resource.
182    *
183    * <p>
184    * The value can be of any of the following types: {@link URI}, {@link URL}, {@link String}.
185    * Strings must be valid URIs.
186    *
187    * <p>
188    * URIs defined by {@link UriResolver} can be used for values.
189    *
190    * @param src
191    *    The new value for this attribute.
192    *    Typically a {@link URL} or {@link String}.
193    * @return This object (for method chaining).
194    */
195   public final Video src(Object src) {
196      attrUri("src", src);
197      return this;
198   }
199
200   /**
201    * {@doc HTML5.embedded-content-0#attr-dim-width width} attribute.
202    *
203    * <p>
204    * Horizontal dimension.
205    *
206    * @param width
207    *    The new value for this attribute.
208    *    Typically a {@link Number} or {@link String}.
209    * @return This object (for method chaining).
210    */
211   public final Video width(Object width) {
212      attr("width", width);
213      return this;
214   }
215
216
217   //-----------------------------------------------------------------------------------------------------------------
218   // Overridden methods
219   //-----------------------------------------------------------------------------------------------------------------
220
221   @Override /* HtmlElement */
222   public final Video _class(String _class) {
223      super._class(_class);
224      return this;
225   }
226
227   @Override /* HtmlElement */
228   public final Video id(String id) {
229      super.id(id);
230      return this;
231   }
232
233   @Override /* HtmlElement */
234   public final Video style(String style) {
235      super.style(style);
236      return this;
237   }
238
239   @Override /* HtmlElementContainer */
240   public final Video children(Object...children) {
241      super.children(children);
242      return this;
243   }
244
245   @Override /* HtmlElementContainer */
246   public final Video child(Object child) {
247      super.child(child);
248      return this;
249   }
250}