I am using the simple arjs example to my angular project but i cannot get any results using the hiro marker.
This is the code:
<a-scene embedded arjs>
<a-box position='0 0.5 0' material='opacity: 0.5;'></a-box>
<a-marker-camera preset='hiro'></a-marker-camera>
</a-scene>
When I point my smartphone to a hiro marker nothing happens.
Is this because my device is not supporting AR? I have a Xiaomi redmi note 6 pro.
I read that in order for the AR to work on the device I need to have AR Google services which are not supported by my device.
Does arjs need AR google services in order to work? If not what are
the other reasons?
PS.
I am on https and the camera is open.
I am on an angular project and I am importing the scripts on the
index.html head
these are the scripts:
<script src="https://aframe.io/releases/0.8.0/aframe.min.js"></script>
<script src="https://cdn.rawgit.com/jeromeetienne/AR.js/master/aframe/build/aframe-ar.js"> </script>
As Far As I Know arjs does not need AR Google Services in order to work
I think the problem is you need to put the your object, which is <a-box>, inside the <a-marker>
Try:
<!DOCTYPE html>
<html>
<script src="https://aframe.io/releases/1.0.0/aframe.min.js"></script>
<!-- we import arjs version without NFT but with marker + location based support -->
<script src="https://raw.githack.com/AR-js-org/AR.js/master/aframe/build/aframe-ar.js"></script>
<body style="margin : 0px; overflow: hidden;">
<a-scene embedded arjs>
<a-marker preset="hiro">
<a-box position='0 0.5 0' material='opacity: 0.5;'></a-box>
</a-marker>
<a-entity camera></a-entity>
</a-scene>
</body>
</html>
You can also see another example here: https://github.com/AR-js-org/AR.js/
Related
Currently, I had developed Microsoft Graph ChatBot which retrieves the data from SharePoint but when I debug in Emulator its work, but I deploy in WebChat the result did not display.
The results from Emulator,
The results from WebChat
Anyone know how to solve it or suggestion?
There are currently two versions of Web Chat: Gemini and Scorpio. Test in Web Chat is still using the older version - Scorpio - which unfortunately does not support OAuth Cards. The BotFramework Development Team is working to update Test in Web Chat, but if you need an immediate fix, I would recommend creating your own web page that uses the latest version of Web Chat. Take a look at the sample code below.
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>WebChat</title>
<script src="https://cdn.botframework.com/botframework-webchat/master/webchat.js"></script>
<style>
html, body { height: 100% }
body {
margin: 0;
}
#webchat {
height: 100%;
}
</style>
</head>
<body>
<div id="webchat" role="main"></div>
<script>
(async function() {
// Note, for the simplicity of this example, we are simply using the Web Chat Secret here;
// however, it is recommended that you create a backend REST API to generate and manage
// tokens for production.
window.WebChat.renderWebChat({
directLine: window.WebChat.createDirectLine({ secret: '<WEB_CHAT_SECRET>'}),
}, document.getElementById('webchat'));
})().catch(err => console.log(err));
</script>
</body>
For more examples of how to get started with Web Chat, take a look at the Web Chat samples.
Hope this helps!
I'm trying to get simple code for modernizr js to say whether or not a browser can support geolocation api. Here's my code.
<script src="js/vendor/modernizr-2.8.3.min.js"></script>
<!-- check if geolocation works on browser -->
<script>
if(Modernizr.geolocation)
{
document.getElementById("geoConfirm").innerHTML = "This will work on this browser!";
}
else{
document.getElementById("geoConfirm").innerHTML = "This will not work on this browser";
}
</script>
<p id="geoConfirm">Test</p>
It's such simple code but it's not working, and it's bugging me because there's barely anything to go over. Thoughts?
I keep reading that the console.log needs to come after the onDeviceReady function, but I don't see any onDeviceReady functions in the cordova.js. Do I need to write my own? Does anybody know what the function would look like? What if I just wanted to console log "hello"?
Also, I noticed that cordova.js is not included as a script in the index.html. I'm assuming it needs to be if I want to see anything logged in the xcode console?
If you create the phonegap project by command line interface as described in their site
You should include cordova-3.x.x.js in your html head.
<head>
<script type="text/javascript" src="cordova-3.x.x.js"></script>
<script>
function onLoad() {
document.addEventListener(
'deviceready', onDeviceReady, false);
}
function onDeviceReady() {
// do Something!
// example: display a Cordova Console
// see docs.phonegap.com for full details
console.log("HELLO...");
}
</script>
</head>
<body onload="onLoad();">
Inorder to use the debug console in phonegap, you should add the plugin to the project by CLI
Type this command in Terminal
$ cordova plugin add org.apache.cordova.console
I set up a brand new project using the PhoneGap starter template in Visual Studio. The template works as expected, but if I try to add jquery mobile to the page, and call a function from it, its reported that jQuery is undefined.
here is my template javascript:
<script type="text/javascript" charset="utf-8" src="cordova-1.5.0.js"></script>
<script type="text/javascript" src="jquery.mobile.min.js"></script>
<script type="text/javascript">
document.addEventListener("deviceready",onDeviceReady,false);
// once the device ready event fires, you can safely do your thing! -jm
function onDeviceReady()
{
document.getElementById("welcomeMsg").innerHTML += "Cordova is ready! version=" + window.device.cordova;
console.log("onDeviceReady. You should see this message in Visual Studio's output window.");
jQuery("#welcomeMsg").html("blah");
}
</script>
My CordovaSourceDictionary.xml looks like it is ok too:
<?xml version="1.0" encoding="utf-8"?>
<!-- This file is auto-generated, do not edit! -jm -->
<CordovaSourceDictionary>
<FilePath Value="www\cordova-1.5.0.js"/>
<FilePath Value="www\index.html"/>
<FilePath Value="www\jquery.mobile.min.js"/>
<FilePath Value="www\master.css"/>
</CordovaSourceDictionary>
but upon trying to debug the WP7 app, i get these errors:
ScriptNotify :: Error:"'jQuery' is undefined"
Log:"Error in success callback: Connection1 = 'jQuery' is undefined"
In the code you posted, you aren't including the jQuery core... jQuery Mobile is built on-top-of jQuery Core so the core must be included before jQuery Mobile or jQuery Mobile will not function.
Notice on the jQuery Mobile download page the order of includes (mobile.css, then core JS, then mobile JS):
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css" />
<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"></script>
Source: http://jquerymobile.com/download/
On chrome it works ok.
My flash version is WIN 10,0,32,18
Debug: No
This is the code that i wrote:
<script type="text/javascript" src="/swfobject.js"></script>
<div id="player">
Get the Flash Player
to see this player.
</div>
<script type="text/javascript">
var so = new SWFObject('player.swf', 'streambaby', '500', '15', '7');
so.addVariable('type', 'sound');
so.addVariable('file', 'http://path_to_shoutcast:port');
so.addVariable('displayheight', '15');
so.write('player');
</script>
The problem is that on chrome the stream works OK but on Firefox 3.5.2 it stopps after a few seconds.
I opened Firebug and hit the Net tab and I see that even after the playing stopps, firefox still downloads the stream.
I've searched on google and found answeres that said I should update my flash plugin, but it's the latest.
I managed to bypass this problem with adding
so.addVariable('duration','-1');
Before so.write, so the script becomes:
<script type="text/javascript">
var so = new SWFObject('player.swf', 'streambaby', '500', '15', '7');
so.addVariable('type', 'sound');
so.addVariable('file', 'http://path_to_shoutcast:port');
so.addVariable('displayheight', '15');
so.addVariable('duration','-1');
so.write('player');
</script>
Just for reference, I had a similar issue while streaming .nsv in Firefox with JW Player. It would only stream about a quarter of a second. I accidentally defined an invalid duration and it started to stream correctly. I ended up using this code:
so.addVariable('duration','invalid');
This works for me in Firefox, IE and Chrome.