本文整理了Java中com.google.gwt.media.client.Video
类的一些代码示例,展示了Video
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Video
类的具体详情如下:
包路径:com.google.gwt.media.client.Video
类名称:Video
[英]A widget representing a <video> element.
Experimental API: This API is still under development and is subject to change.
This widget may not be supported on all browsers.
[中]表示<video>元素的小部件。
实验API:该API仍在开发中,可能会发生变化。
并非所有浏览器都支持此小部件。
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Returns a poster URL.
*
* @return a URL containing a poster image
*
* @see #setPoster(String)
*/
public String getPoster() {
return getVideoElement().getPoster();
}
代码示例来源:origin: com.rht-emitrom/lienzo-core
/**
* Pauses this movie.
*
* @return this Movie
*/
public Movie pause()
{
m_pause = true;
if (null != m_video)
{
m_video.pause();
}
return this;
}
代码示例来源:origin: com.rht-emitrom/lienzo-core
/**
* Plays the video.
*
* @return this Movie
*/
public Movie play()
{
m_pause = false;
if (null != m_video)
{
m_video.play();
}
return this;
}
代码示例来源:origin: org.dashbuilder/dashbuilder-lienzo-core
setErrorHandler(this, m_video.getVideoElement());
m_video.setSrc(url);
m_video.setLoop(isLoop());
m_video.setVisible(false);
m_video.setPlaybackRate(getPlaybackRate());
m_video.setPreload(MediaElement.PRELOAD_AUTO);
m_video.setVolume(getVolume());
代码示例来源:origin: com.rht-emitrom/lienzo-core
/**
* Constructor. Creates an instance of a movie.
*
* @param url
*/
public Movie(String url)
{
super(ShapeType.MOVIE);
getAttributes().setURL(url);
if (null != m_video)
{
m_video.setSrc(getURL());
m_video.setLoop(false);
m_video.setVisible(false);
m_video.setPreload(MediaElement.PRELOAD_AUTO);
}
}
代码示例来源:origin: com.ahome-it/lienzo-core
private final void setSizes()
{
if (null != m_video)
{
final int wide = getWidth();
final int high = getHeight();
m_video.setWidth(wide + "px");
m_video.setHeight(high + "px");
m_canvas.setPixelSize(wide, high);
}
}
代码示例来源:origin: com.ahome-it/lienzo-core
@Override
public IAnimation doStart()
{
RootPanel.get().add(m_video);
m_video.play();
if (null == m_watch)
{
m_watch = m_video.addEndedHandler(new EndedHandler()
{
@Override
public void onEnded(final EndedEvent event)
{
if (false == m_movie.isLoop())
{
m_movie.setEnded(true);
}
}
});
}
return draw();
}
代码示例来源:origin: org.dashbuilder/dashbuilder-lienzo-core
MediaError status = m_video.getError();
final String url = m_video.getPoster();
代码示例来源:origin: com.rht-emitrom/lienzo-core
m_video.setWidth(wide + "px");
m_video.setHeight(high + "px");
m_video.setLoop(isLoop());
m_video.addCanPlayThroughHandler(new CanPlayThroughHandler()
代码示例来源:origin: ahome-it/lienzo-core
/**
* Sets the movie's volume
*
* @param volume
* @return this Movie
*/
public Movie setVolume(final double volume)
{
getAttributes().setVolume(volume);
if (null != m_video)
{
m_video.setVolume(getVolume());
}
return this;
}
代码示例来源:origin: org.dashbuilder/dashbuilder-lienzo-core
/**
* Sets the movie to continuously loop or not.
*
* @param loop
* @return this Movie
*/
public Movie setLoop(boolean loop)
{
getAttributes().setLoop(loop);
if (null != m_video)
{
m_video.setLoop(loop);
}
return this;
}
代码示例来源:origin: com.rht-emitrom/lienzo-core
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;
}
}
}
else
{
m_error = MessageConstants.MESSAGES.movieNotSupportedInThisBrowser();
}
m_inits = true;
}
代码示例来源:origin: com.ahome-it/lienzo-core
setErrorHandler(this, m_video.getVideoElement());
m_video.setSrc(url);
m_video.setLoop(isLoop());
m_video.setVisible(false);
m_video.setPlaybackRate(getPlaybackRate());
m_video.setPreload(MediaElement.PRELOAD_AUTO);
m_video.setVolume(getVolume());
代码示例来源:origin: ahome-it/lienzo-core
private final void setSizes()
{
if (null != m_video)
{
final int wide = getWidth();
final int high = getHeight();
m_video.setWidth(wide + "px");
m_video.setHeight(high + "px");
m_canvas.setPixelSize(wide, high);
}
}
代码示例来源:origin: org.dashbuilder/dashbuilder-lienzo-core
@Override
public IAnimation doStart()
{
RootPanel.get().add(m_video);
m_video.play();
if (null == m_watch)
{
m_watch = m_video.addEndedHandler(new EndedHandler()
{
@Override
public void onEnded(EndedEvent event)
{
if (false == m_movie.isLoop())
{
m_movie.setEnded(true);
}
}
});
}
return draw();
}
代码示例来源:origin: com.ahome-it/lienzo-core
final MediaError status = m_video.getError();
final String url = m_video.getPoster();
代码示例来源:origin: ahome-it/lienzo-core
/**
* Sets the movie's volume
*
* @param volume
* @return this Movie
*/
public Movie setVolume(final double volume)
{
getAttributes().setVolume(volume);
if (null != m_video)
{
m_video.setVolume(getVolume());
}
return this;
}
代码示例来源:origin: com.ahome-it/lienzo-core
/**
* Sets the movie to continuously loop or not.
*
* @param loop
* @return this Movie
*/
public Movie setLoop(final boolean loop)
{
getAttributes().setLoop(loop);
if (null != m_video)
{
m_video.setLoop(loop);
}
return this;
}
代码示例来源:origin: ahome-it/lienzo-core
setErrorHandler(this, m_video.getVideoElement());
m_video.setSrc(url);
m_video.setLoop(isLoop());
m_video.setVisible(false);
m_video.setPlaybackRate(getPlaybackRate());
m_video.setPreload(MediaElement.PRELOAD_AUTO);
m_video.setVolume(getVolume());
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Gets the intrinsic height of video within the element.
*
* To get the element height, use {@link VideoElement#getOffsetHeight()}
*
* @return the height, in pixels
*/
public int getVideoHeight() {
return getVideoElement().getVideoHeight();
}
内容来源于网络,如有侵权,请联系作者删除!