From 0206ea4e0a03ff82ea6848225622826c52df7c06 Mon Sep 17 00:00:00 2001 From: Junji Takakura Date: Wed, 21 Jan 2015 09:48:45 +0900 Subject: [PATCH] Adds implementation of HTMLMediaElement, HTMLVideoElement, HTMLAudioElement and HTMLSourceElement --- .../org/teavm/dom/html/HTMLAudioElement.java | 24 +++ .../org/teavm/dom/html/HTMLMediaElement.java | 180 ++++++++++++++++++ .../org/teavm/dom/html/HTMLSourceElement.java | 44 +++++ .../org/teavm/dom/html/HTMLVideoElement.java | 52 +++++ .../java/org/teavm/dom/media/AudioTrack.java | 43 +++++ .../org/teavm/dom/media/AudioTrackList.java | 31 +++ .../org/teavm/dom/media/MediaController.java | 83 ++++++++ .../java/org/teavm/dom/media/MediaError.java | 34 ++++ .../java/org/teavm/dom/media/TextTrack.java | 63 ++++++ .../org/teavm/dom/media/TextTrackCue.java | 44 +++++ .../org/teavm/dom/media/TextTrackCueList.java | 33 ++++ .../org/teavm/dom/media/TextTrackList.java | 33 ++++ .../java/org/teavm/dom/media/TimeRanges.java | 33 ++++ .../java/org/teavm/dom/media/VideoTrack.java | 43 +++++ .../org/teavm/dom/media/VideoTrackList.java | 36 ++++ 15 files changed, 776 insertions(+) create mode 100644 teavm-dom/src/main/java/org/teavm/dom/html/HTMLAudioElement.java create mode 100644 teavm-dom/src/main/java/org/teavm/dom/html/HTMLMediaElement.java create mode 100644 teavm-dom/src/main/java/org/teavm/dom/html/HTMLSourceElement.java create mode 100644 teavm-dom/src/main/java/org/teavm/dom/html/HTMLVideoElement.java create mode 100644 teavm-dom/src/main/java/org/teavm/dom/media/AudioTrack.java create mode 100644 teavm-dom/src/main/java/org/teavm/dom/media/AudioTrackList.java create mode 100644 teavm-dom/src/main/java/org/teavm/dom/media/MediaController.java create mode 100644 teavm-dom/src/main/java/org/teavm/dom/media/MediaError.java create mode 100644 teavm-dom/src/main/java/org/teavm/dom/media/TextTrack.java create mode 100644 teavm-dom/src/main/java/org/teavm/dom/media/TextTrackCue.java create mode 100644 teavm-dom/src/main/java/org/teavm/dom/media/TextTrackCueList.java create mode 100644 teavm-dom/src/main/java/org/teavm/dom/media/TextTrackList.java create mode 100644 teavm-dom/src/main/java/org/teavm/dom/media/TimeRanges.java create mode 100644 teavm-dom/src/main/java/org/teavm/dom/media/VideoTrack.java create mode 100644 teavm-dom/src/main/java/org/teavm/dom/media/VideoTrackList.java diff --git a/teavm-dom/src/main/java/org/teavm/dom/html/HTMLAudioElement.java b/teavm-dom/src/main/java/org/teavm/dom/html/HTMLAudioElement.java new file mode 100644 index 000000000..d71e34209 --- /dev/null +++ b/teavm-dom/src/main/java/org/teavm/dom/html/HTMLAudioElement.java @@ -0,0 +1,24 @@ +/* + * Copyright 2015 Alexey Andreev. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.teavm.dom.html; + +/** + * + * @author Junji Takakura + */ +public interface HTMLAudioElement extends HTMLMediaElement { + +} diff --git a/teavm-dom/src/main/java/org/teavm/dom/html/HTMLMediaElement.java b/teavm-dom/src/main/java/org/teavm/dom/html/HTMLMediaElement.java new file mode 100644 index 000000000..e3df3e8d8 --- /dev/null +++ b/teavm-dom/src/main/java/org/teavm/dom/html/HTMLMediaElement.java @@ -0,0 +1,180 @@ +/* + * Copyright 2015 Alexey Andreev. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.teavm.dom.html; + +import org.teavm.dom.media.VideoTrackList; +import java.util.Date; +import org.teavm.dom.media.AudioTrackList; +import org.teavm.dom.media.MediaController; +import org.teavm.dom.media.MediaError; +import org.teavm.dom.media.TextTrack; +import org.teavm.dom.media.TextTrackList; +import org.teavm.dom.media.TimeRanges; +import org.teavm.jso.JSProperty; + +/** + * + * @author Junji Takakura + */ +public interface HTMLMediaElement extends HTMLElement { + + public static final int HAVE_NOTHING = 0; + public static final int HAVE_METADATA = 1; + public static final int HAVE_CURRENT_DATA = 2; + public static final int HAVE_FUTURE_DATA = 3; + public static final int HAVE_ENOUGH_DATA = 4; + + public static final int NETWORK_EMPTY = 0; + public static final int NETWORK_IDLE = 1; + public static final int NETWORK_LOADING = 2; + public static final int NETWORK_NO_SOURCE = 3; + + @JSProperty + MediaError getError(); + + @JSProperty + String getSrc(); + + @JSProperty + void setSrc(String src); + + @JSProperty + String getCurrentSrc(); + + @JSProperty + void setCurrentSrc(String currentSrc); + + @JSProperty + String getCrossOrigin(); + + @JSProperty + int getNetworkState(); + + @JSProperty + String getPreload(); + + @JSProperty + void setPreload(String preload); + + @JSProperty + TimeRanges getBuffered(); + + @JSProperty + int getReadyState(); + + @JSProperty + boolean isSeeking(); + + @JSProperty + double getCurrentTime(); + + @JSProperty + void setCurrentTime(double currentTime); + + @JSProperty + double getDuration(); + + @JSProperty + Date getStartOffsetTime(); + + @JSProperty + boolean getPaused(); + + @JSProperty + double getDefaultPlaybackRate(); + + @JSProperty + void setDefaultPlaybackRate(double defaultPlaybackRate); + + @JSProperty + double getPlaybackRate(); + + @JSProperty + void setPlaybackRate(double playbackRate); + + @JSProperty + TimeRanges getPlayed(); + + @JSProperty + TimeRanges getSeekable(); + + @JSProperty + boolean getEnded(); + + @JSProperty + boolean isAutoplay(); + + @JSProperty + void setAutoplay(boolean autoplay); + + boolean isLoop(); + + void setLoop(boolean loop); + + @JSProperty + String getMediaGroup(); + + @JSProperty + MediaController getController(); + + @JSProperty + void setController(MediaController controller); + + @JSProperty + boolean getControlls(); + + @JSProperty + void setControlls(boolean controlls); + + @JSProperty + float getVolume(); + + @JSProperty + void setVolume(float volume); + + @JSProperty + boolean isMuted(); + + @JSProperty + void setMuted(boolean muted); + + @JSProperty + boolean isDefaultMuted(); + + @JSProperty + void setDefaultMuted(boolean defaultMuted); + + AudioTrackList getAudioTracks(); + + VideoTrackList getVideoTracks(); + + TextTrackList getTextTracks(); + + TextTrack addTextTrack(String kind); + + TextTrack addTextTrack(String kind, String label); + + TextTrack addTextTrack(String kind, String label, String language); + + void play(); + + void pause(); + + void load(); + + String canPlayType(String type); + +} diff --git a/teavm-dom/src/main/java/org/teavm/dom/html/HTMLSourceElement.java b/teavm-dom/src/main/java/org/teavm/dom/html/HTMLSourceElement.java new file mode 100644 index 000000000..8009c8794 --- /dev/null +++ b/teavm-dom/src/main/java/org/teavm/dom/html/HTMLSourceElement.java @@ -0,0 +1,44 @@ +/* + * Copyright 2015 Alexey Andreev. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.teavm.dom.html; + +import org.teavm.jso.JSProperty; + +/** + * + * @author Junji Takakura + */ +public interface HTMLSourceElement extends HTMLElement { + + @JSProperty + String getType(); + + @JSProperty + void setType(String type); + + @JSProperty + String getSrc(); + + @JSProperty + void setSrc(String src); + + @JSProperty + String getMedia(); + + @JSProperty + void setMedia(String media); + +} diff --git a/teavm-dom/src/main/java/org/teavm/dom/html/HTMLVideoElement.java b/teavm-dom/src/main/java/org/teavm/dom/html/HTMLVideoElement.java new file mode 100644 index 000000000..94670612f --- /dev/null +++ b/teavm-dom/src/main/java/org/teavm/dom/html/HTMLVideoElement.java @@ -0,0 +1,52 @@ +/* + * Copyright 2015 Alexey Andreev. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.teavm.dom.html; + +import org.teavm.jso.JSProperty; + +/** + * + * @author Junji Takakura + */ +public interface HTMLVideoElement extends HTMLMediaElement { + + @JSProperty + int getWidth(); + + @JSProperty + void setWidth(int width); + + @JSProperty + int getHeight(); + + @JSProperty + void setHeight(int height); + + @JSProperty + int getVideoWidth(); + + @JSProperty + void setVideoWidth(int videoWidth); + + @JSProperty + int getVideoHeight(); + + @JSProperty + void setVideoHeight(int videoHeight); + + @JSProperty + String getPoster(); +} diff --git a/teavm-dom/src/main/java/org/teavm/dom/media/AudioTrack.java b/teavm-dom/src/main/java/org/teavm/dom/media/AudioTrack.java new file mode 100644 index 000000000..bab464715 --- /dev/null +++ b/teavm-dom/src/main/java/org/teavm/dom/media/AudioTrack.java @@ -0,0 +1,43 @@ +/* + * Copyright 2015 Alexey Andreev. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.teavm.dom.media; + +import org.teavm.jso.JSProperty; + +/** + * + * @author Junji Takakura + */ +public interface AudioTrack { + + @JSProperty + String getId(); + + @JSProperty + String getLabel(); + + @JSProperty + String getKind(); + + @JSProperty + String getLanguage(); + + @JSProperty + boolean isEnabled(); + + @JSProperty + void setEnabled(boolean enabled); +} diff --git a/teavm-dom/src/main/java/org/teavm/dom/media/AudioTrackList.java b/teavm-dom/src/main/java/org/teavm/dom/media/AudioTrackList.java new file mode 100644 index 000000000..054709595 --- /dev/null +++ b/teavm-dom/src/main/java/org/teavm/dom/media/AudioTrackList.java @@ -0,0 +1,31 @@ +/* + * Copyright 2015 Alexey Andreev. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.teavm.dom.media; + +import org.teavm.dom.events.EventTarget; +import org.teavm.jso.JSProperty; + +/** + * + * @author Junji Takakura + */ +public interface AudioTrackList extends EventTarget { + @JSProperty + int getLength(); + + AudioTrack item(int index); + AudioTrack getTrackById(String id); +} diff --git a/teavm-dom/src/main/java/org/teavm/dom/media/MediaController.java b/teavm-dom/src/main/java/org/teavm/dom/media/MediaController.java new file mode 100644 index 000000000..b1127d35a --- /dev/null +++ b/teavm-dom/src/main/java/org/teavm/dom/media/MediaController.java @@ -0,0 +1,83 @@ +/* + * Copyright 2015 Alexey Andreev. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.teavm.dom.media; + +import org.teavm.jso.JSObject; +import org.teavm.jso.JSProperty; + +/** + * + * @author Junji Takakura + */ +public interface MediaController extends JSObject { + + @JSProperty + TimeRanges getBuffered(); + + @JSProperty + double getCurrentTime(); + + @JSProperty + void setCurrentTime(double currentTime); + + @JSProperty + double getDefaultPlaybackRate(); + + @JSProperty + void setDefaultPlaybackRate(double defaultPlaybackRate); + + @JSProperty + double getDuration(); + + @JSProperty + boolean isMuted(); + + @JSProperty + void setMuted(boolean muted); + + @JSProperty + boolean isPaused(); + + @JSProperty + double getPlaybackRate(); + + @JSProperty + void setPlaybackRate(double playbackRate); + + @JSProperty + String getPlaybackState(); + + @JSProperty + TimeRanges getPlayed(); + + @JSProperty + int getReadyState(); + + @JSProperty + TimeRanges getSeekable(); + + @JSProperty + float getVolume(); + + @JSProperty + void setVolume(float volume); + + void play(); + + void pause(); + + void unpause(); +} diff --git a/teavm-dom/src/main/java/org/teavm/dom/media/MediaError.java b/teavm-dom/src/main/java/org/teavm/dom/media/MediaError.java new file mode 100644 index 000000000..704b4c707 --- /dev/null +++ b/teavm-dom/src/main/java/org/teavm/dom/media/MediaError.java @@ -0,0 +1,34 @@ +/* + * Copyright 2015 Alexey Andreev. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.teavm.dom.media; + +import org.teavm.jso.JSObject; +import org.teavm.jso.JSProperty; + +/** + * + * @author Junji Takakura + */ +public interface MediaError extends JSObject { + + public static final int MEDIA_ERR_ABORTED = 1; + public static final int MEDIA_ERR_NETWORK = 2; + public static final int MEDIA_ERR_DECODE = 3; + public static final int MEDIA_ERR_SRC_NOT_SUPPORTED = 4; + + @JSProperty + int getCode(); +} diff --git a/teavm-dom/src/main/java/org/teavm/dom/media/TextTrack.java b/teavm-dom/src/main/java/org/teavm/dom/media/TextTrack.java new file mode 100644 index 000000000..ddccc8fc8 --- /dev/null +++ b/teavm-dom/src/main/java/org/teavm/dom/media/TextTrack.java @@ -0,0 +1,63 @@ +/* + * Copyright 2015 Alexey Andreev. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.teavm.dom.media; + +import org.teavm.jso.JSProperty; + +/** + * + * @author Junji Takakura + */ +public interface TextTrack { + + public static final String DISABLED = "disabled"; + public static final String HIDDEN = "hidden"; + public static final String SHOWING = "showing"; + + @JSProperty + String getId(); + + @JSProperty + String getLabel(); + + @JSProperty + String getKind(); + + @JSProperty + String getLanguage(); + + @JSProperty + String getMode(); + + @JSProperty + void setMode(String mode); + + @JSProperty + boolean isEnabled(); + + @JSProperty + void setEnabled(boolean enabled); + + @JSProperty + TextTrackCueList getCues(); + + @JSProperty + TextTrackCueList getActiveCues(); + + void addCue(TextTrackCue cue); + + void removeCue(TextTrackCue cue); +} diff --git a/teavm-dom/src/main/java/org/teavm/dom/media/TextTrackCue.java b/teavm-dom/src/main/java/org/teavm/dom/media/TextTrackCue.java new file mode 100644 index 000000000..8bd4b05ab --- /dev/null +++ b/teavm-dom/src/main/java/org/teavm/dom/media/TextTrackCue.java @@ -0,0 +1,44 @@ +/* + * Copyright 2015 Alexey Andreev. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.teavm.dom.media; + +import org.teavm.dom.events.EventTarget; +import org.teavm.jso.JSProperty; + +/** + * + * @author Junji Takakura + */ +public interface TextTrackCue extends EventTarget { + + @JSProperty + String getId(); + + @JSProperty + double getStartTime(); + + @JSProperty + double getEndTime(); + + @JSProperty + boolean isPauseOnExit(); + + @JSProperty + String getText(); + + @JSProperty + TextTrack getTrack(); +} diff --git a/teavm-dom/src/main/java/org/teavm/dom/media/TextTrackCueList.java b/teavm-dom/src/main/java/org/teavm/dom/media/TextTrackCueList.java new file mode 100644 index 000000000..72e0b36b0 --- /dev/null +++ b/teavm-dom/src/main/java/org/teavm/dom/media/TextTrackCueList.java @@ -0,0 +1,33 @@ +/* + * Copyright 2015 Alexey Andreev. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.teavm.dom.media; + +import org.teavm.jso.JSObject; +import org.teavm.jso.JSProperty; + +/** + * + * @author Junji Takakura + */ +public interface TextTrackCueList extends JSObject { + + @JSProperty + int getLength(); + + TextTrackCue item(int index); + + TextTrackCue getTrackById(String id); +} diff --git a/teavm-dom/src/main/java/org/teavm/dom/media/TextTrackList.java b/teavm-dom/src/main/java/org/teavm/dom/media/TextTrackList.java new file mode 100644 index 000000000..f625e66f0 --- /dev/null +++ b/teavm-dom/src/main/java/org/teavm/dom/media/TextTrackList.java @@ -0,0 +1,33 @@ +/* + * Copyright 2015 Alexey Andreev. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.teavm.dom.media; + +import org.teavm.dom.events.EventTarget; +import org.teavm.jso.JSProperty; + +/** + * + * @author Junji Takakura + */ +public interface TextTrackList extends EventTarget { + + @JSProperty + int getLength(); + + TextTrack item(int index); + + TextTrack getTrackById(String id); +} diff --git a/teavm-dom/src/main/java/org/teavm/dom/media/TimeRanges.java b/teavm-dom/src/main/java/org/teavm/dom/media/TimeRanges.java new file mode 100644 index 000000000..c0dd0594d --- /dev/null +++ b/teavm-dom/src/main/java/org/teavm/dom/media/TimeRanges.java @@ -0,0 +1,33 @@ +/* + * Copyright 2015 Alexey Andreev. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.teavm.dom.media; + +import org.teavm.jso.JSObject; +import org.teavm.jso.JSProperty; + +/** + * + * @author Junji Takakura + */ +public interface TimeRanges extends JSObject { + + @JSProperty + int getLength(); + + float start(int index); + + float end(int index); +} diff --git a/teavm-dom/src/main/java/org/teavm/dom/media/VideoTrack.java b/teavm-dom/src/main/java/org/teavm/dom/media/VideoTrack.java new file mode 100644 index 000000000..199d26ffc --- /dev/null +++ b/teavm-dom/src/main/java/org/teavm/dom/media/VideoTrack.java @@ -0,0 +1,43 @@ +/* + * Copyright 2015 Alexey Andreev. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.teavm.dom.media; + +import org.teavm.jso.JSProperty; + +/** + * + * @author Junji Takakura + */ +public interface VideoTrack { + + @JSProperty + String getId(); + + @JSProperty + String getLabel(); + + @JSProperty + String getKind(); + + @JSProperty + String getLanguage(); + + @JSProperty + boolean isSelected(); + + @JSProperty + void setSelected(boolean selected); +} diff --git a/teavm-dom/src/main/java/org/teavm/dom/media/VideoTrackList.java b/teavm-dom/src/main/java/org/teavm/dom/media/VideoTrackList.java new file mode 100644 index 000000000..232712304 --- /dev/null +++ b/teavm-dom/src/main/java/org/teavm/dom/media/VideoTrackList.java @@ -0,0 +1,36 @@ +/* + * Copyright 2015 Alexey Andreev. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.teavm.dom.media; + +import org.teavm.dom.events.EventTarget; +import org.teavm.jso.JSProperty; + +/** + * + * @author Junji Takakura + */ +public interface VideoTrackList extends EventTarget { + + @JSProperty + int getLength(); + + @JSProperty + int getSelectedIndex(); + + VideoTrack item(int index); + + VideoTrack getTrackById(String id); +}