1 /*
2 * Licensed to The Apereo Foundation under one or more contributor license
3 * agreements. See the NOTICE file distributed with this work for additional
4 * information regarding copyright ownership.
5 *
6 *
7 * The Apereo Foundation licenses this file to you under the Educational
8 * Community License, Version 2.0 (the "License"); you may not use this file
9 * except in compliance with the License. You may obtain a copy of the License
10 * at:
11 *
12 * http://opensource.org/licenses/ecl2.txt
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
17 * License for the specific language governing permissions and limitations under
18 * the License.
19 *
20 */
21
22 package org.opencastproject.smil.entity.media.element.api;
23
24 import org.opencastproject.smil.api.SmilException;
25 import org.opencastproject.smil.entity.media.api.SmilMediaObject;
26 import org.opencastproject.smil.entity.media.param.api.SmilMediaParam;
27
28 import java.net.URI;
29 import java.util.List;
30
31 /**
32 * Represent a media element like {@code audio}, {@code video},...
33 */
34 public interface SmilMediaElement extends SmilMediaObject {
35
36 /**
37 * SMIL media element type.
38 */
39 enum MediaType {
40 AUDIO, VIDEO, IMAGE, REF
41 }
42
43 /**
44 * Returns clip start position.
45 *
46 * @return the clipBegin
47 */
48 String getClipBegin();
49
50 /**
51 * Returns clip end position.
52 *
53 * @return the clipEnd
54 */
55 String getClipEnd();
56
57 /**
58 * Returns media element type.
59 *
60 * @return this media element type
61 */
62 MediaType getMediaType();
63
64 /**
65 * Returns SmilMediaParamGroup Id given with this element.
66 *
67 * @return the paramGroup Id
68 */
69 String getParamGroup();
70
71 /**
72 * Returns {@link SmilMediaParam}s for this media element. The {@link List} is
73 * immutable, use SmilService to modify it.
74 *
75 * @return the {@link List} with {@link SmilMediaParam}s
76 */
77 List<SmilMediaParam> getParams();
78
79 /**
80 * Returns media source URI.
81 *
82 * @return the media src URI
83 */
84 URI getSrc();
85
86 /**
87 * Returns clip start position in milliseconds.
88 *
89 * @throws SmilException if clip begin position can't parsed.
90 * @return clip start position in milliseconds
91 */
92 long getClipBeginMS() throws SmilException;
93
94 /**
95 * Returns clip end position in milliseconds.
96 *
97 * @throws SmilException if clip end position can't parsed.
98 * @return clip end position in milliseconds
99 */
100 long getClipEndMS() throws SmilException;
101 }