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

js.web.mse.MediaSource Maven / Gradle / Ivy

package js.web.mse;

import js.web.dom.*;
import js.web.mediastreams.EndOfStreamError;
import js.web.mediastreams.ReadyState;
import org.teavm.jso.JSBody;
import org.teavm.jso.JSProperty;

import javax.annotation.Nullable;

/**
 * This Media Source Extensions API interface represents a source of media data for an HTMLMediaElement object. A MediaSource object can be attached to a HTMLMediaElement to be played in the user agent.
 */
public interface MediaSource extends EventTarget {
    @JSBody(script = "return MediaSource.prototype")
    static MediaSource prototype() {
        throw new UnsupportedOperationException("Available only in JavaScript");
    }

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

    @JSBody(params = "type", script = "return MediaSource.isTypeSupported(type)")
    static boolean isTypeSupported(String type) {
        throw new UnsupportedOperationException("Available only in JavaScript");
    }

    @JSProperty
    SourceBufferList getActiveSourceBuffers();

    @JSProperty
    double getDuration();

    @JSProperty
    void setDuration(double duration);

    @JSProperty
    @Nullable
    EventListener getOnsourceclose();

    @JSProperty
    void setOnsourceclose(EventListener onsourceclose);

    default void addSourceCloseEventListener(EventListener listener, AddEventListenerOptions options) {
        addEventListener("sourceclose", listener, options);
    }

    default void addSourceCloseEventListener(EventListener listener, boolean options) {
        addEventListener("sourceclose", listener, options);
    }

    default void addSourceCloseEventListener(EventListener listener) {
        addEventListener("sourceclose", listener);
    }

    default void removeSourceCloseEventListener(EventListener listener, EventListenerOptions options) {
        removeEventListener("sourceclose", listener, options);
    }

    default void removeSourceCloseEventListener(EventListener listener, boolean options) {
        removeEventListener("sourceclose", listener, options);
    }

    default void removeSourceCloseEventListener(EventListener listener) {
        removeEventListener("sourceclose", listener);
    }

    @JSProperty
    @Nullable
    EventListener getOnonsourceended();

    @JSProperty
    void setOnonsourceended(EventListener ononsourceended);

    default void addOnsourceEndedEventListener(EventListener listener, AddEventListenerOptions options) {
        addEventListener("onsourceended", listener, options);
    }

    default void addOnsourceEndedEventListener(EventListener listener, boolean options) {
        addEventListener("onsourceended", listener, options);
    }

    default void addOnsourceEndedEventListener(EventListener listener) {
        addEventListener("onsourceended", listener);
    }

    default void removeOnsourceEndedEventListener(EventListener listener, EventListenerOptions options) {
        removeEventListener("onsourceended", listener, options);
    }

    default void removeOnsourceEndedEventListener(EventListener listener, boolean options) {
        removeEventListener("onsourceended", listener, options);
    }

    default void removeOnsourceEndedEventListener(EventListener listener) {
        removeEventListener("onsourceended", listener);
    }

    @JSProperty
    @Nullable
    EventListener getOnonsourceopen();

    @JSProperty
    void setOnonsourceopen(EventListener ononsourceopen);

    default void addOnsourceOpenEventListener(EventListener listener, AddEventListenerOptions options) {
        addEventListener("onsourceopen", listener, options);
    }

    default void addOnsourceOpenEventListener(EventListener listener, boolean options) {
        addEventListener("onsourceopen", listener, options);
    }

    default void addOnsourceOpenEventListener(EventListener listener) {
        addEventListener("onsourceopen", listener);
    }

    default void removeOnsourceOpenEventListener(EventListener listener, EventListenerOptions options) {
        removeEventListener("onsourceopen", listener, options);
    }

    default void removeOnsourceOpenEventListener(EventListener listener, boolean options) {
        removeEventListener("onsourceopen", listener, options);
    }

    default void removeOnsourceOpenEventListener(EventListener listener) {
        removeEventListener("onsourceopen", listener);
    }

    @JSProperty
    ReadyState getReadyState();

    @JSProperty
    SourceBufferList getSourceBuffers();

    SourceBuffer addSourceBuffer(String type);

    void clearLiveSeekableRange();

    void endOfStream(EndOfStreamError error);

    void endOfStream();

    void removeSourceBuffer(SourceBuffer sourceBuffer);

    void setLiveSeekableRange(double start, double end);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy