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 * <ul class='seealso'> 026 * <li class='link'>{@doc juneau-dto.HTML5} 027 * </ul> 028 */ 029@Bean(typeName="video") 030public class Video extends HtmlElementContainer { 031 032 /** 033 * {@doc HTML5.embedded-content-0#attr-media-autoplay autoplay} 034 * attribute. 035 * 036 * <p> 037 * Hint that the media resource can be started automatically when the page is loaded. 038 * 039 * @param autoplay 040 * The new value for this attribute. 041 * Typically a {@link Boolean} or {@link String}. 042 * @return This object (for method chaining). 043 */ 044 public final Video autoplay(Object autoplay) { 045 attr("autoplay", deminimize(autoplay, "autoplay")); 046 return this; 047 } 048 049 /** 050 * {@doc HTML5.embedded-content-0#attr-media-controls controls} 051 * attribute. 052 * 053 * <p> 054 * Show user agent controls. 055 * 056 * @param controls 057 * The new value for this attribute. 058 * Typically a {@link Boolean} or {@link String}. 059 * @return This object (for method chaining). 060 */ 061 public final Video controls(Object controls) { 062 attr("controls", deminimize(controls, "controls")); 063 return this; 064 } 065 066 /** 067 * {@doc HTML5.embedded-content-0#attr-media-crossorigin crossorigin} 068 * attribute. 069 * 070 * <p> 071 * How the element handles cross-origin requests. 072 * 073 * @param crossorigin The new value for this attribute. 074 * @return This object (for method chaining). 075 */ 076 public final Video crossorigin(String crossorigin) { 077 attr("crossorigin", crossorigin); 078 return this; 079 } 080 081 /** 082 * {@doc HTML5.embedded-content-0#attr-dim-height height} 083 * attribute. 084 * 085 * <p> 086 * Vertical dimension. 087 * 088 * @param height 089 * The new value for this attribute. 090 * Typically a {@link Number} or {@link String}. 091 * @return This object (for method chaining). 092 */ 093 public final Video height(Object height) { 094 attr("height", height); 095 return this; 096 } 097 098 /** 099 * {@doc HTML5.embedded-content-0#attr-media-loop loop} attribute. 100 * 101 * <p> 102 * Whether to loop the media resource. 103 * 104 * @param loop 105 * The new value for this attribute. 106 * Typically a {@link Boolean} or {@link String}. 107 * @return This object (for method chaining). 108 */ 109 public final Video loop(Object loop) { 110 attr("loop", loop); 111 return this; 112 } 113 114 /** 115 * {@doc HTML5.embedded-content-0#attr-media-mediagroup mediagroup} 116 * attribute. 117 * 118 * <p> 119 * Groups media elements together with an implicit MediaController. 120 * 121 * @param mediagroup The new value for this attribute. 122 * @return This object (for method chaining). 123 */ 124 public final Video mediagroup(String mediagroup) { 125 attr("mediagroup", mediagroup); 126 return this; 127 } 128 129 /** 130 * {@doc HTML5.embedded-content-0#attr-media-muted muted} 131 * attribute. 132 * 133 * <p> 134 * Whether to mute the media resource by default. 135 * 136 * @param muted 137 * The new value for this attribute. 138 * Typically a {@link Boolean} or {@link String}. 139 * @return This object (for method chaining). 140 */ 141 public final Video muted(Object muted) { 142 attr("muted", muted); 143 return this; 144 } 145 146 /** 147 * {@doc HTML5.embedded-content-0#attr-video-poster poster} 148 * attribute. 149 * 150 * <p> 151 * Poster frame to show prior to video playback. 152 * 153 * @param poster The new value for this attribute. 154 * @return This object (for method chaining). 155 */ 156 public final Video poster(String poster) { 157 attr("poster", poster); 158 return this; 159 } 160 161 /** 162 * {@doc HTML5.embedded-content-0#attr-media-preload preload} 163 * attribute. 164 * 165 * <p> 166 * Hints how much buffering the media resource will likely need. 167 * 168 * @param preload The new value for this attribute. 169 * @return This object (for method chaining). 170 */ 171 public final Video preload(String preload) { 172 attr("preload", preload); 173 return this; 174 } 175 176 /** 177 * {@doc HTML5.embedded-content-0#attr-media-src src} attribute. 178 * 179 * <p> 180 * Address of the resource. 181 * 182 * <p> 183 * The value can be of any of the following types: {@link URI}, {@link URL}, {@link String}. 184 * Strings must be valid URIs. 185 * 186 * <p> 187 * URIs defined by {@link UriResolver} can be used for values. 188 * 189 * @param src 190 * The new value for this attribute. 191 * Typically a {@link URL} or {@link String}. 192 * @return This object (for method chaining). 193 */ 194 public final Video src(Object src) { 195 attrUri("src", src); 196 return this; 197 } 198 199 /** 200 * {@doc HTML5.embedded-content-0#attr-dim-width width} attribute. 201 * 202 * <p> 203 * Horizontal dimension. 204 * 205 * @param width 206 * The new value for this attribute. 207 * Typically a {@link Number} or {@link String}. 208 * @return This object (for method chaining). 209 */ 210 public final Video width(Object width) { 211 attr("width", width); 212 return this; 213 } 214 215 216 //----------------------------------------------------------------------------------------------------------------- 217 // Overridden methods 218 //----------------------------------------------------------------------------------------------------------------- 219 220 @Override /* HtmlElement */ 221 public final Video _class(String _class) { 222 super._class(_class); 223 return this; 224 } 225 226 @Override /* HtmlElement */ 227 public final Video id(String id) { 228 super.id(id); 229 return this; 230 } 231 232 @Override /* HtmlElement */ 233 public final Video style(String style) { 234 super.style(style); 235 return this; 236 } 237 238 @Override /* HtmlElementContainer */ 239 public final Video children(Object...children) { 240 super.children(children); 241 return this; 242 } 243 244 @Override /* HtmlElementContainer */ 245 public final Video child(Object child) { 246 super.child(child); 247 return this; 248 } 249}