Example usage for com.google.gwt.media.dom.client MediaError getCode

List of usage examples for com.google.gwt.media.dom.client MediaError getCode

Introduction

In this page you can find the example usage for com.google.gwt.media.dom.client MediaError getCode.

Prototype

public native int getCode() ;

Source Link

Document

Returns an error code indicating the reason for the error.

Usage

From source file:com.ait.lienzo.client.core.shape.Movie.java

License:Open Source License

private final void init() {
    if (null != m_video) {
        MediaError status = m_video.getError();

        if (status != null) {
            setErrorCode(status.getCode());
        } else {/*from  ww w.  j ava 2  s .com*/
            if (isShowPoster()) {
                final String url = m_video.getPoster();

                if (null != url) {
                    new ImageLoader(url) {
                        @Override
                        public void onLoad(ImageElement image) {
                            m_postr = image;
                        }

                        @Override
                        public void onError(String message) {
                            LienzoCore.get().log("ERROR: Getting video poster url[" + url + "] " + message);
                        }
                    };
                }
            }
        }
    } else {
        m_error = MessageConstants.MESSAGES.movieNotSupportedInThisBrowser();
    }
    m_inits = false;
}

From source file:com.emitrom.lienzo.client.core.shape.Movie.java

License:Open Source License

private final void init() {
    if (null != m_video) {
        MediaError status = m_video.getError();

        if (status != null) {
            switch (status.getCode()) {
            case MediaError.MEDIA_ERR_ABORTED:
                m_error = MessageConstants.MESSAGES.moviePlaybackWasAborted();
                break;
            case MediaError.MEDIA_ERR_NETWORK:
                m_error = MessageConstants.MESSAGES.movieNetworkError();
                break;
            case MediaError.MEDIA_ERR_DECODE:
                m_error = MessageConstants.MESSAGES.movieErrorInDecoding();
                break;
            case MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:
                m_error = MessageConstants.MESSAGES.movieFormatNotSupported();
                break;
            }/*from   w  w  w .jav  a2 s .  com*/
        }
    } else {
        m_error = MessageConstants.MESSAGES.movieNotSupportedInThisBrowser();
    }
    m_inits = true;
}