Forums | Mahara Community

Developers /
HapYak Interactive video


Gideon Williams's profile picture
Posts: 108

01 March 2014, 6:52

HapYak are one of the better of the new interactive video packages on the web. Put simply, you upload a YouTube video and then add in various assesment features along the way,. You can then embed the video. Works fine on Moodle but not on Mahara.

The code is "<iframe src="//hapyak.com?embed=true&amp;edit=false&amp;startInEditMode=false&amp;track=15572&amp;project=3162&amp;key=2a69d0613a6a43b5a613&amp;source=youtube&amp;source_id=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DNWjso1EqSXc&amp;controls=true&amp;nativeControls=false&amp;reset_variables=true&amp;autoplay=false&amp;aspect_ratio=1.3328" class="hapyak-embed" marginwidth="0" marginheight="0" allowfullscreen="" webkitallowfullscreen="" mozallowfullscreen="" frameborder="no" height="699" scrolling="no" width="853"></iframe>"

I have tried an iframe source of hapyak.com and hapyak.com/emded but no luck. The code goes in and I can see it on the "design" view but when I save it I get a blank box.

Any ideas what is going wrong or what I should be putting in to get it to work (if it does work that it)!

Thanks so much

Gid

01 March 2014, 8:02

Hello,

Have you added the iframe source to the allowed sources in your Mahara? If not, see section 9.6.3 "Allowed iFrame sources" in the user manual : http://manual.mahara.org/en/1.8/administration/extensions.html?highlight=iframe#allowed-iframe-sources.

-dajan

Gideon Williams's profile picture
Posts: 108

01 March 2014, 9:27

Sadly yes but still no luck.
Gideon Williams's profile picture
Posts: 108

01 March 2014, 9:28

It recognises the site and adds in the icon but when I copy and paste the code in a text box it then removes most of it.
Kristina Hoeppner's profile picture
Posts: 4731

02 March 2014, 22:29

Hello Gideon,

If you add the video in a text box, the video will always be displayed because HTMLPurifier only comes into play upon saving the text box.

I don't know why the site is not working. It would require a developer to take a look. I can't see Javascript code and external iframes should work with the stripped out protocol. You can't use "hapyak.com?embed" as source because ? is not allowed in a site title, thus I tried with just hapyak.com but that didn't yield a result.

If used in a text box, the HapYak code gets stripped down to <p><iframe width="853" height="699" class="hapyak-embed"></iframe></p> - thus I think there is something in the iframe code that HTMLPurifier does not like.

Cheers

Kristina

 

Gideon Williams's profile picture
Posts: 108

02 March 2014, 23:14

Thanks Kristina for the detailed repy.

I had tried those options and they did exactly as you said. Frustrating that the code works OK in Moodle.

Ah well...

 

Gregor Anželj's profile picture
Posts: 349

03 March 2014, 5:34

Works for me...

The iframe code isn't correct though - you have to add slash character (marked red)!

"<iframe src="//hapyak.com/?embed=true&amp;edit=false&amp;startInEditMode=false&amp;track=15572&amp;project=3162&amp;key=2a69d0613a6a43b5a613&amp;source=youtube&amp;source_id=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DNWjso1EqSXc&amp;controls=true&amp;nativeControls=false&amp;reset_variables=true&amp;autoplay=false&amp;aspect_ratio=1.3328" class="hapyak-embed" marginwidth="0" marginheight="0" allowfullscreen="" webkitallowfullscreen="" mozallowfullscreen="" frameborder="no" height="699" scrolling="no" width="853"></iframe>"

Kind regards, Gregor

 

PS: This is because the ommited parts that may confuse things...

Previously it was like: hapyak.comindex.php?embed (any you would spot immediatelly that something is wrong...)

Now it's: hapyak.com/index.php?embed (or in ommited form: hapyak.com/?embed)

Gideon Williams's profile picture
Posts: 108

03 March 2014, 7:21

Gregor

You must have some special touch!

When I added in the missing backslash, it still stripped out the rest of the coding to leave just "<p><iframe width="853" height="699" class="hapyak-embed"></iframe></p>"

The iframe source I am using is hapyak.com/embed

Might you be able to tell me where I am going wrong?

 

Sorry, Gideon

Gregor Anželj's profile picture
Posts: 349

03 March 2014, 8:10

My iframe source is only: hapyak.com.

Maybe that's it?

HTH, Gregor

Aaron Wells's profile picture
Posts: 896

03 March 2014, 11:12

The iframe source needs to be only the domain (and optionally the path) part of the URL. Everything from the "?" onward is the query part of the URL. So the iframe source should just be hapyak.com

However, Kristina mentioned trying it with an iframe source of just hapyak.com and it didn't work for her, either. So there may be something more going on here as well.

(... and technically speaking, a "/" is a forward slash, not a backslash. Wink )

Cheers,

Aaron

15 results