All Downloads are FREE. Search and download functionalities are using the official Maven repository.

js.web.dom.TextTrack Maven / Gradle / Ivy

package js.web.dom;

import js.extras.JsEnum;
import js.lang.Unknown;
import js.web.mse.SourceBuffer;
import org.teavm.jso.JSBody;
import org.teavm.jso.JSProperty;

import javax.annotation.Nullable;

/**
 * This interface also inherits properties from EventTarget.
 */
public interface TextTrack extends EventTarget {
    @JSBody(script = "return TextTrack.prototype")
    static TextTrack prototype() {
        throw new UnsupportedOperationException("Available only in JavaScript");
    }

    @JSBody(script = "return new TextTrack()")
    static TextTrack create() {
        throw new UnsupportedOperationException("Available only in JavaScript");
    }

    @JSProperty
    TextTrackCueList getActiveCues();

    @JSProperty
    TextTrackCueList getCues();

    @JSProperty
    String getInBandMetadataTrackDispatchType();

    @JSProperty
    String getKind();

    @JSProperty
    String getLabel();

    @JSProperty
    String getLanguage();

    @JSProperty
    Unknown getMode();

    @JSProperty
    void setMode(TextTrackMode mode);

    @JSProperty
    void setMode(int mode);

    @JSProperty
    @Nullable
    EventListener getOncuechange();

    @JSProperty
    void setOncuechange(EventListener oncuechange);

    default void addCueChangeEventListener(EventListener listener, AddEventListenerOptions options) {
        addEventListener("cuechange", listener, options);
    }

    default void addCueChangeEventListener(EventListener listener, boolean options) {
        addEventListener("cuechange", listener, options);
    }

    default void addCueChangeEventListener(EventListener listener) {
        addEventListener("cuechange", listener);
    }

    default void removeCueChangeEventListener(EventListener listener, EventListenerOptions options) {
        removeEventListener("cuechange", listener, options);
    }

    default void removeCueChangeEventListener(EventListener listener, boolean options) {
        removeEventListener("cuechange", listener, options);
    }

    default void removeCueChangeEventListener(EventListener listener) {
        removeEventListener("cuechange", listener);
    }

    @JSProperty
    @Nullable
    EventListener getOnerror();

    @JSProperty
    void setOnerror(EventListener onerror);

    default void addErrorEventListener(EventListener listener, AddEventListenerOptions options) {
        addEventListener("error", listener, options);
    }

    default void addErrorEventListener(EventListener listener, boolean options) {
        addEventListener("error", listener, options);
    }

    default void addErrorEventListener(EventListener listener) {
        addEventListener("error", listener);
    }

    default void removeErrorEventListener(EventListener listener, EventListenerOptions options) {
        removeEventListener("error", listener, options);
    }

    default void removeErrorEventListener(EventListener listener, boolean options) {
        removeEventListener("error", listener, options);
    }

    default void removeErrorEventListener(EventListener listener) {
        removeEventListener("error", listener);
    }

    @JSProperty
    @Nullable
    EventListener getOnload();

    @JSProperty
    void setOnload(EventListener onload);

    default void addLoadEventListener(EventListener listener, AddEventListenerOptions options) {
        addEventListener("load", listener, options);
    }

    default void addLoadEventListener(EventListener listener, boolean options) {
        addEventListener("load", listener, options);
    }

    default void addLoadEventListener(EventListener listener) {
        addEventListener("load", listener);
    }

    default void removeLoadEventListener(EventListener listener, EventListenerOptions options) {
        removeEventListener("load", listener, options);
    }

    default void removeLoadEventListener(EventListener listener, boolean options) {
        removeEventListener("load", listener, options);
    }

    default void removeLoadEventListener(EventListener listener) {
        removeEventListener("load", listener);
    }

    @JSProperty
    ReadyState getReadyState();

    @JSProperty
    @Nullable
    SourceBuffer getSourceBuffer();

    void addCue(TextTrackCue cue);

    void removeCue(TextTrackCue cue);

    abstract class ReadyState extends JsEnum {
        public static final ReadyState DISABLED = JsEnum.from("TextTrack.DISABLED");


        public static final ReadyState ERROR = JsEnum.from("TextTrack.ERROR");


        public static final ReadyState HIDDEN = JsEnum.from("TextTrack.HIDDEN");


        public static final ReadyState LOADED = JsEnum.from("TextTrack.LOADED");


        public static final ReadyState LOADING = JsEnum.from("TextTrack.LOADING");


        public static final ReadyState NONE = JsEnum.from("TextTrack.NONE");


        public static final ReadyState SHOWING = JsEnum.from("TextTrack.SHOWING");
    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy