How to add a unity app to a wix site? - deployment

I developed a simple app in Unity for a web site. How can I add my app to my wix site?
I tried finding on the web articles on how to do so but found nothing useful.

A web build will provide you with an HTML and a .unity3d file. If your host allows you to embed HTML, take the relevant sections out of the HTML file and upload your .unity3d file.
If your host does not allow you to upload the required .unity3d file, you'll have to host it yourself. This can be on your own server, on a Dropbox, or wherever you find appropriate. This does require a small change in the generated JavaScript.
Inside your HTML file you'll find a line like
u.initPlugin(jQuery("#unityPlayer")[0], "myAwesomeGame.unity3d");
Of course the exact name depends on however your build was named. If you don't host it in the same location as the HTML, you'll need to update this.
Say you're uploading it to your public Dropbox folder. In that case you can get a public link for the Unity3D file. Replace the call above with something like
u.initPlugin(jQuery("#unityPlayer")[0], "https://dl.dropboxusercontent.com/u/XXXXXXXX/myAwesomeGame.unity3d");
and you should be good to go. Of course the same works for other hosts.

Related

Load PDFs from local file share

I'm developing a web app for in-house use and I'm looking for a better way to display PDFs.
I've played around with Adobe's 'Work with Local File' example from GitHub, Adobe GitHub Example, and it works great using the file picker to display a PDF. Is it possible with Adobe's PDF Embed API to take a file located on a local file share and display the PDF?
I'm thinking I need to create a file promise but I'm not sure how to create that.
Unless you can make a network request to load the PDF, the answer is no. Browsers generally can't read from local files unless a user action actually picks the file. If your local share can be made accessible via HTTP, then you would be good to go.

Hugo deploy and delete not necessary files

I'm developing a new Hugo site and in this case I thought to create also a template so.I can use for future site.
Well in the template there are tons of vendor files and library because depending of the pages that the site will implement these library will be used. The problem is on the deploy. For example I use Line icons library that has a lot of .png files. (For example 200 files).
Well in the template I put all the files but could happen that in the site that implement this template I use only five icons. Is there a way that look around the final HTML and the usage of the icons and delete in the public folder the not necessary files?
Not directly.
You would need to add an utility script to your template, in order for any user implementing said template to be able to call this script on demand.
That script should then be able to:
analyze the HTML files generated in public_html
cleanup the icons accordingly

Why google search console need to verify dns txt?

First I build blog in hugo and deploy with netlify.
Verifying with file or txt, it isn't rendered in my case. I try to put content folder, also themes folder. So i found alternative way using google Web master center. And then, just add html tag. Finally, I got Verification completed. But, I can't use search console, yet. Because I'm not verified.
Why and How can correct?
If you want static content, rendered as-is, place it in Hugo's static directory and it will be added directly to the output public directory without alteration. Alternatively, you could use a meta tag to verify; just place that in your base layout; typically layouts/_default/baseofhtml.html

Access downloaded pdf file path in HTML5 file system and display it in webview

In my chrome app, I am using HTML5 file system to save the pdf files to sand box.Downloading is working fine.But how do i access that downloaded file path? I want to give that path as webview source.
The best way, if it works, would be to use a filesystem URL. To get this use FileEntry.toURL
These don't work on external files (i.e. files that come from chrome.fileSystem.chooseEntry and are outside the app's sandbox) but should work for files in the app's sandbox.
Note, I am referring to filesystem:// urls not file://urls, which won't work as Marc Rochkind has pointed out in his answer.
Disclaimer: I haven't tested this, but I believe it should work.
You need to get the contents of the PDF into a data URL. See my answer to this question:
Download external pdf files to chrome packaged app's file system

Unity web open custom html after build

I made a custom html file for my Unity web project. Though after building my project, it opens the default pre-made one. Is there a way to make Unity open my own html file instead of the default one?
You're looking for the Web Player Templates manual page.
In your Assets folder, create a folder named WebPlayerTemplates, and put your template in there. You'll need an HTML file. To help make this slightly easier, Unity will look in that HTML for certain tokens that it can replace with data from the project.
For example, one such tag is %UNITY_WEB_PATH%, which will be replaced with the path to your built project file.
Some tags include:
UNITY_WEB_NAME Name of the webplayer.
UNITY_WIDTH UNITY_HEIGHT Onscreen width and height of the player in
pixels.
UNITY_WEB_PATH Local path to the webplayer file.
UNITY_UNITYOBJECT_URL In the usual case where the page will download
UnityObject2.js from the Unity’s website (ie, the Offline Deployment
option is disabled), this tag will provide the download URL.
UNITY_UNITYOBJECT_DEPENDENCIES The UnityObject2.js have dependencies
and this tag will be replaced with the needed dependencies for it to
work properly.
In every deployment I've seen, the WebPlayer plugin is is launched via JavaScript, by instantiating a UnityObject2 and calling its initPlugin method:
var u = new UnityObject2();
u.initPlugin(jQuery("#unityPlayer")[0], "Example.unity3d");
The above assumes that you have a div with id #unityPlayer, and that Example.unity3d is a valid path to your Unity build file.
In practice, though, I recommend working from Unity's generated HTML files; they include some failsafes for cases where the WebPlayer plugin isn't installed or fails to load. The manual page linked above also has HTML source examples which include some of those special tags.
UnityObject2 does have some advanced features, which are also documented in the manual. If your game needs to communicate with the outer web page, that is also possible.