• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Video类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.google.gwt.media.client.Video的典型用法代码示例。如果您正苦于以下问题:Java Video类的具体用法?Java Video怎么用?Java Video使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Video类属于com.google.gwt.media.client包,在下文中一共展示了Video类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: WebcamWidget

import com.google.gwt.media.client.Video; //导入依赖的package包/类
public WebcamWidget() {
    setElement(DOM.createDiv());
    setStyleName("webcam");

    video = Video.createIfSupported();
    if (video != null) {
        getElement().appendChild(video.getElement());
        video.setWidth("100%");
        video.setHeight("100%");
        video.setAutoplay(true);
        requestWebCam();
    } else {
        com.google.gwt.dom.client.Element errorDiv = DOM.createDiv();
        errorDiv.setInnerText("Video not supported.");
        getElement().appendChild(errorDiv);
    }
}
 
开发者ID:tehapo,项目名称:webcam,代码行数:18,代码来源:WebcamWidget.java


示例2: supportsFullScreen

import com.google.gwt.media.client.Video; //导入依赖的package包/类
/**
 * sprawdza czy dany element mozna wyswietlic w trybie pelnoekranowym
 *
 * @param video
 * @return true jezeli mozna false w przeciwnym razie
 */
public native boolean supportsFullScreen(Video video)/*-{
    try {
        return !!video.getElement().webkitSupportsFullscreen;
    } catch (e) {
    }
}-*/;
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:13,代码来源:NativeHTML5FullScreenHelper.java


示例3: VideoUnitWidget

import com.google.gwt.media.client.Video; //导入依赖的package包/类
public VideoUnitWidget(VideoUnit unit) {

		super();
		
		timeBadge = new MaterialBadge();
		timeBadge.addStyleName(res.style().badge());
		getTitlePanel().insert(timeBadge, 0);

		MaterialColumn videoColumn = new MaterialColumn();
		videoColumn.setGrid("s12");
		videoColumn.setTextAlign(TextAlign.CENTER);
			video = Video.createIfSupported();
			if (video == null) {
				MaterialLabel message = new MaterialLabel("This browser does not support video playback.");
				message.addStyleName("flow-text");
				videoColumn.add(message);
			} else {
				video.addStyleName("responsive-video");
				video.setAutoplay(false);
				video.setControls(true);
				video.setLoop(false);
				video.setMuted(false);
				videoColumn.add(video);
			}
		getContentRow().add(videoColumn);
	
		if (unit != null)
			setUnit(unit);
		
	}
 
开发者ID:vsite-hr,项目名称:mentor,代码行数:31,代码来源:VideoUnitWidget.java


示例4: MP4ErrorHandler

import com.google.gwt.media.client.Video; //导入依赖的package包/类
public MP4ErrorHandler(Video video) {
    this.video = video;
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:4,代码来源:HTML5VideoAndroidImpl.java


示例5: createMediaWrapper

import com.google.gwt.media.client.Video; //导入依赖的package包/类
@Override
protected void createMediaWrapper(PlayerEvent event) {
    if (event.getValue() instanceof BaseMediaConfiguration) {
        BaseMediaConfiguration bmc = (BaseMediaConfiguration) event.getValue();
        Media defaultMedia = null;
        Media fullScreenMedia = null;
        boolean geckoSupport = isGeckoSupport(bmc);

        if (bmc.getMediaType() == MediaType.VIDEO && externalFullscreenVideoAvailability.isAvailable()) {
            defaultMedia = externalFullscreenVideoProvider.get();
        } else if (bmc.getMediaType() == MediaType.VIDEO && Video.isSupported() && geckoSupport) {
            defaultMedia = GWT.create(eu.ydp.empiria.player.client.module.object.impl.Video.class);
            if (bmc.isFullScreenTemplate()) {
                fullScreenMedia = GWT.create(eu.ydp.empiria.player.client.module.object.impl.Video.class);
            }
        } else if (Audio.isSupported() && geckoSupport) {
            defaultMedia = html5AudioProvider.get();
        }

        MediaExecutor<Widget> executor;
        MediaExecutor<Widget> fullScreenExecutor = null;

        if (bmc.getMediaType() == MediaType.VIDEO && externalFullscreenVideoAvailability.isAvailable()) {
            executor = fullscreenVideoExecutorProvider.get();
        } else if (!UserAgentChecker.isLocal() && defaultMedia == null) {
            if (bmc.isTemplate() || bmc.isFeedback()) {
                if (bmc.getMediaType() == MediaType.VIDEO) {
                    executor = createSWFVideoMediaExecutor();
                    if (bmc.isFullScreenTemplate()) {
                        fullScreenExecutor = createSWFVideoMediaExecutor();
                    }
                } else {
                    executor = createSWFSoundMediaExecutor();
                }
            } else {
                executor = createOldSwfMediaExecutor();
            }
        } else if (defaultMedia == null && UserAgentChecker.isLocal()) {
            executor = createSwfExecutor(bmc);
        } else {
            executor = createHTML5MediaExecutor(defaultMedia, bmc.getMediaType());
            fullScreenExecutor = createHTML5MediaExecutor(fullScreenMedia, bmc.getMediaType());
        }

        initExecutor(executor, bmc);
        initExecutor(fullScreenExecutor, bmc);
        fireCallback(event, executor, fullScreenExecutor);
    }
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:50,代码来源:DefaultMediaProcessorExtension.java


示例6: onModuleLoad

import com.google.gwt.media.client.Video; //导入依赖的package包/类
@Override
public void onModuleLoad()
{
	video = Video.createIfSupported();
	video.addStyleName("vidEl");
	RootPanel.get().add(video);

	Image img = new Image("../images/loading.gif");
	status = new SimplePanel(img);
	status.getElement().setId("status");
	status.addStyleName("loading");
	RootPanel.get().add(status);

	RootPanel.get().add(new HTML("TEST"));

	String appId = "ce2ad55e-2181-44bb-b5e7-9e65e0510d86";
	ArrayList<String> protocol = new ArrayList<String>(1);
	protocol.add(RemoteMedia.NAMESPACE());

	receiver = Receiver.create(appId, protocol,
			JavaScriptObject.createObject(), 5);
	remoteMedia = RemoteMedia.create();

	remoteMedia.addChannelFactory(receiver.createChannelFactory(RemoteMedia
			.NAMESPACE()));

	receiver.start();
	remoteMedia.setMediaElement(video.getElement());

	new Timer()
	{

		@Override
		public void run()
		{

			JavaScriptObject remoteMediaStatus = remoteMedia.getStatus();
			int st = JavaScriptObjectHelper.getAttributeAsInt(remoteMediaStatus,
					"state");
			int currentTime = 0;

			try
			{
				currentTime = JavaScriptObjectHelper.getAttributeAsInt(
						remoteMediaStatus, "current_time");
			}
			catch (Exception E)
			{

			}

			if (st == 0 || currentTime == 0)
			{
				status.getElement().getStyle().setDisplay(Display.BLOCK);
			}
			else
			{
				if (st == 1 && currentTime > 0)
				{
					status.getElement().setInnerHTML("Paused...");
					status.getElement().getStyle().setDisplay(Display.BLOCK);
				}
				else
				{
					status.getElement().setInnerHTML(currentTime + "");
					status.getElement().getStyle().setDisplay(Display.NONE);
					video.getElement().getStyle().setDisplay(Display.BLOCK);
				}
			}

		}
	}.scheduleRepeating(1000);

}
 
开发者ID:imarvelapps,项目名称:GWTChromeCast,代码行数:75,代码来源:GWTChromeCast.java


示例7: createVideo

import com.google.gwt.media.client.Video; //导入依赖的package包/类
private Widget createVideo(String auxVid, long w, long h) {
	
	final Video video = Video.createIfSupported();
	if (video == null) {
		return null;
	}
	
	video.load();
	
	video.addSource(auxVid);
	
	
	
	if (w >= h) {
		// TODO with this we use all width of the screen
		getElement().getStyle().setProperty("width", __width_max_poppanel);
		
		// TODO with this we set image, video, etc to width of its father (popupanel)
		video.getElement().getStyle().setProperty("width", "100%");
	}else if(w < h){
		
		double scaleFactor = getScaleFactor(w, h);
		
		final int width = (int) (w * scaleFactor);
		final int height = (int) (h * scaleFactor*0.90);
		video.setPixelSize(width, height);
		
		getElement().getStyle().setWidth(width, Unit.PX);
		
		video.getElement().getStyle().setProperty("width", "100%");
	}
	
	video.setControls(true);		
	video.setAutoplay(true);
	

	return video;
}
 
开发者ID:WELTEN,项目名称:dojo-ibl,代码行数:39,代码来源:SlideShow.java



注:本文中的com.google.gwt.media.client.Video类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java GvrView类代码示例发布时间:2022-05-23
下一篇:
Java MovementReason类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap