001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.wicket.markup.html.media.audio;
018
019import org.apache.wicket.markup.ComponentTag;
020import org.apache.wicket.markup.html.media.MediaComponent;
021import org.apache.wicket.model.IModel;
022import org.apache.wicket.request.mapper.parameter.PageParameters;
023import org.apache.wicket.request.resource.ResourceReference;
024
025/**
026 * An audio media component to playback audio files.
027 *
028 * @author Tobias Soloschenko
029 * @author Andrew Lombardi
030 * @since 7.0.0
031 */
032public class Audio extends MediaComponent
033{
034        private static final long serialVersionUID = 1L;
035
036        /**
037         * Creates an audio component
038         *
039         * @param id
040         *            the component id
041         */
042        public Audio(String id)
043        {
044                super(id);
045        }
046
047        /**
048         * Creates an audio component
049         *
050         * @param id
051         *            the component id
052         * @param model
053         *            the internally used model
054         */
055        public Audio(String id, IModel<?> model)
056        {
057                super(id, model);
058        }
059
060        /**
061         * Creates an audio component
062         *
063         * @param id
064         *            the component id
065         * @param resourceReference
066         *            the resource reference of the audio file
067         */
068        public Audio(String id, ResourceReference resourceReference)
069        {
070                super(id, resourceReference);
071        }
072
073        /**
074         * Creates an audio component
075         *
076         * @param id
077         *            the component id
078         * @param model
079         *            the internally used model
080         * @param resourceReference
081         *            the resource reference of the audio file
082         */
083        public Audio(String id, IModel<?> model, ResourceReference resourceReference)
084        {
085                super(id, model, resourceReference);
086        }
087
088        /**
089         * Creates an audio component
090         *
091         * @param id
092         *            the component id
093         * @param resourceReference
094         *            the resource reference of the audio file
095         * @param pageParameters
096         *            the page parameters to be used to be prepended to the audio URL
097         */
098        public Audio(String id, ResourceReference resourceReference,
099                PageParameters pageParameters)
100        {
101                super(id, resourceReference, pageParameters);
102        }
103
104        /**
105         * Creates an audio component
106         *
107         * @param id
108         *            the component id
109         * @param model
110         *            the internally used model
111         * @param resourceReference
112         *            the resource reference of the audio file
113         * @param pageParameters
114         *            the page parameters to be used to be prepended to the audio URL
115         */
116        public Audio(String id, IModel<?> model, ResourceReference resourceReference,
117                PageParameters pageParameters)
118        {
119                super(id, model, resourceReference, pageParameters);
120        }
121
122        /**
123         * Creates an audio component
124         *
125         * @param id
126         *            the component id
127         * @param url
128         *            an external URL to be used for the audio component
129         */
130        public Audio(String id, String url)
131        {
132                super(id, url);
133        }
134
135        /**
136         * Creates an audio component
137         *
138         * @param id
139         *            the component id
140         * @param model
141         *            the internally used model
142         * @param url
143         *            an external URL to be used for the audio component
144         */
145        public Audio(String id, IModel<?> model, String url)
146        {
147                super(id, model, url);
148        }
149
150        /**
151         * Creates an audio component
152         *
153         * @param id
154         *            the component id
155         * @param url
156         *            an external URL to be used for the audio component
157         * @param pageParameters
158         *            the page parameters to be used to be prepended to the audio URL
159         */
160        public Audio(String id, String url, PageParameters pageParameters)
161        {
162                super(id, null, url, pageParameters);
163        }
164
165        /**
166         * Creates an audio component
167         *
168         * @param id
169         *            the component id
170         * @param model
171         *            the internally used model
172         * @param url
173         *            an external URL to be used for the audio component
174         * @param pageParameters
175         *            the page parameters to be used to be prepended to the audio URL
176         */
177        public Audio(String id, IModel<?> model, String url, PageParameters pageParameters)
178        {
179                super(id, model, url, pageParameters);
180        }
181
182        @Override
183        protected void onComponentTag(ComponentTag tag)
184        {
185                checkComponentTag(tag, "audio");
186                super.onComponentTag(tag);
187        }
188}