-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
launch browser example #5047
launch browser example #5047
Conversation
Could you please still include the LaunchUriAsync example as well (perhaps a button next to the webpage button that opens settings by launching ms-settings://)? That will teach people that you can actually launch any UWP as long as it implements a protocol. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, nice and simple. Thanks! Only request is that you please add an example to also still launch a Uri via LaunchUriAsync, see my comment above. I see that as teaching people they can launch any UWP, not just the browser. Otherwise people will think that they can only launch the browser and nothing else.
Could you also please include a screenshot of the new button you added to the scene as part of this PR, so we can find it and also visually review the code? Even better would be a gif of the new behavior, if you have time. For example, here's a really nice PR that demonstrates including screen shots and gifs: #4532. It's very useful to have that for any new user-facing features. |
Assets/MixedRealityToolkit.Examples/Demos/HandTracking/WebForm/SampleWebForm.htm
Outdated
Show resolved
Hide resolved
I'd be happy to capture a gif if there's an easy way to do that. Is there a tool that folks recommend for converting the .mp4 from a mixed reality capture into a gif? Would I need to make it super-short or downsample it so that the file size isn't too large for github? @Cameron-Micka, please let me know if you have any tips for doing this. |
@ForrestTrepte I've just been using the tool @jwittner recommends called LICEcap. GitHub only accepts files up to 10Mbs, so if I find I'm over that limit I resize and/or compress my gif from LICEcap with this online tool: https://ezgif.com/resize |
No actual changes. Just letting Unity make the changes that it wants to apply so that hopefully changes that I make later will be easier to understand.
5174c6d
to
f0129af
Compare
@julenka: Ready for re-review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Just one small nit.
Assets/MixedRealityToolkit.Examples/Demos/HandTracking/Script/LaunchUri.cs
Outdated
Show resolved
Hide resolved
/azp run mrtk_pr |
Azure Pipelines successfully started running 1 pipeline(s). |
…LaunchUri.cs Co-Authored-By: Julia Schwarz <julenka.schwarz@gmail.com>
/azp run mrtk_pr |
Azure Pipelines successfully started running 1 pipeline(s). |
How to locate the launched browser to the specified location? |
@csxbwang - in my experience the window is spawned by the OS in a "follow" mode and stays in my view until I pin it. |
Can I write codes to control the launched window, for example, automatically pin it and translate it to pre-defined location by attaching a world anchor? |
...I'm not to sure, but I think so
**FirstLostLastFound°°
…On Tue, Sep 22, 2020, 4:16 AM csxbwang ***@***.***> wrote:
@csxbwang <https://github.com/csxbwang> - in my experience the window is
spawned by the OS in a "follow" mode and stays in my view until I pin it.
Can I write codes to control the launched window, for example,
automatically pin it and translate it to pre-defined location by attaching
a world anchor?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#5047 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKK4QQNPQATDNWMHJV2LMULSHCBQJANCNFSM4H3L3RQA>
.
|
@csxbwang - not something I've tested, but looking at the APIs I don't believe so. You're effectively launching a URI directly into the system and then letting it do it's thing. I'm not certain there aren't APIs for controlling external applications, but due to the sandbox nature of UWP I'm not optimistic they exist. |
In addition to not being able to position the launched program/browser, it seems you can only launch one (at least using LaunchUri). Any thoughts on how to launch multiple? |
Note that this is an old (merged) pull request. @paulparkinson, for posterity, if you don't receive an answer here you may want to open a feature request issue. |
Overview
Add a button that launches the Edge browser. This demonstrates that the browser slate can be launched while your application continues running.
The web page that is launched contains controls modeled after the Unity GUI controls in the examples, showing a button, checkbox, slider, dropdown, and edit box. This demonstrates the option of integrating with existing web tools or of creating simple form UI using HTML and shows what this kind of interaction would feel like.Note that I originally implemented this by calling the UWP LaunchUriAsync API, but later found out that is unnecessary because Unity's Application.OpenURL seems to work just as well.Changes
Verification
Note that this references a web page in order to demonstrate using web controls from within a browser. Because I didn't want to host a web site for this purpose, I am linking to a page on github. That page won't exist unless this PR is first merged to mrtk_development.If you would like to try this change locally, you can change the URL to point to the HTML file in my fork as follows:In HandInteractionExamples.unity, select the SceneContent/LaunchBrowserButton object.In the inspector, scroll down to the Interactable OnClick event. Change the URL to the following:http://htmlpreview.github.io/?https://raw.githubusercontent.com/ForrestTrepte/MixedRealityToolkit-Unity/feature/launchBrowser/Assets/MixedRealityToolkit.Examples/Demos/HandTracking/WebForm/SampleWebForm.htm
.