将youtube视频作为全息图播放 [英] Play youtube video as a hololgram

查看:56
本文介绍了将youtube视频作为全息图播放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以在Hololens应用程序中打开窗口并播放youtube视频吗?

Is there any way to open a window and playing a youtube video inside my hololens app?

我确实搜索过有关打开youtube视频页面的信息,但是它将在我的外部打开,我希望播放器位于我的应用程序之内.

I did search about opening youtube video page, but it will open outside of my, i want player to be inside of my app.

推荐答案

对于HoloLens 1,Hernando在评论中提供的建议是很好的.

For HoloLens 1, the suggestions provided by Hernando in the comments are good.

我还想分享一下,只需启动URI,就可以在HoloLens 2和Windows Mixed Reality上执行此操作.这将直接在您的统一应用程序中启动一个平面应用程序窗口.例如,查看启动外部应用程序拉取请求" ,它显示了HandInteractionExamples场景中的行为(在MRTK RC2版本或最新的mrtk_development分支中可用).

I wanted to also share that it is possible to do this on HoloLens 2 and Windows Mixed Reality simply by launching a URI. This will launch a flat application window directly in your unity app. For example, have a look at "the Launch External Apps pull request" which shows the behavior in the HandInteractionExamples scene (available in MRTK RC2 release, or latest mrtk_development branch).

在您的应用程序中启动外部URI的代码如下:

The code to launch an external URI within your app is as follows:

#if WINDOWS_UWP
            UnityEngine.WSA.Application.InvokeOnUIThread(async () =>
            {
                bool result = await global::Windows.System.Launcher.LaunchUriAsync(new System.Uri("https://youtu.be/SB-qEYVdvXA"));
            }, false);
#else
            Application.OpenURL("https://youtu.be/SB-qEYVdvXA");
#endif

此代码摘自

This code was taken from LaunchUri.cs, modified to just launch a YouTube video.

这篇关于将youtube视频作为全息图播放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆