Arrrrrr, AR!

tl;dr There’s a new content type for H5P called AR Scavenger. It features Augmented Reality. You can download it here.

Quite some time ago, Nele Hirsch approached me, asking if it was possible to create a content type in H5P that would allow to feature Augmented Reality (AR). From scratch? Quite a job! But in the wonderful world of open source software, there’s a framework called AFrame that allows you to use 3D models in a browser. And then there’s another framework called AR.js that builds upon AFrame and allows to blend 3D models into a device’s camera image. Nele pointed me towards that one. And now there’s AR Scavenger that builds upon AR.js and blends it all with H5P. It’s fair to mention that the soultion would probably not have been finish done now – but later – if the Hamburg Open Online University (HOOU) and the HAW Hamburg in particular had not partially funded this initial version.

Aktivieren Sie JavaScript um das Video zu sehen.
https://youtu.be/yB36QZUh-wY

What can I do with this?

Just take a look! Here’s the content type that you can use right away, but you’d have to use it on a device that has a camera attached to it. Then just find the markers down below with your camera – either on another screen or print them on paper.

Marker 1

This one should simply show you a True-False-Question, but on paper you could put any H5P content type here.

HIRO marker

Marker 2

This one should show you a 3D model of a duck that’s facing out of the marker, so if you have the marker on a screen, the duck should look right at you.

DUCK marker

What is it good for?

So, obviously you can define markers and either let H5P interactions pop up whenever a marker is found, or you can blend a 3D model with the camera image. Not much, but using that features

  • you could create some scavenger hunt game in a physical environment that requires students to find a marker to open a quiz related to the place of the marker,
  • you could add markers to exhibits in a museum to deliver additional information in an Interactive Video,
  • you could add digital 3D models to a physical book,
  • you could …

I bet you will come up with even better use cases …

There are more sophisticated apps with a wider variety of features, but you usually have to pay for them in some way, and they’re usually not open source software. So, use this content type to take your first steps with Augmented Reality – and possibly work on software improvements, too?

How can I get it?

Ultimately, you will be able to install H5P AR Scavenger just like any other H5P content type from the H5P Hub, but the H5P core team will have to find some time for reviewing and releasing it first. Until then, you could download the required libraries (H5P.ARScavenger-library.h5p.) and upload them via the library settings page of your H5P plugin (not the H5P Hub where you’d upload content):

  1. Download the libraries file (https://www.olivertacke.de/labs/wp-content/uploads/2020/08/H5P.ARScavenger-library.h5p)
  2. In your H5P plugin, go to the library settings page
    • Drupal: Content -> H5P Libraries
    • moodle: Site Administration -> Plugins -> Activity modules -> H5P Libraries
    • WordPress: H5P Content -> Libraries
  3. Find the “Upload Libraries” section and upload the file that you just downloaded. You should get a message like “Added x new H5P libraries”.

Also, you can get all the source code on github, but it’s spread across a couple of repositories starting with H5P.ARScavenger (+ H5P.AFrame + H5P.AFrameAR + H5P.AFrameOrbitControls + H5PEditor.InputRow + H5PEditor.ARMarkerGenerator + H5PEditor.ThreeDModelLoader).

But there’s at least one catch!

H5P does not allow to upload gltf and glb files

H5P currently doesn’t allow to include files with the extension gltf or glb that are required for the 3D models. The H5P core team will allow this shortly. Until then, without some modification, you will only be able to use AR Scavenger for H5P content types.

On Drupal you can amend the list of allowed extensions in the H5P plugin settings, but not in other plugins. So, here’s the pull request to allow uploading gltf and glb files. The changes will point you to what you’d have to patch if you’re not running H5P on Drupal.  If you want to do this manually:

  1. Know what you are doing
    You cannot really break anything here, but if you’re new to this and make a mistake, you might get some sweat 😉
  2. Find h5p.classes.php
    On WordPress, it should be located at your-wordpress-path/wp-content/plugins/h5p/h5p-php-library/h5p.classes.php. On moodle it should be located at your-moodle-path/mod/hvp/library/h5p.classes.php. If you’re using moodle 3.9 and above including moodle’s H5P integration, it should be located at your-moodle-path/h5p/h5p/lib/joubel/core/h5p.classes.php
  3. Take a look at yourself and then make a change
    Add gltf and glb as shown at https://github.com/h5p/h5p-php-library/pull/85/files

H5P cannot access the camera

This one shouldn’t be a problem in many cases, but it might become one. Browsers are becoming more and more strict when accessing browser features such as video or microphones and expect HTTP Feature Policies to be in place (also potentially causing trouble for Audio Recorder). There’s a discussion about this topic related to H5P at https://h5p.org/comment/35346. I am proposing a code change (for WordPress to be adapted to Drupal and moodle) that will allow to use browsers’ features within the H5P iframe (unless the server is even more strict and doesn’t allow them).

If your browser (on your server) simply won’t ask you for the camera, you may need this patch. A suggestion can be found at https://github.com/h5p/h5p-wordpress-plugin/pull/114. The changes will point you to what you’d have to patch on WordPress yourself. There’s no suggestion yet for Drupal or moodle, but if you can code a little, it won’t be difficult to temporarily apply the same approach manually.

Questions? Maybe I have answered them already

Sponsor Note

Die initiale Fassung dieses Vorhabens wurde gefördert durch die HOOU und die Behörde für Wissenschaft, Forschung und Gleichstellung der Freien und Hansestadt Hamburg.

The initial release of this project was funded by the HOOU and the Ministry of Science, Research and Equality of the Free and Hanseatic City of Hamburg.

14 Replies to “Arrrrrr, AR!”

  1. OMG, that completely blew my mind!!
    That is such an amazing feature, thanks a lot for developing it. I cant wait to use it somehow.
    You can use it in so many different ways.

  2. Hello Oliver,

    I really would like to use your enhancement in Terms of AR for H5P. It seems amazing! Tried to install it like you described it on my Moodle site ( 3.10). I have got al lot of error reports. It says that I am not allowed to install the folders of your Plugin Library. Wrong content type. I am not quite sure whether I should allow other content type without knowing what will happen.

    Would really like to use it!

    Thank you for your help!

    1. Hi Jan!

      I am not sure how I am supposed to help here. You already tried to install the library knowing that it has not yet been reviewed by a third party, and you seemed to have been fine with that – what if moodle had not complained about a lack of rights to install custom libraries? What’s different now that you are obviously required to use some admin account?

      Best,
      Oliver

  3. Hi Jan!

    Me again. I just checked how the moodle core integration of H5P (which is not the same as the plugin) handles H5P libraries.

    I assume you did NOT go to the library settings page as my manual suggests, but you went to a course of the content bank and tried to upload the file that I linked to there. That file is a library only, not some content, so moodle will not upload it there (which is absolutely correct).
    If you instead download the demo content from the page and try to upload it, moodle will complain that there’s a gltf file inside that cannot be used (which is also absolutely correct as I described in the blog post).
    If you are, however, on the library settings page as my blog posts suggests (you need to be an admin), then you can upload both an H5P content file (which is a bunch of libraries + some parameters) or the H5P library file without problems (which is how it is supposed to be).

    Best,
    Oliver

    1. Hi Oliver,

      thanks a lot for your help! You are definitly richt with your first answer to my request. I tried to install it in the wrong place at the site administration. I have managed to install your zip file now with no problems. It ist listed now as a installed H5P Type. I dont want to waste your time with moodle admin questions, but it didn’t show up when I trie to select it as a h5p-content type on the h5p hub. But I will ask our server Admin for detailled help.
      Thanks Again and thanks for your contributing for the open educational ressource world and mor equality and chances in Education!
      kind regards,
      Jan

      1. Hi Jan!

        Don’t worry, I am not annoyed. It’s just that I am not an expert for moodle, let alone moodle’s integration of H5P that’s quite different to the H5P plugin for moodle. Unfortunately, the flexibility of sharing content (that may include new libraries that are not yet installed on the target platform) is limited by restrictive rights management – on the other hand I fully understand why administrators prefer it that way.

  4. Wow. This opens up so many possibilities!
    In my experiments, some glTF aren’t working so well.
    https://github.com/KhronosGroup/glTF-Sample-Models
    The avocado, for instance.
    (Tried different formats.)
    But then, some very complicated files do work.
    https://h5ptest-aenkerli.profweb.ca/?p=25

    Since I want to introduce this during a Zoom meeting, I need to figure out a way to make things work. Not sure I’ll share my phone’s screen, as it can get a bit complicated for something which is a small part of a longer session. Besides, I mostly want people to try it themselves.
    I’ll probably share the QR code from WP and then display the marker. Was trying to think of an image that people might already have with them…

    At any rate, I’m already thinking of a number of things to try with learners and learning pros.

    1. Hi Alex!

      The content type should be able to handle any model that an out of the box AFrame in version 1.0.4 can handle, as that’s used as a foundation. I have not included all kinds of loaders though as this was beyond the scope of the contract. I just tried the Avocado model (glTF 2.0 binary) and it works just fine. The only thing that I noticed is that you’ll have to zoom in quite a bit given the model’s default view parameters.

  5. Hi Oliver,
    thank you for that really valuable work! We consider the usage of ARScavenger for a “art bounty hunt” throughout a city.

    Is there a (offiicial) way to enable interactive video as h5p content type using ar scavenger? As i saw, on the demo page at einstiegh5p.de this is possible there.
    In my demo installation, normal video is available, but interactive video is not in the dropdown at the arscavenger content creation screen.
    (interactive video as “plain” h5p content works)

    where is the magic wand hidden?

    Thank you,
    Thomas

    1. There’s no magic wand required. AR Scavenger is referencing version 1.22 of Interactive Video. If that’s not installed on your platform, then you cannot use it.

      If you can wait a couple of weeks: The content type is currently being reviewed for release on the H5P Hub, so it will get an update soon anyway.

Leave a Reply

Your email address will not be published. Required fields are marked *