/
Web AR for mobile devices!
Built entirely using standards-compliant JavaScript and WebGL, 8th Wall Web is a complete implementation of 8th Wall’s Simultaneous Localization and Mapping (SLAM) engine, hyper-optimized for real-time AR on mobile browsers. Features include 6-Degrees of Freedom Tracking, Surface Estimation, Lighting, World Points and Hit Tests.
install npm
so far so good…
“City.mp4” 360 video link: https://cdn.8thwall.com/web/assets/video/city.mp4
Script:
AFRAME.registerComponent('play-on-window-click', {
init: function() {
this.onClick = this.onClick.bind(this);
},
play: function() {
window.addEventListener('click', this.onClick);
},
pause: function() {
window.removeEventListener('click', this.onClick);
},
onClick: function(evt) {
var video = this.el.components.material.material.map.image;
if (!video) { return; }
video.play();
}
});
// Add this to line 24 before the ending of script tag.
Serve Command:
Make sure you are in the “web-master” directory before executing the following command. (run “pwd” on Mac or “cd” on Windows to print out the current working directory)
Mac:
./serve/bin/serve -d examples/aframe/portal
Windows:
serve\bin\serve -d examples\aframe\portal
Note: If you are trying to run the serve script from another directory, you’ll likely have to adjust the paths to the serve script and/or project directory. For example, if you are in the “web-master/serve/bin” directory, you’d run:
Mac:
./serve -d ../../examples/aframe/portal
Windows:
serve.bat -d ....\examples\aframe\portal
Asset Declaration:
<video id="video" style="display:none"
autoplay loop crossorigin="anonymous" playsinline
webkit-playsinline>
<!-- MP4 video source. -->
<source type="video/mp4" src="NAME.mp4" />
</video>
// Add this inside <a-assets> on line 94
// Edit NAME.mp4 with city.mp4
Call Asset:
<a-videosphere rotation="0 0 0" src="#video" play-on-window-click>
</a-videosphere>
// Add this code to line 173 and remove the unicorn.gltf and the platform over which it's placed.
Thank YOU